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);
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)
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);
Thanks!
Ash
P.S. I tried with GL3+ too and it silently failed and only rendered the clear colour