Jump to content

LOD system questions


Rick
 Share

Recommended Posts

I'm curious as to how you would go about making an LOD system given LE 3.1 as it stands today. The only way I can think of is by using the common entities between ForEachEntityInAABBD0() and ForEachVisibleEntityDo() around the player at different sizes to get the various levels, where anything outside uses the lowest poly model as the default model.

 

 

I'm thinking of attaching a script to every model that needs this functionality and having it load all the LOD models in Start() (the models would be script parameters), and in UpdateWorld() always showing the lowest poly model. Then in App:Loop() after the world is updated, running the this LOD code to switch what models are shown based on the camera position and the AABB's around it.

 

Any other ideas on how to do this?

Link to comment
Share on other sites

Dont think about LOD without threads.

 

LOD a nothing to do with threads.

Even super old 3D engines without threads had LOD.

 

@Rick :

They are techniques to reduce memory used by LOD like texture mip mapping , real time LOD etc ...

For LE3 if we must make one lest' say : 3 LOD stages of a model

- put one model level as parent and two others a childs

- or one empty object containing all 3 LOD modesl as childs.

Than by code each 200 frames, check the distance of camera and model, and just call Show(), Hide() on the appropriate model for the distance.

 

--------------------

 

Other LOD possible optimisations :

Can shaders be changed at runtime ?

Could be interesting for very long distance models to disable specular and normal maps.

Can we change animationManager to update only some frames not each frame ?

We could also update animations not each frame for very distant objects (to test)

Stop toying and make games

Link to comment
Share on other sites

@YouGroove

 

If you hide a parent the children will be hidden too as far as I know. There wouldn't be any need to make a parent/child relationship I don't think.

 

I for sure wouldn't want to manually check the distance of ALL entities in the scene to the camera. The ForEachEntityInAABBDo() is doing a distance check, and ForEachVisibleEntityDo() would reduce it even further to only care about the models we can see.

 

Shader can be changed at run-time but instances share the material/shader and if one was to care about LOD one will be using instances to further optimize. So you can't change the shader because it'll effect closer entities as well.

 

Using Animations would be possible. I would make a custom one maybe that is geared more for LOD support. I don't think this would make much of a difference between separate models though.

Link to comment
Share on other sites

Not every game gets the same amount of fps. When you first start your game your world is small. As your game grows the fps come down. The final target range should be around 60 fps. So checking distance from an object to the camera every 200 frames will not do. As your games games evolve your code for this will have to also. Twice a second should be good enough to fool the eye. So if your game is getting 60 fps. Then every 30 fps is fine.

 

Also there is no reason to disable texture maps at long distances because the low quality lod's should not have specular, normal, etc... Low quality lod should have only one low res texture. Also less bones.

 

Having said all of this. You do not need lod for opengl4. So I am guessing you need it for the low end renderer.

Link to comment
Share on other sites

Then tesselate that model at the the same distances that you would change the lod

 

Why do you phrase it like that? I thought tesselation was something that automatically happened based on the distance. I wouldn't think we have to do anything in code to say "tesselate" now.

 

 

Your mind will really be blown when josh gets the geometry shader going.

 

This could be a ways off though given his other priorities.

 

 

 

Also, an LOD system is still needed for certain models. A house model for example. You'd want far models to not have any interior but the closest to have one (if your game allows you to go into houses). So there is still a need for this.

Link to comment
Share on other sites

Also there is no reason to disable texture maps at long distances because the low quality lod's should not have specular, normal, etc... Low quality lod should have only one low res texture. Also less bones.

not disable texture maps, but switch to simple diffuse shader

 

Having said all of this. You do not need lod for opengl4. So I am guessing you need it for the low end renderer.

 

No tesselation si to "round" objects or make some volume.

But for character LOD , you must have control on how are made the topology on character for super optimisation.

Tesselation adds details and smoother forms, but it can add too much polygons unecessary indeed to characters as it is applies on all character.

Some example :

090928-dragon_no_tesselation_wire1.jpg

 

 

090928-dragon_tesselation_wire1.jpg

 

As you can see tesselation can produce a big GPU cost to display such amount of triangles and a lot are not necessary because you use normal maps.And characters must keep some topology for face and other stuff on them, tesselation can destroy the good polygon for keeping animations correct.

 

From what i read on the web that's not the technique for characters LOD used in distribued AAA games.

Correct me if you find tesselation used fro character LOD (not just rounding character edges)

 

--------------

 

LOD is good when you have created the maximum res Res character than use tools or manually create the lower versions.

Some engine like UDK propose to import your Lod versions or take the high version and use their tool to create lower versions.

SkeletalLODCathode.jpg

 

https://udn.epicgames.com/Three/ImportingSkeletalLODs.html

 

 

Manually or using some tools also , you have lot more control on what is done in LOD, with the good amount of polygons where they are needed

Wolves_LOD_Breakdown.jpg

3D_Primer_For_Game_Developers_fullsize_LOD-Models.jpg

 

Even this LOD simple example show you that clever polygon done manually is very optimized and juts perfect, where tesselation would add too much unecessary triangles where not needed (so lower frame rate)

 

lp1-humblebarrelLOD.jpg

 

So tesselation is not the new magic shader that would do great LOD for you automatically.

Stop toying and make games

Link to comment
Share on other sites

There are different levels off tesselation. You would not want to tesselate an object for every inch the camera moves. This would be costly. I have not seen how josh has implemented it but the user needs to determine which level of tesselation and how far.

 

 

 

@yougroove. The second picture of the dragon is obviously over tesselated for a video game.

Instead of having three or four lod's of a barrel. You can have one primitive barrel. Just for the neck of it lets say that barrel has six polygons. You could then tesselate it up to 460. Then if the camera gets closer, then tesselate it to 660. You could even use a decal on a section of the model and then only tesselate that decal part. Think of how much more memory you will have when you do not have all those lod loaded and just hanging around. Waiting to get used.

Link to comment
Share on other sites

Ok ,but AAA games do great using tricks or not, but using LOD clever made.

 

Without LOD FPS demo of LE 3.1 when crawlers appears slows down too much until 15 FPS, what i don't have with AAA games in my PC. So adding Tesselation on them will just asks lot more GPU and even lower frame rate.

With LOD no GPU is asked.

Anyway the day you'll have the beginning of a running game , just try yourself the two techniques : LOD Vs Tesselation and see by yourself performance and is animation still correct after tesselation ? or non desired tesselation problems.

 

If someone make a convincing system in LE3 with special tesselation tools to control what triangles of a character must be divided and rounded in each LOD why not ... the day this could happen and show as good performance as traditionnal LOD.

 

For now i prefer to save frame rate, and if we can create some script fast LOD system for 3.1 , i would be happy and it could benefit all people specially ones working on games with high res characters and level assets.

Stop toying and make games

Link to comment
Share on other sites

HI!

 

LOD for me would only do 2 tests to change the model:

- Is the model into view?

("Frustum culling", should be done automatically by the engine, just wonder if there a way to see if the entity was "culled")

|--> Get the distance of the model from the camera and replace the model with the correct version.

(For LOD to work correctly with this you need to have multiple polycount version of the same model).

 

There is poly reduction algorithm that I saw could be used to reduce dynamically the model, but would need to be done before you start the level because using it, recalculate the model with less geometry and is CPU intensive. (I prefer to do it manually in MAX)

 

As for Tessellation, this is only great if you intend to see the model REAL close, if the model is done right, and the camera is at a proper distance it won't make a difference visually. It would only matter when the camera is really close to the model.

 

As for LOD; the only thing that could complicate things would be on animated models. (perhaps do a test there to see if the entity is animated), if you had an animated model you would have to "sync" the animation when you change the model. This could even get worse if you are doing this on a RAGDOLL... (Sync the physic animation of the bones to another model and resume)

 

For a basic LOD, I really don't think doing this in a separate thread would accelerate things that much... (2 simple tests)

Link to comment
Share on other sites

..if im developing game, with system that doesnt support LOD, i will do simple octree like structure made out of bounding boxes, slicing down my game world. Bounding boxes will be same size (fixed size), and their setup will happen during loading, after entity with its LOD are loaded. During loading time, each entity will be checked in order to determine in which bounding space they residing initially. And thats all. During run time, it will be returned current bounding space camera is in, and based on that will be known links to surrounding bounding spaces. Then simply flip specific LOD generation based on which bounding box of entity with LOD is occupied, related to camera bounding space. So, you can set LOD to work in such a way that respond to hierarchy 'distance' of linked bounding spaces, related to camera bounding space and entity bounding space. Closer to root(camera bounding space), better quality LOD. Its very very fast and works perfect. I used similar system for Hoodwink, and something like that for new game we are working on (loads of enemies, forming patterns, etc)..

  • Upvote 1

 

Link to comment
Share on other sites

I guess this just falls in the category of old dogs and new tricks. I understand that the same technique has been used for the last twenty years. But with new technology comes new techniques. And also with new technology come hesitation, miss-understanding, and miss-information.

Tesselation is not only for the real close up. It will not allow you to render more triangles. It will however allow you to render more triangles closer to the camera. You do not have to go from six polygons to a million on a model. You can divide by smaller numbers than ten.

 

As for performance. The Gtx-480 can tesselate over 1.6 billion triangles per second. Not to shabby.

 

Since I must be having a hard time explaining it. Read the following link. It is a good general info on tesselation in games.

 

http://www.nvidia.com/object/tessellation.html

Link to comment
Share on other sites

..tessellation is not something you could call 'new'..its with us since DX9 time and perfectly doable in DX9, as well as documented..basically, whole tessellation process could be fit in to :

 

1) Select Triangle

2) Choose the largest edge of triangle

3) Bifurcate the selected largest edge

4) Now you have two triangles

5) Repeat until bored to death

 

So its nothing really new and it exists quite some time. ATI/nVidia/Intel chipset and what not, doesnt agree very well about particular technique, what eventually complicating execution on engine side, so, in order to maintain backward/hardware compatibility, much as its possible, I wouldn't put my bet on to hw tessellation..

 

Link to comment
Share on other sites

whole tessellation process could be fit in to :

 

1) Select Triangle

2) Choose the largest edge of triangle

3) Bifurcate the selected largest edge

4) Now you have two triangles

5) Repeat until bored to death

There's gotta be more to it than that. Doesn't it consider the triangles around it and adjust vertices accordingly (to make a rounder sphere, for example)?

Link to comment
Share on other sites

I don't really see how you would use tessellation for a LOD system - it's not just about the amount of triangles but also where they are placed/how they are oriented.

 

eg: a character viewed from 10m away could make do with a face made 100 polys or less the same character when viewed up close may have 1000s of polygons in the face to convey expressions and personality - tessellation would have no way of creating that detail

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

There's gotta be more to it than that. Doesn't it consider the triangles around it and adjust vertices accordingly (to make a rounder sphere, for example)?

 

Most likely the new vertex is offset based on a normal map or the like, meaning that your normal maps resolution is the effective limit of how much you can tessellate before doing so no longer adds detail.

 

Either than or it interpolates the vertex normals or it's "parents" and used that for offset - but that would just make everything rounder regardless of design intent.

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

@GameCreator

It works exactly like that..curvature is determined based on vertices alignement/direction so when edge is calculated, mantioned parameters are used to determine where set of new triangle vertices will be positioned. Thats why tesselated box doesnt get curved, while number of triangles can be rather huge, simply because offset angle between largest edges is zero..

 

Of course, with tesselation is always good to use displacement maps for best results, but personally, Ill never ever use it for LOD, considering current situation with GPU hardware manufacturers..

 

Link to comment
Share on other sites

@tournamentdan :

Tesselation won't make a next gen game and characters for you, if you can't make great characters and level design, if they look bad, tesselation won't magically make them look good. for you.

I see so lot of people asking that shader, that last 3D technique, but they don't do any game with them at final laugh.png.

They think they magically will be good at 3D art and level design suddenly because they got tesselation or Tress FX or whatever , but they forget they can't even make a good looking game using just standard shaders.

 

(LE3 brings you standard shaders (even with Glow maps), even LE3 without optimisations, you can make some gorgeous stuff if you have the skills)

 

---------------------

 

. So, you can set LOD to work in such a way that respond to hierarchy 'distance' of linked bounding spaces, related to camera bounding space and entity bounding space. Closer to root(camera bounding space), better quality LOD. Its very very fast and works perfect

 

 

@Naughty Alien : Yes that is what matters, level of detail very fast, could the technique be old or a simple trick.

Could LE3 go that way ? Open source system must exist ?

 

 

For old techniques : GTA 5 don't need Tesselation , and If people would know all the tricks used in GTA game series for such big game LOD and collisions tricks also .... laugh.png

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...