"default" on Ogre2.1/D3D11?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

"default" on Ogre2.1/D3D11?

Postby mmixLinus » Tue Sep 19, 2017 20:22

Hi, On Win x64, I get

Code: Select all

Cannot compile D3D11 high-level shader __cegui_internal_texture_ps__ Errors:
(11,13-31): error X3523: DX9-style intrinsics are disabled when not in dx9 compatibility mode.
and

Code: Select all

High-level program __cegui_internal_colour_ps__ encountered an error during loading and is thus not supported.
OGRE EXCEPTION(-2147467259:RenderingAPIException): Cannot compile D3D11 high-level shader __cegui_internal_colour_ps__ Errors:
(9,27-33): error X4502: invalid ps_5_0 output semantic 'COLOR'
at startup. Do I need to add dx9 compatibility mode to the microcode compiler, or is the Cegui ("default" branch) shader not ready for this yet? Or something else? :) Maybe go for OpenGl3+..?

This happens when constructing the OgreRenderer, specifically initialiseShaders();

<3 /mmixLinus
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: "default" on Ogre2.1/D3D11?

Postby Ident » Tue Sep 19, 2017 20:29

Cegui version? Ogre version?
CrazyEddie: "I don't like GUIs"

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: "default" on Ogre2.1/D3D11?

Postby mmixLinus » Wed Sep 20, 2017 08:02

The title says it all :)
And I'll post the log file too (soon) :oops:

CEGUI branch default (= 1.0) "latest" with OgreRenderer.
Ogre 2.1 "latest" with D3D11 renderer
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: "default" on Ogre2.1/D3D11?

Postby mmixLinus » Wed Sep 20, 2017 14:54

Oh yes, now I remember why I didn't post the log..

Code: Select all

20/09/2017 16:49:33 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
20/09/2017 16:49:33 (Std)    +                     Crazy Eddie's GUI System - Event log                    +
20/09/2017 16:49:33 (Std)    +                          (http://www.cegui.org.uk/)                         +
20/09/2017 16:49:33 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

20/09/2017 16:49:33 (Std)    CEGUI::Logger Singleton created. (0000000005CD5730)
20/09/2017 16:49:33 (Std)    
20/09/2017 16:49:33 (Std)    ********************************************************************************
20/09/2017 16:49:33 (Std)    * Important:                                                                   *
20/09/2017 16:49:33 (Std)    *     To get support at the CEGUI forums, you must post _at least_ the section *
20/09/2017 16:49:33 (Std)    *     of this log file indicated below.  Failure to do this will result in no  *
20/09/2017 16:49:33 (Std)    *     support being given; please do not waste our time.                       *
20/09/2017 16:49:33 (Std)    ********************************************************************************
20/09/2017 16:49:33 (Std)    ********************************************************************************
20/09/2017 16:49:33 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
20/09/2017 16:49:33 (Std)    ********************************************************************************
20/09/2017 16:49:33 (Std)    ---- Version: 9999.0.0 (Build: Sep 19 2017 Debug Microsoft Windows MSVC++ 12.0 (2013) 64 bit) ----
20/09/2017 16:49:33 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - OGRE based 3rd generation renderer module with Ogre::Compositor2 enabled. ----
The problem arises quite early, in OgreRenderer::constructor_impl() - so that's all there is.
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: "default" on Ogre2.1/D3D11?

Postby mmixLinus » Wed Sep 20, 2017 14:56

Meh,.. I was running Ogre v2.1, but not latest it turns out. I'll respin and get back.
Last edited by mmixLinus on Wed Sep 20, 2017 20:10, edited 1 time in total.
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: "default" on Ogre2.1/D3D11?

Postby mmixLinus » Wed Sep 20, 2017 18:05

No difference with latest Ogre 2.1.
CEGUI's pixel shader

Code: Select all

uniform float alphaPercentage;
struct VS_OUT
{
   float4 position : POSITION;
   float4 colour : COLOR;
   float2 uv : TexCoord0;
};
float4 main(float4 colour : COLOR, float2 uv : TexCoord0,                uniform sampler2D texture0 : TEXUNIT0) : COLOR
{
   colour = tex2D(texture0, uv) * colour;
   colour.a *= alphaPercentage;
   return colour;
}
is part of the problem. In the OgreShaderWrapper constructor, in the code

Code: Select all

    const Ogre::GpuConstantDefinitionMap& pixel_map =
        d_pixelShader->getConstantDefinitions().map;

    Ogre::GpuConstantDefinitionMap::const_iterator target2 =
        pixel_map.find("alphaPercentage");
pixel_map is empty, so the find() fails, and OgreShaderWrapper() subsequently throws.
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: "default" on Ogre2.1/D3D11?

Postby Ident » Wed Sep 20, 2017 22:17

Do you mind trying with CEGUI v0-8 ? Just trying for now, because I know that different ppl made PRs on those two branches and support for Ogre may differ at this point.
CrazyEddie: "I don't like GUIs"

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: "default" on Ogre2.1/D3D11?

Postby mmixLinus » Thu Sep 21, 2017 08:11

I was initially on v0-8 (latest) but having problems, so I decided to try with the default branch. Actually, v0-8 got much further, and that problem was more related to parsing XML resources. I will give v0-8 another shot. For "default", I'll also see if I can select a different Shader Model for the D3D11 compiler, and see if I get further. :)
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: "default" on Ogre2.1/D3D11?

Postby Ident » Thu Sep 21, 2017 17:17

Ogre 2.0 and Ogre 2.1 support is entirely based on user contributions :)
CrazyEddie: "I don't like GUIs"

crancran
Just popping in
Just popping in
Posts: 5
Joined: Fri Oct 28, 2011 00:54

Re: "default" on Ogre2.1/D3D11?

Postby crancran » Thu Apr 05, 2018 05:43

FWIW, I've been working on support for OGRE 2.2 in CEGUI as of late and ran into this very issue. The fix is actually quite trivial. It simply involves making 2 changes to the HLSL shaders in the Ogre renderer module's Shaders.inl file.

1. PixelShaderColoured_HLSL

Code: Select all

"uniform float alphaPercentage;\n"
"\n"
"struct VS_OUT\n"
"{\n"
"   float4 position : POSITION;\n"
"   float4 colour : COLOR;\n"
"};\n"
"\n"
"float4 main(VS_OUT input) : SV_Target\n"
"{\n"
"   float4 colour = input.colour;\n"
"   colour.a *= alphaPercentage;\n"
"   return colour;\n"
"}\n"
"\n"


2. PixelShaderTextured_HLSL
In this shader, we want to change the text to read the following:

Code: Select all

"SamplerState textureSamplerState;\n"
"uniform float alphaPercentage;\n"
"struct VS_OUT\n"
"{\n"
"   float4 position : POSITION;\n"
"   float4 colour : COLOR;\n"
"   float2 uv : TexCoord0;\n"
"};\n"
"\n"
"float4 main(float4 colour : COLOR, float2 uv : TexCoord0, "
"               uniform Texture2D texture0 : TEXUNIT0) : SV_Target\n"
"{\n"
"   colour = texture0.Sample(textureSamplerState, uv) * colour;\n"
"   colour.a *= alphaPercentage;\n"
"   return colour;\n"
"}\n"
"\n"

After making these changes, the OP's original shader compiler problems go away and CEGUI bootstraps just fine. I'm posting this here until I can get the fix into the repo in case others are intersted in patching the OGRE renderer to work with DX11 in the short-term.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: "default" on Ogre2.1/D3D11?

Postby Ident » Thu Apr 05, 2018 06:13

Thanks. And you are correct, having this in the repo should definitely be the goal.
CrazyEddie: "I don't like GUIs"

crancran
Just popping in
Just popping in
Posts: 5
Joined: Fri Oct 28, 2011 00:54

Re: "default" on Ogre2.1/D3D11?

Postby crancran » Thu Apr 05, 2018 06:17

I have sent in the PR, found here.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 5 guests