Sign in to follow this  
fazekaim

strange water effects

Recommended Posts

hello, i linked a picture: http://www.kepfeltoltes.hu/view/060424/water01_www.kepfeltoltes.hu_.jpg there is a strange effect on my water reflection surface. it seems to be some part of the terrain, i think. i can't delete it. i tried to use: double reflectPlane[] = {0.0f, -1.0f, 0.0f, WATER_LEVEL }; gl.glEnable( GL.GL_CLIP_PLANE0 ); gl.glClipPlane( GL.GL_CLIP_PLANE0, reflectPlane ); without success. What can i do? Thanks...

Share this post


Link to post
Share on other sites
Nice pictures!

I'm not sure, but maybe the culling isn't working. I had the same problems once as well. Normally clipping worked fine, but when I started to use shaders on my terrain model, it didn't work anymore. You can add clipping inside a shader. Don't know how, but there are demo's. For example, the nVidia SDK has one or more demo's on that.

Another solution might be splitting your terrain at the water intersection level. So you have a part under water, and another part above water. When reflecting, you don't have to render the lower part, so you don't need clipping at all (which is somewhat faster). Also rendering refractions might be faster, since you don't need to render the upper part either for taking an underwater snapshot. On the other hand, your terrain uses more polygons after cutting it in half of course.

There are even more ways to clip, (without shaders or cutting models), but I pass that the guru's here :)

Rick

Share this post


Link to post
Share on other sites
Not sure how all your engine works but that almost looks like shadows are rendered into your terrain with a lightmap? I don't know for sure just guessing from the looks of it. Do you use shaders or FFP? Cause if you are modulating the self shadowing map with your lightmap or whatever you are doing the areas where you have more than one shadow or darkened area are going to be darker than the rest...

Share this post


Link to post
Share on other sites
the source of the problem is the shader. Spek, you are right.
i found a paper on the nvidia's site, they modify the projection matrix in the oblique_frustum demo. it sounds good. to do this in shader.... i'm using approx 40 shader... i try this one first.


Thanks guys.


ps: the shadow is a projective shadow mapping technique.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this