Hi!
I use the soft shadow implementation of Nullsquared and I have a problem with
deactivating shadowing of an entity. By setting castShadow to false I can see
the shadow of this entity (which is attached to a bone) anyhow.
Did I miss something I have to consider?
Thx
Entity::setCastShadow(false) doesn´t work
-
xadhoom
- Minaton
- Posts: 973
- Joined: Fri Dec 28, 2007 4:35 pm
- Location: Germany
- x 1
-
nullsquared
- Old One
- Posts: 3245
- Joined: Tue Apr 24, 2007 8:23 pm
- Location: NY, NY, USA
- x 11
Hm. That's odd
.
Technically, the shadow map needs both casters and receivers in this case. But, Ogre treats receivers as those who don't cast shadows, and casters as those who cast shadows, but don't receive shadows. When you call SceneManager::setShadowTextureSelfShadow(true), then Ogre will ignore what it thinks and render both casters *and* receivers into the shadow map. So, maybe, that's why your entity is still casting shadows (it's in the shadow map), even though it shouldn't.
This would be easily solvable using Shoggoth's in-place shadow_caster_material directives, but I'm personally using Eihort, so I can't write up an example of how to solve it using shadow_caster_material.
Technically, the shadow map needs both casters and receivers in this case. But, Ogre treats receivers as those who don't cast shadows, and casters as those who cast shadows, but don't receive shadows. When you call SceneManager::setShadowTextureSelfShadow(true), then Ogre will ignore what it thinks and render both casters *and* receivers into the shadow map. So, maybe, that's why your entity is still casting shadows (it's in the shadow map), even though it shouldn't.
This would be easily solvable using Shoggoth's in-place shadow_caster_material directives, but I'm personally using Eihort, so I can't write up an example of how to solve it using shadow_caster_material.
-
xadhoom
- Minaton
- Posts: 973
- Joined: Fri Dec 28, 2007 4:35 pm
- Location: Germany
- x 1
-
xadhoom
- Minaton
- Posts: 973
- Joined: Fri Dec 28, 2007 4:35 pm
- Location: Germany
- x 1
Ok, I solved my problem by using the shadow_caster_material as sugggested and it works.
Here is an example of how I did it:
Cheers!
Here is an example of how I did it:
Code: Select all
material no_shadow
{
technique
{
pass
{
alpha_rejection greater_equal 128
diffuse 0 0 0 0
}
}
}
material testMaterialWithoutShadows
{
technique
{
shadow_caster_material no_shadow
pass
{
// the shader code
}
}
}