POV-Ray : Newsgroups : povray.off-topic : kd-trees rule! : Re: kd-trees rule! Server Time
6 Sep 2024 11:20:09 EDT (-0400)
  Re: kd-trees rule!  
From: scott
Date: 16 Feb 2009 03:07:54
Message: <49991eda$1@news.povray.org>
> Incidentally, while playing CSS the game engine appears to very 
> occasionally get this wrong. (I.e., distant objects appear *in front* of 
> nearer ones - typically textures for things like explosions, window glass, 
> etc.) The result looks very weird.

That's because the depth buffer has limited precision (16 or 24 bit 
usually).  If you can, check that it is set to the highest setting your 
display driver allows.

The video driver has to map real depths (floating point distances from the 
camera) to an integer to store in the depth buffer.  It usually does this by 
taking the reciprocal of the depth, and mapping a range like 1/1000 to 1/0.1 
to the integer range 0-65535 linearly.  This would mean that integer 0 
corresponds to 1000 metres, and integer 65535 corresponds to 0.1 metre 
depth.  In this case, integer 1 would correspond to 868 metres depth, so you 
can see there isn't much resolution far away!

Obviously the bigger range of distances teh game engine needs to represent, 
the less accuracy you can store the depth with and the more depth buffer 
problems you get.  And of course using a 24bit buffer helps things.

> Presumably if the triangles are allowed to move around you can't 
> precompute the splits?

I wouldn't have thought so, and given that grass blades are probably moving 
in the wind I don't think you woudl bother.  I mean if you 10000 grass 
blades swaying in the wind, are you going to notice the odd few that have 
sections rendered in the wrong order and thus have slightly incorrect 
shading?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.