I’ve also created a low polygon rock. However, I am not able to cast the water caustics on it. I am able to do it on other nodes, but not the rock. The pseudo code is like this:
Couldn’t you have a translucent overlay over the whole image? And use 2d sprites for shadows under the fish?
That way your fish and the rock both have the light effects? That’s how I would do it in 2d animation and I think a similar approach should work in 3d.
Yes, but how to create the translucent overlay ? Do you mean a flat plane ? The emulated rays in the picture above is a flat plane. But on the ground…I am not sure if the effect is good or not…let me try it out.
Do you mean calling setTexGen with TexGenAttrib.MWorldPosition ?
I add:
texturestage.setSort
rock.setTexGen
rock.setTexScale
I get the caustics now. I want to share the water caustics texture but it is too bright on a rock. I am using TextureStage.MBlend / TextureStage.MAdd to blend the caustics to the ground and rock. Without writing a shader, it looks like I can’t control too much the blending result…I have to modify the caustics texture for the rock to get a more acceptable appearance.
But wouldn’t the light be brighter on the rock because it is a darker color? On the other hand lava rock would also make the light appear fuzzy or more diffuse, with less defined edges.
Sometimes the effect may not look correct but in reality it may match what we see in nature more closely.
BTW have you been to Nvidia’s examples on caustics and shaders?
I believe a dark object will not become white even if a strong light is cast on it. A rock is less reflective than the sand ground, so a simple blending on top looks strange.
I have only tried “Nalu” demo. Do you know other good water caustics demos ?
I don’t see any problem, I think it looks better with the fog. For starters, without the fog the colors in the scene are too vibrant and crisp, whereas the fog has a nice de-saturating effect that results in a realistic muted look.
it cuts 10fps though and plus in an small home aquarium you don’t have a linear fog perception cos the depth of the water is too small to perceive it and usually the glass tend to colorize a little so i guess the former shot was more realistic. This setup is perfect in a sea environment I guess.