More then one normal map (for water)?

Hi,

I was looking for a really, really cheap and easy way to make some decent water. The simplest thing I found is just sliding a texture. In panda this would look like this:

wPlane=loader.loadModel('w_plane2.egg')
wPlane.reparentTo(render)
wPlane.setTexRotate(wPlane.findTextureStage('Tex2'), 15)   
LerpTexOffsetInterval(wPlane, 6, (1,1),(0,0), textureStage=wPlane.findTextureStage('Tex1')).loop()
LerpTexOffsetInterval(wPlane, 6, (-1,-1),(0,0), textureStage=wPlane.findTextureStage('Tex2')).loop()

Tex1 and Tex2 use the same texture and they are both set to ‘modulate’.

The result looks nice, but it’s flat

I would like to use the same, but for a normal map. As far as I understand Pandas autoshader allows for only one normal (or gloss, or glow) map, so at this point it’s not doable (without a custom shader -which I’m allergic to).

Would a patch that allows to use two normal maps for one object be very difficult to make?

From editing normal maps in GIMP I know that if you just multiply two normal maps it gets a bit too blue and to saturated, but it can be fixed just by reducing the brightness a bit.

For a test I used a normal map ( still as ‘modulate’) for the code posted above and what I got would pretty much make for a good animated normal texture

So can it be done, or is it something very, very difficult to do?

Implementing support for multiple normal maps is easy, but the question is: how would it combine the normal maps? A normal map defines the normal vector for a surface, and if you have two normal vectors, you will also need a way to combine these two normals into a single normal vector that makes sense and isn’t just as bad as multiplying the normal maps in the first place.

Any suggestions?

add the normal vectors, normalize.

It’s all magic to me.
I just made the map brighter and multiplied it with its rotated twin. I don’t know if it’s a good map but it looks ok for water…so for my own use multiply would do -even if it’s the wrong thing to do.

Different questions:
Can I, using out of the box functionality, take two images (or one image two times), add(or multiply) them and supply the effect of that operation as a normal map each frame?

Would a solution like that give better or worse performance then 60 different normal maps on a sequence node (or one big texture atlas and scrolling UV each frame)?

Sorry for triple posting.
I’ve solved this myself, no changes are needed.
Demo’s here:
panda3d.org/forums/viewtopic … 2773#82773

Panda now supports multiple normal maps in the shader generator (1.10+)