LOD vs Occusion

So not sure where this topic belongs so I’ll place it here.

So my question really simple:
If the purpose of LOD is to use less polygons for objects that are less visible in order to achieve better performance, and the point of occlusion is to completely hide objects not in view in order to improve performance, wouldn’t you say that occlusion outweighs LOD in terms of both ease to setup and functionality?

The reason I ask is because I tried to have a LOD managed house in a Beast powered scene and every time I got close to the door the game would hang so badly that I had to force quit Unity. I assumed this was due to the fact that the building was marked as static and yet I add and remove it from the scene as I feel like it… On the other hand, if it is not marked as static then I can’t use it for lightmapping…

So the question arises… should I have only a high detail building inside an occlusion area or should I forego Beast and stick to the LOD system? Which is the lesser of the two evils?

LOD and Occlusion are two different things.

Try to make an outdoor scene (cityscape ie) without LOD. It’s like shooting a bullet in your GPU, and occlusion won’t help…

Please help me out here. This shoots a hole in my entire understanding of how occlusion works…

Occlusion hides what is off camera (or things occluded by things in view),
if what is on camera is too high poly count it will still slow down the render.

FROM WIKI: Level of detail techniques increases the efficiency of rendering by decreasing the workload on graphics pipeline stages, usually vertex transformations.

FROM WIKI: occlusion culling algorithms (also known as hidden surface removal (HSR), occlusion culling (OC) or visible surface determination (VSD)) are used to determine what objects cannot be seen because they are behind other objects (if they are inside the view frustum) or outside of the view frustum.

When you are playing a game there is a worklaod that goes to your GPU. LOD helps the workload on the GPU by simplyfying 3D models hence making the workload smaller. OC helps the workload on the GPU (and CPU?) by removing stuff from the workload.

Use them in combination would be my only suggestion. Hope that helps.

Y’know, there was this tool I saw for LOD that made everything automated, so there was no need for multiple LsOD.

I think it simply drew distant objects fewer times or something.

Can’t remember where I saw it though.

I actually have a LOD system that I am using that I got from www.3DMedia.be and I noticed the UniLOD on the forums also. Getting LOD to work is not the problem, Unity freezing to the point of a forced quit was the issue.

I tried it again last night and this time it no longer crashes the game when I use lightmaps and LOD together on a static mesh… nope, now simply nothing shows up :stuck_out_tongue:

I am totally new to this area of game making so I know I still have a lot to learn. I have a basic understanding of what each thing does (occlusion, culling, overdraw and the whole static mesh requirement) but I am now trying to figure out the best way of using them together.

My train of thought would have been to do what 3DMedia does and use LOD for the buildings when you are outside and only draw the interior models when you are close enough to get to the first LOD. Then, on the inside of the buildings, use occlusion to only show the room youare in (and obviously the ajoining rooms as and when).

This all makes sense to me. What doesn’t make a whole lot of sense to me is that the new Unity demo uses occlusion for the outside but AlexMat suggested that occlusion outside won’t make a big difference without LOD… So again, this brings us back to the original train of thought to use LOD for areas where you can see very far (outside) and possibly even occlude those, and inside use occlusion and simply stop rendering the interiors when you are far away from it…

…all this is fine and dandy until you realise that to use Beast you need to mark an item as static. I found it again in the docs last night that a static object is something that won’t animate or change… I just can’t recall the exact quote now, but basically, Beast wants static objects, static objects are not allwoed to change and LOD changes objects at the mesh level (meaning it replaces a 2000 vertice model with a 150 vertice model. No way the UV mapping will match if using the “Generate Lightmap UVs”) so… it would seem that one can either use Beast or LOD but not both…

Being a new comer to both concepts I am prepared to say “I am sure I am wrong about this” and ask for someone to explain to me where I am making my mistake…

LOD actually “replaces” an object with a lower poly version of it (also different maps if needed). We haven’t tested Beast since we don’t have access to 3.0 but:

Considering that all Beast does (over-simplifying and not sure if completely correct) is calculate a Lightmap and apply a static map (just as any external one) using your object’s UV coord. (or a second, automatically unwrapped one ?) then it should have no problems with LOD.

Occlusion culling works in any kind of scene. If it’s an exterior one but a large rock or building is obscuring the geometry behind it then it kicks in.

Check this out for a very clear explanation:

http://www.gamedev.net/reference/programming/features/occlusionculling/

Normally, the greatest gain from occlusion culling when you’re outdoors is that it hides the detailed interiors of buildings…

The opposite is a much higher gain, outdoor occluded when indoor.
also pure indoor / narrow environments benefit significantly (thats the base upon which quake and half life were able to achieve what they did in their days - bsp based occlusion)

That’s one form of LOD, but there is a form of LOD called progressive mesh LOD, which actually does what MrDude describes, morphing the mesh in realtime. It’s typically used in terrain engines, but it can be used with standard geometry as well. I don’t think it’s supported in Unity though, so it wouldn’t be an issue here.

isn’t there some way to ‘auto lod’ objects? … like in 3dsmax optimize modifier… it sure makes the object look bad the more you reduce the polys, but it does reduce the polycount and if it’s only applicable when the object is far away then it’d wouldn’t show

only if you work with DirectX, in that case you have the D3DX ProgressiveMeshes given you implement them in the engine.

but OpenGL has nothing like that

That’s true. My bad, I was referring more to the earlier comment that occlusion doesn’t help at all in an outdoor scene.

I’m a big fan of occlusion after we used occlusion planes on an Xbox/PS2 game we worked on ages ago. Artists just stuck these planes inside large objects like buildings and what have you. The engine dynamically found the closest 3 or 4 in the camera frustum and activated them culling everything behind. We later added negative occluders that cut holes in occluder planes so we could have doors etc. Worked great. Would be cool if Unity got something similar in V3. Perhaps Beast does something like it already?

Would work very well in a city if the player spends most of the time on the ground amongst the buildings.

I plan on implementing my own occlusion system similar to the one created and distributed by a forum member a while back. My idea is to use invisible geometry to collide with everything the player sees and then render it. Then of course I will do some more quick calculations to make sure I am not rendering things behind walls and then render the scene. Also, a simple tag system with the vision geometry would allow me to turn on and off detail objects from being rendered too far away. Now the question is can I code such a system that is efficient enough to outweigh the cost of all the calculations. Of course this whole idea instead here could be horribly inefficient, so if anyone has tried this already please let me know. Otherwise I will have to do some trial and error to see if I can do it myself. Sounds like a fun challenge to me! I cant wait till I have time to play around with the idea more.

That sounds like a good idea, but why would you want to do that when there is already a dedicated system that got thrown a ton of money at that will probably be better then your system? Sure I hear complaints about the calculation taking a while, but if developers can just be patient it will be better for the end user in the long run.

all will be good when they decide to add in DX11 hardware tesslation.

Also saw on Aras’s blog, he is planning to have DX11 support.

Well as of right now I don’t have the cash to purchase a pro license. Maybe in a few years when I am out of college and securely out on my own. Until then I must make due with indie.

I guess I shouldn’t worry about it since I plan on getting a pro version sooner or later. Also, I know it chunks up the scene, but does it also take care of all the dynamic objects on screen? What I mean to say is I know it will chunk up the terrain into pieces and the static objects that are part of it and allow it to be switched on or off. I am curious if it also takes care of disabling rendering the objects behind a wall that is in your path of vision. Does anyone know if it does this? I mean if I walk up to a cement barrier in an FPS made with Unity3’s occlusion/culling will objects behind the wall still be drawn and take up draw calls or will they be ignored and spare my GPU some work?

Seems like today’s blog video addresses my questions! It basically automatically generates viewing cells and if you can see into the cell, everything in the cell is made visible. Simple enough. So in essences, unless you have a high number of cells, objects behind other objects will be rendered as it will be included in your vision area.