Nearly overlapping Quads causing Jagged Edges
Hi guys,
Im slowly fumbling through OpenGL and was wondering if anyone had some advice on my current problem.
Im slowly building up a basic heightmapped terrain engine. I have taught myself much from the red book, but Im still vague in some areas.
My particular question is: Where the terrain flattens near zero, I have a temporary Water quad that spreads across the whole map (at height 8).
Strangely, when I look at the water from afar where it meets the heightmapped terrain I get this effect:
![[Image: shot23jm.th.jpg]](http://img474.imageshack.us/img474/8813/shot23jm.th.jpg)
I've tried to fix it with blending (i.e. trying to make the water translucent) but I still get the nasty edges.
Any other ideas?
Im slowly fumbling through OpenGL and was wondering if anyone had some advice on my current problem.
Im slowly building up a basic heightmapped terrain engine. I have taught myself much from the red book, but Im still vague in some areas.
My particular question is: Where the terrain flattens near zero, I have a temporary Water quad that spreads across the whole map (at height 8).
Strangely, when I look at the water from afar where it meets the heightmapped terrain I get this effect:
![[Image: shot23jm.th.jpg]](http://img474.imageshack.us/img474/8813/shot23jm.th.jpg)
I've tried to fix it with blending (i.e. trying to make the water translucent) but I still get the nasty edges.
Any other ideas?
It's called "z fighting", and it occurs because there's too little precision in the z buffer to distinguish consistently between your nearly-parallel quads.
The amount of precision in the depth buffer is affected by the ratio of the "far" and "near" parameters to gluPerspective. Reducing that ratio (either decrease "far" or increase "near") will give you more precision.
In general though, you're much better to avoid having intersecting geometry.
The amount of precision in the depth buffer is affected by the ratio of the "far" and "near" parameters to gluPerspective. Reducing that ratio (either decrease "far" or increase "near") will give you more precision.
In general though, you're much better to avoid having intersecting geometry.
Bumping up the Z Buffer worked a treat. Now I just have to get this whole Alpha blending thing down so I can make the "water" a bit translucent.
Thanks for the tips
Thanks for the tips
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Create Aquaria-like terrain- texturing edges | AndyKorth | 3 | 5,415 |
Jul 31, 2011 08:13 PM Last Post: FlamingHairball |
|
| [SOLVED]OpenGL edges of textures | mk12 | 2 | 3,678 |
Sep 2, 2010 08:07 PM Last Post: mk12 |
|
| Replacing edges with degenerate quads (for shadow volumes) | Coyote | 9 | 6,460 |
Jan 15, 2010 07:08 PM Last Post: Coyote |
|
| Tricks with dialog boxes in fullscreen mode causing permanent framerate drops. | Sea Manky | 2 | 2,678 |
Aug 7, 2007 06:20 AM Last Post: Sea Manky |
|
| One texture... multiple quads? | Jones | 6 | 4,185 |
Jul 12, 2006 01:14 PM Last Post: kordova |
|

