RE: Code Snippet for more efficient tessellation
I noticed a problem with the code snippet above, and something of minor annoyance.
1. FIXED The terrain is also passed through this get_shader function, and if you pass tessellate as TRUE, it will always be tessellated when you turn object tessellation on (if you then turn on Terrain Tessellation, it's tessellated twice.. super slow!). BUT, if you pass tessellate as FALSE, the terrain will never tessellate, even with Terrain Tessellation set to TRUE.. How to solve this?
2. When tessellation is enabled on an object, it will tessellate the first LOD. This means that you need to customize your LODs for every object so that the 2nd LOD does not have a distance that is too high.. Else, it will tessellate objects that are far away. I solved this by making my first LOD and my second exactly the same (100% Quality), but the 2nd LOD has a distance of 5-15 so it won't tessellate beyond that distance and then display the actual first LOD. This seems ok, but it requires an extra LOD for every object.
3. For the LODs, it seems to be exchanging them with distance (from player to object) to the CENTRE of the object, not the ORIGIN. So, for very tall trees this distance is significantly reduced (2nd lod has a distance of 12, I never even see the first LOD, because the distance from the ground to the centre of the tree is more than this distance). Please let the distance be from camera to origin of the object, not the centre.
FIXED ---> INCREASE LOD SWAPPING DISTANCE FOR TALL OBJECTS
That being said, I need more control over which objects to tessellate. I don't want it on tiny bushes (on their solid parts), I don't want it on the player, ...). The material can't hold any custom data to check for this. What I am doing right now, is setting a material option that I never use to a specific value and don't tessellate on objects where the material has that value set. But this is extremely ugly and impractical.
Any ideas on this, Esenthel or anyone else?
(This post was last modified: 10-07-2015 01:41 PM by Tottel.)
|