Ogre 1.9 + DX3D11 using RTSS and MyGUI null program bound

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
bradgate016
Gnoblar
Posts: 1
Joined: Wed Sep 21, 2016 8:47 pm

Ogre 1.9 + DX3D11 using RTSS and MyGUI null program bound

Post by bradgate016 »

Hello, this is my first post so hopefully I explain my problem enough.

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 read over the post: http://www.ogre3d.org/addonforums/viewt ... 17&t=29605 since this was a very similar problem just using OpenGL ES.

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();
			}
		}
my hslsl shaders (again, i'm not great with shaders, so this could very well be the problem):

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;
}
Fragment Shader:

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 have the shader files inside the MyGUI_Media folder which is also assigned to the 'General' resource group.

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.
frostbyte
Orc Shaman
Posts: 737
Joined: Fri May 31, 2013 2:28 am
x 65

Re: Ogre 1.9 + DX3D11 using RTSS and MyGUI null program boun

Post by frostbyte »

i don't realy know the answer but can offer some advice...
its hard to debug small code fragments...this problem can be created by multiple causes...might be threading issue...i'm not a myGui expert
ogres1.9 DX11 is not production ready, i'm not sure if it even works, since you'll do it somewhen anyway, i suggest that you move to ogre1.10 asap
IMHO: its worth the small labour as you will a get stable webGL, DX11, GL3+ with hlms pbs( can be rtss replacement )
for smooth fast porting, you can use paroj github fork who keeps API backward-compability with 1.9( mainBranch porting is'nt that difficult either )
but since you say that you prefer not to, i can only suggest that you build a minimal test-case surrounding this code...( no threads, without myGui etc...)
good hunting...
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..

coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos