Jump to content
  • Advertisement
Sign in to follow this  
sabhat

simple landscape & water (screenshot & newbie question)

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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? :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites
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....

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!