🔒 Locked
Z-Depth Buffer Problem
Advertisement
Original Post
i am drawing a 3-D heightmap that is getting some Z-depth buffer problems when Z is too high a number. i didnt know there was a limit??? basically i am drawing my data according to lat/lon values , but in any case Z ends up being about 9 million in the positive Z axis. i have tested Z to be at even 500,000 or so, and i still get some Z-depth "errors". The error i am talking about is when rotating at these high values some of the data is not drawn, its like someone took scissors and just cut pieces out. i dunno if anyone has had these type of problems before but any know how on how to fix this would be helpful. my Z perspective is set to 200,000. i can divide all my numbers in half or by a certain number to shorten the value i just didnt know openGL would have a problem with the Z value being too high or low. any input would be appreciated! thanks!
i wouldnt know of problems with numbers being too high. you WILL have trouble with extreme far planes (especially when using absurd near planes like 0.001). if its just far away parts being cutoff then your far plane is too close, if you get z fighting the ratio between near and far should be on you to-do list.
usually id consider a far plane of 200k as pretty perverse and suggest using a different scale. though if its causing problems will also depend on what youre doing with it.
if youre working with floats i hope you realize that theres a limit too?
usually id consider a far plane of 200k as pretty perverse and suggest using a different scale. though if its causing problems will also depend on what youre doing with it.
if youre working with floats i hope you realize that theres a limit too?
actually my values for my data is double not float. i dunno if this makes a difference with z-fighting? i have tested like i said and when the numbers are low the "bug" is non-existent or not noticeable. at the beginning of the program i translate according the whatever the center of my heightmap will be which i figure out when i store the data. my center is something like
-163656 9.78123e+006, the x and z respectively, notice z is like 9 million. the weird thing is is that i dont seem to get a z-depth buffer problem unless i rotate the heightmap that is drawn.
how do i attach a screenshot to a post? i can take one and post it here so you can see what i mean if i have confused anyone or you need to see it. thanks!
-163656 9.78123e+006, the x and z respectively, notice z is like 9 million. the weird thing is is that i dont seem to get a z-depth buffer problem unless i rotate the heightmap that is drawn.
how do i attach a screenshot to a post? i can take one and post it here so you can see what i mean if i have confused anyone or you need to see it. thanks!
If you have a large disparity between your near and far clip planes, you will get problems. If you absolutely need to have your far clip plane set that far, you need to set the near clip plane accordingly. Try 100 or so. The FAQ gives a more detailed answer to this question BTW.
well i got the problem fixed..instead of translating my whole grid in 3-d real world coordinates i set them to stay at 0,0 and then after i drew the heightmap, update my information based upon the offset..this way my x y z cooridinates stay low. with a double precision number of 9 million+ im sure the GPU truncates to make room for a 32-bit floating point number so i was losing precision. this is all that i can think of.
wow what a perfect link teamonkey! thanks a lot! too bad that was isnt my latest issue of Game Developer MAgazine! thanks again.. btw, do you have a monkey that likes tea? or are you half man- half monkey? lol j/k
wow what a perfect link teamonkey! thanks a lot! too bad that was isnt my latest issue of Game Developer MAgazine! thanks again.. btw, do you have a monkey that likes tea? or are you half man- half monkey? lol j/k
I bet he''s supposed to be a team of monkeys.
______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________
______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________
lots of monkeys who drink tea lol
they all need teapee for thier bungholes
haha
they all need teapee for thier bungholes
quote:
Original post by Thunder_Hawk
I bet he''s supposed to be a team of monkeys.
Actually no, it''s "tea"+"monkey"
OpenGL_Guru: I''m interested if you''ll be using some of the other techniques mentioned in that article, apart from keeping the viewpoint at 0,0, for your height map?
well i didnt read the whole thing of part 3 and i have to go back and read the first 2 parts, i just got out of a meeting so you know how that goes
yeah since i am calculating normals for my heightmap i would be interested in one technique that i saw regarding breaking apart each "square" into smaller triangles, smaller and smaller. although my heightmap is not high res this would prove to be useful for more in depth high res heightmaps, in bigger 3D worlds. first i have to figure out how to update my translations with regard to the angle of rotation of my heightmap. like when i rotate it 90 degrees lets say i want to update my translations, otherwise left will be up and right will be down and so on and so on... im sure this is a common problem
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement