Search code examples
effectblendingopengl-es-1.1

OpenGL ES 1.1 - aquarium's realistic rendering


I've got some meshes that try to resemble an aquarium. I can move the point of view or camera that has a light attached to it. Only the front glass is fully transparent, it is suposed to be the screen glass.

I've tried using the blender function glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) with some combinations of diffuse material, but it always look like a CAD drawing, despite the fact that some realistic textures could help improve the look, it just doesn't look right.

I can brute-force the desired result by changing all posible combinations of glBlendFunc and glMaterialfv, but it could take a while. So I posted the question here to see if someone have accomplished this visual effect, any help or comment is appreciated too.


Solution

  • Looks like it's lacking any kind of reflections, which both water and glass would exhibit. A specular term on the water surface might be ok, or failing that you could additively blend an environment map. I'd actually tone down the opacity of the water a bit, to make the boundaries less obvious, and let the specular reflections show the definition.

    The glass itself should also have some kind of environment reflection, if you are rendering this in something other than a black room. Again a simple and subtly environment map would probably suffice.

    Other things you might want to try (bearing in mind you've no shaders on ES1.1):

    Caustics. Those are the bright wavy lines you see on the bottom of a swimming pool, caused by the light being scattered in different directions by the motion of the surface. You can fake those with an alpha texture and wobbling the vertices around.

    Refraction. You could render the under-water scene to a secondary buffer, and then use that as a texture, allowing you to distort/animate the image somewhat. A fish-tank doesn't exhibit too much of that, and you should really only see it wobble if looking through the top surface, but maybe it would be interesting.