Unexpected Dithering and Stepping

Sage
Posts: 1,403
Joined: 2005.07
Post: #1
Im getting very odd problems with my graphics engine Im writing

It takes these two images

[Image: abstractdepth0yo.png]
[Image: abstractrgb4yg.png]

and draws the rgb image to the color buffer and the b&w image to the depth buffer

I get a strange dithering and stepping effect, I cant quite work out why
The problem is I've never seen this with opengl before so I dont know whats causing it.

[Image: err12io.jpg]
[Image: err29vk.jpg]
[Image: err39eu.jpg]

Anyone seen this before or know whats happening?
thanks/

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
That looks like Z fighting to me... try pushing out your near plane or pulling in your far plane.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #3
What OSC said.
Also, are you using a 16bits or a 32bits Z buffer?
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
glDisable(GL_DITHER).

Dither is enabled by default in OpenGL. On most hardware it only affects 16bpp contexts. Some newer hardware may dither 32bpp contexts also (if they use more than 8 bits per channel internally.)
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #5
I don't know if the first image is your *actual* image -- but the one you posted is massively dithered, enough that it looks like a 16 color GIF.

If this is related to your discussion earlier of rendering static geometry using a high quality renderer and dynamically rendering the rest, then you might want to make certain your raytracer or whatever is putting out a fully 32-bit greyscale depthmap image. Because if it's outputting an 8-bit greyscale PNG you'll be getting the dithering from the raytracing source, not GL.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #6
I disabled GL_DITHER, tried pulling in zFar, and then pushing out zNear.
(also I had my depth buffer set to 512 because I was changing it around before and I think my card can only do 16 bpp)
It didn't really make any difference, so Ill get another depth render.

Its not the actual image used but an uploaded jpg compressed version of it but I think that the precision of that image could be causing the problem. Ill get another render and see if thats whats happening.

Thanks for the help!

Edit: I just looked closly at the image I am using and it is quite dithered so hopefully this should be pretty easy to fix Smile.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL & Dithering mars 4 3,089 Jan 27, 2004 05:38 PM
Last Post: mars