LauriK
Topic Author
Posts: 6
Joined: 17 Jun 2022, 08:56

Text rendering issue in DirectX 12 integration with proprietary Engine

17 Jun 2022, 10:25

Hi,
We have successfully integrated Noesis GUI within our c++ engine and with D3D11 renderer everthing seems to render as expected.
However when using a D3D12 renderer, we have encountered a problem with text rendering.

We have tested this with the Simple "Hello World" sample xaml found in Noesis GUI Samples.

By changing the "Hello world" text in the button to "ABCDEFGHIJKLMNOPQRSTA" everything looks correct, but when the last A character is changed to a new character in alphabetics that is beyond 'T', first letter 'A' in the text is changed to the last letter typed in the text, but with offsetted UV coordinate. Also RenderDoc capture shows, that R8_UNORM formatted glyphs texture doesn't anymore represent correct glyphs. It seems like the number of glyphs is restricted to 20. The last image represents the issue with UVX replacing the beginning ABC with offsetted version of UVX.

Also after adding the next alphabet which exceeds the limit of 20, the background gradient starts having weird dark bars.

You will find the XAML layout used to test this issue at the end of this message.
Currently we are unable to identify the root cause for the issue.
<Button Content="ABCDEFGHIJKLMNOPQRSTA" Margin="0,30,0,0"/>
Image
Image
<Button Content="ABCDEFGHIJKLMNOPQRSTU" Margin="0,30,0,0"/>
Image
Image

Image
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
            <Grid.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0" Color="#FF123F61"/>
                    <GradientStop Offset="0.6" Color="#FF0E4B79"/>
                    <GradientStop Offset="0.7" Color="#FF106097"/>
                </LinearGradientBrush>
            </Grid.Background>
            <Viewbox>
                <StackPanel Margin="50">
                    <Button Content="ABCDEFGHIJKLMNOPQRSTUVX" Margin="0,30,0,0"/>

                    <Rectangle Height="5" Margin="-10,20,-10,0">
                        <Rectangle.Fill>
                            <RadialGradientBrush>
                                <GradientStop Offset="0" Color="#40000000"/>
                                <GradientStop Offset="1" Color="#00000000"/>
                            </RadialGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                </StackPanel>
            </Viewbox>
        </Grid>
 
User avatar
jsantos
Site Admin
Posts: 3456
Joined: 20 Jan 2012, 17:18
Contact:

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 10:28

Are you able to reproduce this in HelloWorld example using our D3D12 renderer?
 
LauriK
Topic Author
Posts: 6
Joined: 17 Jun 2022, 08:56

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 10:44

Are you able to reproduce this in HelloWorld example using our D3D12 renderer?
Hello World example renders the text correctly as "Hello World" in the button as expected.
Though, the Rectangle with Radial Gradient Brush seems to also have some "opacity" issues within the gradient.
<Rectangle Height="5" Margin="-10,20,-10,0">
                        <Rectangle.Fill>
                            <RadialGradientBrush>
                                <GradientStop Offset="0" Color="#40000000"/>
                                <GradientStop Offset="1" Color="#00000000"/>
                            </RadialGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
 
LauriK
Topic Author
Posts: 6
Joined: 17 Jun 2022, 08:56

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 10:52

Regarding last post:

Actually as I just tried with NoesisGUI-win-x86_64 Visual Studio Solution (Debug and Release targets), the Hello world project doesn't even launch.
First I need to figure out why it crashed and then I can confirm for sure that text rendering really works as expected with the provided Sample HelloWorld project.

Callstack of the crash:
>	NoesisApp.dll!NoesisApp::D3D12RenderDevice::CreatePipelines(NoesisApp::D3D12RenderDevice::Program * program, unsigned char shader_, const char * label_, D3D12_GRAPHICS_PIPELINE_STATE_DESC & desc) Line 2038	C++
 	NoesisApp.dll!NoesisApp::D3D12RenderDevice::CreateShaders() Line 2194	C++
 	NoesisApp.dll!NoesisApp::D3D12RenderDevice::D3D12RenderDevice(ID3D12Device * device, ID3D12Fence * frameFence, DXGI_FORMAT colorFormat, DXGI_FORMAT stencilFormat, DXGI_SAMPLE_DESC sampleDesc, bool sRGB) Line 362	C++
 	[Inline Frame] NoesisApp.dll!NoesisApp::D3D12Factory::CreateDevice(ID3D12Device * device, ID3D12Fence * frameFence, DXGI_FORMAT colorFormat, DXGI_FORMAT sampleDesc, DXGI_SAMPLE_DESC) Line 22	C++
 	NoesisApp.dll!NoesisApp::D3D12RenderContext::Init(void * window, unsigned int & samples, bool vsync, bool sRGB) Line 175	C++
 	NoesisApp.dll!NoesisApp::Application::Init(NoesisApp::Display * display, const NoesisApp::CommandLine & arguments) Line 134	C++
 	NoesisApp.dll!NoesisApp::ApplicationLauncher::OnStartUp() Line 110	C++
 	NoesisApp.dll!NoesisApp::DisplayLauncher::Run() Line 36	C++
 	[Inline Frame] Samples.HelloWorld.exe!NsMain(int argc, char * * argv) Line 81	C++
 	Samples.HelloWorld.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 36	C++
 
User avatar
jsantos
Site Admin
Posts: 3456
Joined: 20 Jan 2012, 17:18
Contact:

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 11:01

Hi Just tried this XAML:
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Grid.Background>
    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
      <GradientStop Offset="0" Color="#FF123F61"/>
      <GradientStop Offset="0.6" Color="#FF0E4B79"/>
      <GradientStop Offset="0.7" Color="#FF106097"/>
    </LinearGradientBrush>
  </Grid.Background>
  <Viewbox>
    <StackPanel Margin="50">
      <Button Content="ABCDEFGHIJKLMNOPQRSTUVX" Margin="0,30,0,0"/>

      <Rectangle Height="5" Margin="-10,20,-10,0">
        <Rectangle.Fill>
          <RadialGradientBrush>
            <GradientStop Offset="0" Color="#40000000"/>
            <GradientStop Offset="1" Color="#00000000"/>
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
    </StackPanel>
  </Viewbox>
</Grid>
in XamlPlayer, with D3D12 renderer and it displays correctly.

Regarding the crash, with the debug build, aren't you getting more information in the Output console?
 
LauriK
Topic Author
Posts: 6
Joined: 17 Jun 2022, 08:56

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 11:06

It was due to previously re-compiled shaders that were found in C:\ProgramData\Noesis Technologies\ShaderCache.

We are using FXC.exe shader compiler that comes with Microsoft DirectX SDK (June 2010) to compile the shaders, with NoesisGUI\Src\Packages\Render\D3D12RenderDevice\Src\build_shaders.bat to compile the shaders and use the generated Shaders.h.

For some reason the generated Shaders.h when re-compling doesn't load correctly and causes a D3D12 validation error:
"Root Signature doesn't match Pixel Shader: Shader CBV descriptor range (BaseShaderRegister=0, NumDescriptors=1, RegisterSpace=0) is not fully bound in root signature".

I needed to delete the previously generated Shader cache files and now it launched and showed a correct looking Noesis GUI logo and Hello world texts being animated.
I need to now try the ACBD.... text that I was able to reproduce the problem within our application.

I will get back with results soon.
 
User avatar
jsantos
Site Admin
Posts: 3456
Joined: 20 Jan 2012, 17:18
Contact:

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 11:13

Thanks for the feedback. I will try to reproduce the problem with the cache, it seems we are not doing something correctly.
 
LauriK
Topic Author
Posts: 6
Joined: 17 Jun 2022, 08:56

Re: Text rendering issue in DirectX 12 integration with propriatery Engine

17 Jun 2022, 11:16

Both, IntegrationGLUT and HelloWorld sample applications provided by Noesis GUI seems to render the "ABCDEFGHJIKLMNOPQRSTUVWX" correctly.
I will investigate the issue a bit more on our end and get back if/when get further results.

Thanks.
 
LauriK
Topic Author
Posts: 6
Joined: 17 Jun 2022, 08:56

Re: Text rendering issue in DirectX 12 integration with proprietary Engine

17 Jun 2022, 14:30

The partial opacity issue with the gradient oval underneath the textbutton gave us some hint about the root cause.
It's a sampler issue with the currently bound sampler types when rendering Noesis GUI in the command list that we render over our existing application render commands.
We need to resolve this internally and bind the correct sampler types when rendering Noesis GUI.
 
User avatar
jsantos
Site Admin
Posts: 3456
Joined: 20 Jan 2012, 17:18
Contact:

Re: Text rendering issue in DirectX 12 integration with proprietary Engine

17 Jun 2022, 23:13

Glad to know you identified the source of the issue. I am going to mark this as solved, but please feel free to add more comments if you need.

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests