Z fighting issues
#7
(06-21-2017, 10:55 AM)abenedik Wrote: I am also very interested in any recommendations to improve the calculation of zNear and zFar values.
This is currently based on the scene's bounding box, but if you have any better recommendation, I would gladly implement that in the DXEngine.

Could you please share your findings - you may also send that as a private message or email (support at ab4d.com).

I gave it some thought and honestly, don't see any better way. At least not efficient one.
Is the bounding box of the scene optimized? If not, it might help to calculate it and use that one instead.
Assuming we have a static scene, that is once initialized and no models are added/removed during runtime.

Also (again considering static scene), have you considered creating spatial octree of 2 or 3 levels and then move the zNear to the closest corner of the octree subdivision?

But what would most definitely help, would be a possibility to set bounds for the plane optimization algorithm. Perhaps as properties DXScene.minNearPlaneDistance and DXScene.maxFarPlaneDistance. The logarithmic distribution of z-buffer suffers from setting the Near plane too close to camera and in the cases I had the trouble with z-fighting it was set automatically below 1 (usually from 0.13 to 0.16).
If I could set minimum for Near plane to for example 2, that would prevent a lot of issues.

Best regards, Simon
  


Messages In This Thread
Z fighting issues - by simon.skapik - 06-20-2017, 01:26 PM
RE: Z fighting issues - by abenedik - 06-20-2017, 03:23 PM
RE: Z fighting issues - by simon.skapik - 06-20-2017, 04:16 PM
RE: Z fighting issues - by abenedik - 06-20-2017, 08:19 PM
RE: Z fighting issues - by simon.skapik - 06-21-2017, 10:46 AM
RE: Z fighting issues - by abenedik - 06-21-2017, 10:55 AM
RE: Z fighting issues - by simon.skapik - 06-21-2017, 02:53 PM
RE: Z fighting issues - by abenedik - 06-21-2017, 06:55 PM
RE: Z fighting issues - by simon.skapik - 06-22-2017, 10:36 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)