Which of following approaches will have less performance overhead(using threejs renderer)?
I am currently have an issue with z-fight for distant objects, while my near/far plane is already set to most optimal setting to show close and far objects. I am thinking to apply some more advanced techniques for z-fighting. Also I've check depth configuration, and it is set to 24 bits already by default.
I am still planning to do performance testing to see which will work better. However I would ask a question in advance, if anyone already had an experience with that, and can suggest which of the approaches has less performance overhead.
More details about both approaches can be found here: https://cesium.com/blog/2018/05/24/logarithmic-depth/
- Most simples approach from coding perspective, is to enable logarithmicDepthBuffer like on manual bellow https://threejs.org/docs/#api/en/renderers/WebGLRenderer.depth - and I am planning to start prototyping using it, however the drawback it will disable this https://www.khronos.org/opengl/wiki/Early_Fragment_Test kind of optimization.
- My concern if I will start scaling my scene with more object and shaders, it could be a performance issue then.
- So I was thinking about alternative approach, so called Multi-frustum rendering - basic idea is to render same scene multiple time, with different near/far plan setting without clearing color buffer.
- It will keep Early Fragment Test enabled
- However this approach is not for free, I have to render my scene multiple time.
- I still can do some extra-optimization, by rendering only certain object for certain near/far plan settings.
What approach should have less performance overhead for the same scene?
UPD: I've made performance test on tiny scene, and didn't noticed any difference ~3000fps in both scenarios, however still don't know what to expect on bigger scales?