PDA

View Full Version : Weird rendering behaviour



NTBone
04-08-2004, 06:37 AM
Please check out this link http://home.cogeco.ca/~nteeuwen/Problem/Problem.htm I needed images to explain the problem.

Mazy
04-08-2004, 06:45 AM
thats Z-fight problem. If that becomes worse during render you probably change the zNear and zFar in some way.

Honk
04-08-2004, 06:49 AM
Yup, that's z-fighting.

This page explains it very well:

http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html

NTBone
04-12-2004, 04:01 AM
I suspected as much. The only problem I have is that I am using an orthographic view, not a perspective view. I read the article and it seems to relate to perspective. With orthographic I would think that the precision of Z would be linear.

evanGLizr
04-12-2004, 08:45 AM
Originally posted by NTBone:
I suspected as much. The only problem I have is that I am using an orthographic view, not a perspective view. I read the article and it seems to relate to perspective. With orthographic I would think that the precision of Z would be linear.You can see z-fighting in orthographic if you don't setup your z-range properly: if your geometry has z-coordinates ranging from 1.5 to 2, but you set the depth range to cover values from 0.1 to 1000000, then you are going to have depth fighting, no matter the view is orthographic or not.

The thing that puzzles me is that:
1. At first you don't have z-fighting.
2. You zoom in, you see the z-fighting problem.
3. You zoom out, and you still see it.

The only thing I can think about is that you are accumulating matrix multiplies on your projection or modelview matrix, in such a way that you are losing precision. How do you zoom in/out? Do you reset your matrix every frame or are you accumulating over the previous frame's matrix?

NTBone
04-12-2004, 11:24 AM
I did figure out what was causing hte weirdness when zooming out. The code loses precision because delta operations are applied. So orthographic is linear? It seems to be. There should be no perspective divide by 1/z so the z precision should be the same no matter how far away the object is.

If model view is identity and we have a simple ortho set up then the z value of the object is simply scaled to lie between 0 and 1 (based on near and far) and that is the z value put in the buffer.

dorbie
04-12-2004, 11:44 AM
Hmmm.. I dunno what's happened here I thought I'd posted to this thread, now my posts and several others are gone. I can't find a duplicate thread so what the heck is going on? Am I missing another thread, is this database corruption or did this degenerate into a flamewar while I wasn't looking?

rgpc
04-13-2004, 06:02 PM
Originally posted by dorbie:
Hmmm.. I dunno what's happened here I thought I'd posted to this thread, now my posts and several others are gone. I can't find a duplicate thread so what the heck is going on? Am I missing another thread, is this database corruption or did this degenerate into a flamewar while I wasn't looking?One of those dodgy moderators probably deleted it. :D

JotDot
04-13-2004, 07:02 PM
Sorry, no conspiracy here. Sounds like corruption. Explains why I can search for my name as a keyword in this forum and get six hits while a search by registered member number reveals only one. Mind you the post I made long ago (which I was looking for) was not one of the six.

Adrian
04-13-2004, 09:25 PM
Originally posted by JotDot:
Sorry, no conspiracy here. Sounds like corruption. Explains why I can search for my name as a keyword in this forum and get six hits while a search by registered member number reveals only one. Mind you the post I made long ago (which I was looking for) was not one of the six.It seems that posts have only been indexed against the member number since we had the server trouble.

dorbie
04-14-2004, 08:02 PM
Mystery solved, I got these threads mixed up:

http://www.opengl.org/discussion_boards/...t=016004#000013 (http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=2;t=016004#000013)