Hi Ogre folks!
I'm trying to achieve instancing, to render a lot of entities. I'm quite new to the 3D/Shaders/... thing, so I tried for a start to mimic dark_sylinc's test source code and the NewInstancing demo. Here is my test instancing section:
Code: Select all
mSceneMgr->setAmbientLight( ColourValue(1, 1, 1) );
mCamera->getViewport()->setClearEveryFrame( true );
const int numW = 10;
const int numH = 10;
InstanceManager *instanceManager = mSceneMgr->createInstanceManager( "MyInstanceMgr", "cube.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME, Ogre::InstanceManager::TextureVTF, 300, IM_USEALL );
//InstanceManager *instanceManager = mSceneMgr->createInstanceManager( "MyInstanceMgr", "cube.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME, InstanceManager::HWInstancingBasic, 30, IM_USEALL);
//InstanceManager *instanceManager = mSceneMgr->createInstanceManager( "MyInstanceMgr", "cube.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME, Ogre::InstanceManager::ShaderBased, 80, IM_USEALL );
for( int i=0; i<numH; ++i )
{
for( int j=0; j<numW; ++j )
{
InstancedEntity *ent = instanceManager->createInstancedEntity( "Examples/Instancing/VTF/Robot" );
//InstancedEntity *ent = instanceManager->createInstancedEntity( "Examples/Instancing/HWBasic/Robot" );
//InstancedEntity *ent = instanceManager->createInstancedEntity( "Examples/Instancing/ShaderBased/Robot" );
SceneNode *sceneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
sceneNode->attachObject( ent );
sceneNode->setPosition( 8 * i, 5, 8 * j );
m_instances.push_back( ent );
}
}
instanceManager->defragmentBatches( true );
mCamera->setPosition( 0, 0, -10 );
mCamera->lookAt( 0, 0, 10 );
As you can see, I've made attempts with 3 materials from 3 techniques of "NewInstancing" from the Ogre samples.
My problem is that all fail.
1st (Texture VTF) fails with:
Code: Select all
WARNING: material MyInstanceMgr/InstanceBatch_0/VTFMaterialCaster0 has no supportable Techniques and will be blank. Explanation:
Pass 0: Fragment program Ogre/Instancing/shadow_caster_ps cannot be used - not supported.
First-chance exception at 0x7696c52f in OgreProject.exe: Microsoft C++ exception: Ogre::RenderingAPIException at memory location 0x0032e90c..
2nd (Shader) fails with:
Code: Select all
WARNING: material Examples/Instancing/ShaderBased/shadow_caster has no supportable Techniques and will be blank. Explanation:
Pass 0: Fragment program Ogre/Instancing/shadow_caster_ps cannot be used - not supported.
First-chance exception at 0x7696c52f in OgreProject.exe: Microsoft C++ exception: Ogre::InvalidParametersException at memory location 0x0047e988..
I 'm certainly missing something here.
I'm using OgreSDK 1.9, Win7 with a lousy Intel HD chip. But the SampleBrowser demos are running fine on it.
Many thanks in advance,
// jho