new terrain depth shadows and transparent textures?

Problems building or running the engine, queries about how to use features etc.
Post Reply
Doc_QuicknDirty
Gnoblar
Posts: 16
Joined: Mon Aug 30, 2010 4:48 pm
x 1

new terrain depth shadows and transparent textures?

Post by Doc_QuicknDirty »

Hello,

I am using Ogre 1.7.2 and depth shadows exactly like in the Terrain sample.
Is it possible to make transparent textures cast shadows when using depth shadows?

If I build the material like in buildDepthShadowMaterial() from the Terrain sample and add

Code: Select all

ret->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
ret->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
ret->getTechnique(0)->getPass(0)->setDepthCheckEnabled(true);
the textures are shown o.k. but don't cast any shadows at all.
06282011_111041022.jpg
If I set

Code: Select all

ret->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
ret->getTechnique(0)->getPass(0)->setDepthWriteEnabled(true);
ret->getTechnique(0)->getPass(0)->setDepthCheckEnabled(true);
I get errors:
06282011_111210202.jpg
Without depth shadows everything looks fine but I need the capability that objects are casting shadows on themselves.
screenshot06282011_120902025.jpg
Ralf
User avatar
sleo
Gremlin
Posts: 171
Joined: Sun Jun 05, 2011 6:49 am
Location: Vodka Federation
x 18

Re: new terrain depth shadows and transparent textures?

Post by sleo »

Why you all use 1.7.2, while it is better to use 1.7.3?

I also want objects to cast shadows on themselves, especially on characters with animation (players, NPCs, monsters). But I don't know how to configure PSSM, and PSSM or maybe SHADOWTTYPE_TEXTURE_ADDITIVE_INTEGRATED have some bugs, it is very inaccurate, sometimes shadows are being cast not from character's foots, but from some offset to light source. If I want SHADOWTYPE_STENCIL_ADDITIVE then terrain covers black, because of SM2Material incompatible with fixed-pipeline stencil shadows.
lucassazon
Gnoblar
Posts: 5
Joined: Wed Apr 06, 2016 2:08 pm
x 1

Re: new terrain depth shadows and transparent textures?

Post by lucassazon »

In Mogre, I used this and works:

Code: Select all

ret.GetTechnique(0).GetPass(0).AlphaRejectValue = 128;
ret.GetTechnique(0).GetPass(0).AlphaRejectFunction = CompareFunction.CMPF_GREATER;
ret.GetTechnique(0).GetPass(0).CullingMode = CullingMode.CULL_NONE;
ret.GetTechnique(0).GetPass(0).ManualCullingMode = ManualCullingMode.MANUAL_CULL_NONE;
Post Reply