shadow problem about PagedGeometry(solved)

haibo19981984

29-06-2010 10:50:23

I have a project which include PagedGeometry object.
I run it in debug mode and see the ogre window about 4 seconds.
But after I set shadow "SHADOWTYPE_STENCIL_MODULATIVE" ,I have to wait about 25 seconds to see the ogre window.
If I set shadow "SHADOWTYPE_TEXTURE_MODULATIVE",it is about 6 seconds.
So I want to turn off the shadow's effect to PagedGeometry object.
But I don't find any method.
Anybody can solve it.
my shadow code:

//mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE);
mSceneMgr->setShadowColour(ColourValue(0.5,0.5,0.5));
mSceneMgr->setShadowTexturePixelFormat(PF_L8);
mSceneMgr->setShadowTextureCasterMaterial(StringUtil::BLANK);
mSceneMgr->setShadowTextureReceiverMaterial(StringUtil::BLANK);
mSceneMgr->setShadowTextureSelfShadow(false);
mSceneMgr->setShadowDirectionalLightExtrusionDistance(600);

my grass material:

material grass
{
receive_shadows off
transparency_casts_shadows off
technique
{
pass
{
lighting off
cull_hardware none
cull_software none
scene_blend alpha_blend
alpha_rejection greater_equal 128

texture_unit
{
texture grass.tga
}
}
}
}

Fish

30-06-2010 15:20:34

I noticed that your material references 'grass.tga' so I assume that you are working with a grass loader. You can disable building of the edge lists by calling:
mGrassloader->setBuildEdgesEnabled(false);

If you want to disable shadows on mesh entities that are being used with PG you'll need to call:
entity->setCastShadows(false);
after creating the entity.

- Fish

haibo19981984

01-07-2010 02:49:01

Thanks,Fish.
The problem is solved.