simple landscape & water (screenshot & newbie question)

Started by
13 comments, last by James Trotter 18 years, 9 months ago
Hi I've been messing around making a landscape using tiles made out of triangles and it works quite ok. Latly I've been thinking of adding some simple water and the first thing I thought of was making a quad under the terrain, so when I lower the terrain below it the water would appear. The problem is this looks really ugly where the water is crossing the landscape. -> http://img292.imageshack.us/img292/1004/3dterrain6lv.jpg I need some pointers on how to do this. Do I have to make a polygon out of the water aligning vertices from the water polygon to vertices on the landsape? And if I have to do this, is using GL_POLYGON shitty? Really hope there is some other easy way :p thanks for any help.
Advertisement
you have to set your near and far plane to less extreme values.

try .1 for near plane and 1000 for far plane.

If that doesn't help, increase your z buffer bit depth
Clicky
Just buffed the z buffer bit depth up to 32 and tings got alot better :)

Thanks alot.
I would use clipping planes at sea level instead...

check out clip planes in opengl... then draw this:

clipping on:
draw sea bottom

clipping off:
draw sea

clipping on:
draw terrain...



because if you simply increase the zbuffer depth, what happens to larger scale terrains or if the users graphics card doesn't support 24/32 buffer sizes? :)

"Game Maker For Life, probably never professional thou." =)
Yeah I see your point. Thing is that I dont know which parts of the terrain is under the water + I'm fairly new into opengl. Gonna look into clipping planes later on, but right now I'm gonna leave it with the "easy, but bad way" :p
Thanks for the suggestion though.
thats the fine part with opengl, lots of it is done for you! :)

if you define a clipping plane at, say 0,0,0... then depending on the direction you "aim" it, it clips all polygons that are drawn while that clipping plane is active - Automaticly! (sp?) :)

so that would mean you simply define the clipping planes, draw the terrain using your normal draw functions and it will be clipped by itself. :)
"Game Maker For Life, probably never professional thou." =)
the problem with using the glClipplanes() method is that before the GF6 (and possible the GGFX) Nvidia's card dont support clip properly in hardware, instead its done via alpha testing and uses a texture unit per clipplane. While this kinda works, when compared to ATI's proper implimentation of clipplanes you can see how broken it is....
Quote:Original post by _the_phantom_
the problem with using the glClipplanes() method is that before the GF6 (and possible the GGFX) Nvidia's card dont support clip properly in hardware, instead its done via alpha testing and uses a texture unit per clipplane. While this kinda works, when compared to ATI's proper implimentation of clipplanes you can see how broken it is....


He is right. I have run my terrain engine on a 9600XT and a 6800GT and can tell you the ATI looks right and looks better due to the terrain rendering correctly, where as the 6800GT is wrong my water is all black due to the clip plane is not working would be my guess cause I don't change anything in my code and the ATI card looks great.
Well that kinda blows :(

I've just made a larger terrain and the uglyness is back when you are looking on the water from a great distance. Guess i'll have to go with those clipping planes if there is no other (easy) way :p. Thanks all for the great input.

This topic is closed to new replies.

Advertisement