Hello all,
I am having an issue which I am unable to find a solution for at the moment. I draw a world with an ocean like so:
Code:
void initWater()
{
Water.draw = true;
Water.wave_scale = 0.8f;
Water.plane.set(Vec(0, 0, 0),Vec(0, 1, 0));
Water.colorMap(UID(175945753, 1318862614, 1168212879, 52360947)).normalMap(UID(277242192, 1333697279, 1115435417, 3862791069));
Water.density=0.125f;
Water.scale_normal= 4.0f;
Water.scale_color = 4.0f;
Water.scale_bump = 100.0f;
Water.reflect_tex = 0.150;
Water.refract = 0.100f;
Water.specular = 1.500f;
Water.wave_scale = 0.250f;
Water.rough = 3.000f;
Water.refract = 0.500f;
}
And with an update function that includes:
Code:
Water .update(-Vec2(0.05));
Water.plane.set(Vec(0, (Abs(sin(Time.curTime())/20)) - 0.2f, 0),Vec(0, 1, 0));
The ocean gets rendered nicely and moves up and down, but when I place the camera only slightly below the ocean's plane, I get the issue as shown in the screenshot attached.
I do not have this issue if I create a large water plane in the editor and have that rendered in the game.
What could cause this? Can anyone reproduce the issue if its a bug?
EDIT #1 : I found out that the issue lies with the setting of the colorMap. If I remove that and set the color manually, it works as expected. How can the setting of a colormap cause this issue?