Additive stencil shadows and shader materials

Evak

09-06-2007 08:04:29

Ok, I'm trying to update the graphics in my old indie game Aerial Antics, starting with shaders. I really like additive shadows in ogre because they seem to look much nicer with low poly terrain and have some lighting variation compared to modulative stencils.

I did a test with the monster shader on the generic sand testure and all shadows end up black. If you look elsewhere in the screenshot you can see the lighter additive shadows working on fixed function materials.

Is there a way to get additive shadows to behave on shader materials?

Here's the screenshot to show what I mean. The black additive shadows on the shader material are circled in red.

Lioric

18-06-2007 19:18:38

You need to modify your materials to support additive shadows, similar to this:

An ambient only pass (a simple pass with the ambient colors)
An "iterate per light" pass (where only light and shadows are done, this is where you use the monster shader bump mapping)
A decal pass (the diffuse color of the texture, you need to move it here from the monster shader)

Evak

27-06-2007 02:23:06

ooh, somehow I missed this. Are the passes done at the shader level or fixed function with a shader pass in the middle?

I sis just experiment with an ambient pass, monster in the middle and a diffuse on the third pass, the ambient pass did tint the shadows so they weren't black. The shadows were still opaque however.

It might be that I'm using the blend modes between fixed function passes incorrectly, or you mean 3 shader passes.

I'm not familiar with Eihorts new shadow techniques since the scene loader doesn't support them yet, out of interest are there any new techniques you would recommend for a scene that casts dynamic shadows over a terrain in the manner shown in the pic?