Crash when using animationMatrix

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Crash when using animationMatrix

Post by AshMcConnell »

Hi Folks,

I'm having trouble when enabling a matrix while using unlit HLMS like so: -

Code: Select all

Ogre::Matrix4 mat(Ogre::Matrix4::IDENTITY);
mat.setScale(Ogre::Vector3(-1, 1, 1));

_dataBlock->setEnableAnimationMatrix(0, true);
_dataBlock->setAnimationMatrix(0, mat);
It produces the following error, it seems to be some kind of type conflict in the shader: -

Code: Select all

15:19:55: OGRE EXCEPTION(3:RenderingAPIException): D3D11 device cannot set rasterizer state
Error Description: ID3D11DeviceContext::DrawIndexedInstanced: The Shader Resource View dimension declared in the shader code (BUFFER) does not match the view type bound to slot 1 of the Vertex Shader unit (TEXTURE2DARRAY).  This mismatch is invalid if the shader actually uses the view (e.g. it is not skipped due to shader code branching).
 in D3D11RenderSystem::_setHlmsMacroblock at C:\Dev\3rdParty\cmake\Ogre\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp (line 2972)
Here is the full code: -

Code: Select all

Ogre::HlmsManager *hlmsManager = Ogre::Root::getSingleton().getHlmsManager();
Ogre::HlmsTextureManager *hlmsTextureManager = hlmsManager->getTextureManager();
Ogre::HlmsUnlit *hlmsUnlit = static_cast<Ogre::HlmsUnlit*>(hlmsManager->getHlms(Ogre::HLMS_UNLIT));

_texture = TextureManager::getSingleton().createManual("MirrorTex",
	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D,
	1024, 512, 0, PF_R8G8B8, TU_RENDERTARGET);

CompositorChannel channel;

Ogre::CompositorChannelVec channels(1);
channels[0].target = _texture->getBuffer(0)->getRenderTarget();
channels[0].textures.push_back(_texture);

Ogre::CompositorManager2* pCompositorManager = Ogre::Root::getSingleton().getCompositorManager2();
auto oge = OgreGfxEngine::getInstance();

_mirrorWorkspace = pCompositorManager->addWorkspace(oge->getSceneManager(), channels, _camera,
	"MirrorsWorkspace", false);

_dataBlock = static_cast<Ogre::HlmsUnlitDatablock*>(hlmsUnlit->createDatablock("MirrorMat", "MirrorMat", Ogre::HlmsMacroblock(), Ogre::HlmsBlendblock(), Ogre::HlmsParamVec()));
_dataBlock->setTexture(0, 0, _texture);


Ogre::Matrix4 mat(Ogre::Matrix4::IDENTITY);
mat.setScale(Ogre::Vector3(-1, 1, 1));

_dataBlock->setEnableAnimationMatrix(0, true);
_dataBlock->setAnimationMatrix(0, mat);
Any ideas what the issue could be?

Thanks!
Ash

P.S. I tried with GL3+ too and it silently failed and only rendered the clear colour
Post Reply