Author Topic: Water Shader Textures  (Read 6040 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Water Shader Textures
« Reply #30 on: January 12, 2011, 10:56:25 pm »
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.
« Last Edit: January 12, 2011, 10:58:41 pm by EgonOlsen »

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Water Shader Textures
« Reply #31 on: January 12, 2011, 11:06:09 pm »
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.

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: Water Shader Textures
« Reply #32 on: January 13, 2011, 04:55:18 pm »
Apply() has been throwing the exception too often, with the message "1500." What could that be?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Water Shader Textures
« Reply #33 on: January 13, 2011, 05:19:40 pm »
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).