I'm having a problem with modulative stencil shadows. The casting light appears to create 2 shadows.. See pic below.
One interesting thing is that the further you zoom the camera out the more the two shadows are offset from one another. for a sense of scale, the ball is 29 statnard units radius and the groundplane 500x500.
I can't find a reason for this behaviour. The screenshot has an omni light, but the other light types produce the same effect.
anyone have the same problem? and or have a solution.
Oh, forgot to mention that this looked fine in actual ofusion, but not in our app, which uses the latest version of Eihort 1.4.6
Here's a vid so you can see how the two shadows react and seperate with the camera distance
http://www.flow3d.org/ad/Movie.wmv
Lioric
09-01-2008 21:45:57
Probably this is related to the plane material, as at the first part of the video some depth issues are displayed when the camera start to move (there are some horizontal "lines" in the plane that suggest this)
How is the material of the plane, is it multipass?
It seems the plane (or its material) have other camera dependant values as the level of the plane (y position) changes with the camera distance, because the plane is at the middle of the cylinder (y) at the last part of the video, and at the start the cylinder is displayed completely, this plane position variation explains why the shadows are offseted when the camera moves (as the plane actually moves, and the projected shadow with this)
Are you changing the plane material depth bias?
HI, I have been playing with the materials a lot in the last hour and I found what causes the double shadows.
My shader material has 2 light support but I don't know how to add ambient light to my shader. So I added a fixed function pass to my material in the top slot to adjust the ambient lighting.
To stop the passes fighting I changed depth bias to 1 in the shader pass, and its changing the depth bias that creates double shadows in Ogre 1.4.6
Shadows:
Fix divergent behaviour in focused / LiSPSM shadows between debug and release.
Fixed edge case issues with focussed shadow camera setup: up dir should be camera up dir; deal with zero vector
In the Ofusion viewport which is still Ogre 1.2 the shadows work correctly with the depth bias hack so I guess something must have changed.
I just got a ambient shader from a programmer to try in place of the fixed function pass, maybe that will fix it.
The what looks like Z fighting at the start of the video is actually a video artifact produced by windows movie maker whilst downscaling.
We are using 1.4.6 and was wondering if any shadow type stuff might have crept i nthat causes odd behavior. Some things were changed recently..
I guess I misunderstood something about shaders since theres still Zfighting between the two passes and only setting depth bias seems to fix it. But that causes the shadows to double up.
Lioric
10-01-2008 00:43:23
You cant use fixed function and programable function in the same object (specially in GL), if you object uses shaders, then all of your passes must use shaders to render
To add an ambient pass to a multipass shader, use the "Ambient" shader in the first pass (from the vertex shader list select the "AmbientTexture" entry) and assign the "AMBIENT_COLOR" auto parameter in the shader parameter editor for this pass to use the scene ambient color (or select a manually defined color value if you need)
The problem with the two shadows was the depth bias 1. I managed to get around this with a shader ambient pass, but can't get a single pass shader to work with it. The lights won't blend properly if there are more than 2 without using blend modes that make my meshes transparent.