I've been having an issue where the screen is black in ogre and nothing is shown, but no errors are thrown, and only the first time after install.
The error only occurs on the first load and once the application has been stopped completely and started up again it's fine, not allowed to deploy with this problem though.
I narrowed the issue down to shadows but I can't see why they cause a problem, I'll paste in my shadow setup below.
Code: Select all
void OgreFramework::setupShadows(){
m_pSceneMgr->setShadowTexturePixelFormat(Ogre::PF_X8R8G8B8);
m_pSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_MODULATIVE);
m_pSceneMgr->setShadowColour(Ogre::ColourValue(0.2,0.2,0.2));
m_pSceneMgr->setShadowTextureSettings(1024, 2);
m_pSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(new DefaultShadowCameraSetup()));
m_pSceneMgr->setShadowFarDistance(1000);
m_pSceneMgr->setShadowTextureSelfShadow(false);
m_pSceneMgr->setShadowTextureReceiverMaterial("ShadowReceiver");
m_pSceneMgr->setShadowTextureCasterMaterial("ShadowCaster");
}
Code: Select all
material ShadowReceiver
{
technique default
{
pass lighting
{
texture_unit shadowMap
{
tex_address_mode clamp
filtering none
}
}
}
}
vertex_program ShadowCasterVP cg
{
source v-shadow-caster.cg
entry_point main
profiles arbvp1
default_params
{
param_named_auto p_ModelViewProjection worldviewproj_matrix
param_named_auto p_AmbientLight ambient_light_colour
}
}
fragment_program ShadowCasterFP cg
{
source f-shadow-caster.cg
entry_point main
profiles arbfp1
// Store normalized (usefull to avoid overflowin) or non-normalized depth ?
//compile_arguments -DSTORE_NORMALIZED_DEPTH
default_params
{
// Only used when storing normalized depth values
//param_named_auto p_Near near_clip_distance
//param_named_auto p_Far far_clip_distance
param_named p_DepthOffset float 0.01
}
}
material ShadowCaster
{
technique default
{
// Z-write only pass
pass Z-write
{
vertex_program_ref ShadowCasterVP
{
}
fragment_program_ref ShadowCasterFP
{
}
}
}
}
Shadows are still new to me, so if I've missed something basic then great.
Hope someone can help
Carl