I'm using Ogre 1.9 with the DX3D11 render system, i'm not great with shaders (although i've been looking for resources to learn) so i decided to use the RTSS to emulate the FFP functionality.
I'm making an FPS and currently trying to implement the UI to display a crosshair using MyGUI. But i'm getting the following error in my Ogre.log file:
Code: Select all
20:21:34: OGRE EXCEPTION(3:RenderingAPIException): Null program bound. in D3D11RenderSystem::bindGpuProgram at D:\Work\Source\OGRE\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp (line 2839)I've recompiled MyGUI and replaced the references to glsles shaders with hlsl shaders like so:
Code: Select all
if (!mRenderSystem->getFixedPipelineEnabled())
{
mVertexProgram = Ogre::HighLevelGpuProgramManager::getSingleton().createProgram(
"MyGUI_VP",
OgreDataManager::getInstance().getGroup(),
"hlsl",
Ogre::GPT_VERTEX_PROGRAM);
mVertexProgram->setSourceFile("MyGUI_VP.hlsl");
mVertexProgram->load();
mFragmentProgram = Ogre::HighLevelGpuProgramManager::getSingleton().createProgram(
"MyGUI_FP",
OgreDataManager::getInstance().getGroup(),
"hlsl",
Ogre::GPT_FRAGMENT_PROGRAM);
mFragmentProgram->setSourceFile("MyGUI_FP.hlsl");
mFragmentProgram->load();
}
}
vertex shader
Code: Select all
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Tex : TEXCOORD0;
};
struct VsOutput
{
float4 Pos : SV_POSITION;
float2 Tex : TEXCOORD0;
};
VsOutput main(VertexShaderInput input)
{
VsOutput output;
output.Pos = input.Position;
output.Tex = input.Tex;
return output;
}
Code: Select all
Texture2D tex0;
SamplerState s0;
struct PS_INPUT
{
float4 Pos : SV_POSITION;
float2 Tex : TEXCOORD0;
};
float4 main(PS_INPUT input) : SV_TARGET
{
float3 texSample = tex0.Sample(s0, input.Tex);
float4 color = float4(1,1,1,1);
color.xyz = texSample;
return color;
}
I'm not sure what else to try, i'd rather stay with Ogre 1.9 for the time being until i've finished this project. If the shaders themselves are causing the problem, could you please help to fix them? it would be very much appreciated.