Water Shader Textures

Started by AGP, January 09, 2011, 09:13:08 PM

Previous topic - Next topic

EgonOlsen

#30
The last parameter in the constructor decides between precalc (false) and not (true). Default in the example is false. I don't get that part with shore and surface...if it moves on the shore, the surface moves. Just execute the example and you'll see. Maybe your lighting is done in a way, that it's just not noticable? Try to render wireframe mode and see how that looks like. You should see the movement.

Apart from that, consider to increase Config.glDynamicBatchSize (to 2000 or 4000 or...). It might help speed wise. I've modified the source code in my post too.

AGP

You might be right about the lighting, I will look around. Thanks for the dynamic batch size suggestion, will do. If you happen to land a better water texture I'd love to have it too.

AGP

Apply() has been throwing the exception too often, with the message "1500." What could that be?

EgonOlsen

Some array out of bounds for the precalc normals array. Most likely due to rounding errors in the index calculation. Try to limit the array index with some Math.min and .max to 0-(length-1).