Faerdan
Topic Author
Posts: 73
Joined: 02 Oct 2015, 09:11
Location: Galway, Ireland
Contact:

[719] Linear color space issues (in Xenko DX11)

13 Apr 2016, 22:07

Hi,

I know this issue is known to exist in Unity, but I am also experiencing washes out colours in Xenko (DX11 renderer) using linear color space.

We will be putting together a press release for our game in about three to four weeks, and need to be able to include screenshots of the UI. It is not feasible to switch to DX9 at the moment, and we require the linear color space for our PBR workflow.

This upcoming press release is a pretty big deal for us, both announcing the game to the press as well as announcing the involvement of Isaac Hannaford (lead concept artist at Bungie for Halo 3, ODST, Reach nand Destiny). He is designing our spaceships and stations:
Spaceship Concept Art

Our UIs, built with Noesis, are a huge part of UNION:
UNION Engineering UI

Would it be possible to include the linear color fix in 1.2.6?


Thanks!

Mark
 
User avatar
jsantos
Site Admin
Posts: 3917
Joined: 20 Jan 2012, 17:18
Contact:

Re: [719] Linear color space issues (in Xenko DX11)

14 Apr 2016, 08:25

Congratulations for the amazing game! We have been following this project since you started integrating noesisGUI. Let me say that it looks better and better each time we come back to it.

Regarding linear color space, solving it in 1.2.6 is not easy. Our plan is solving it in the 1.3 branch. Right now, 1.2.6 is almost closed and something like this would add more delays. But, getting our clients finish their games is our first priority so let's see if we can find a solution.

The main problem with fixing this is related to the Unity integration. In your case I think the solution should be easier. I assume you are using a SRGB render target right? DirectX11 supports creating views (alias) of a given render target with a different format. So, for example if you are using the DXGI_FORMAT_R8G8B8A8_UNORM_SRGB format, you need to create a view of that surface with the format DXGI_FORMAT_R8G8B8A8_UNORM and bind that surface instead of the original one when rendering NoesisGUI.

Could you try it?
 
Faerdan
Topic Author
Posts: 73
Joined: 02 Oct 2015, 09:11
Location: Galway, Ireland
Contact:

Re: [719] Linear color space issues (in Xenko DX11)

14 Apr 2016, 10:17

Thank you for the compliments. I searched for a long time to find a GUI library which would make my UI concepts possible using vectors, and Noesis is really the first one with the quality and feature level required. Thank you for a great product.

I don't have any graphics programming experience, beyond some shader work. My background is in game systems and network programming and I do not have the knowledge required to implement the fix which you have suggested.

I don't like asking you to take on the burden of solving this issue just for me, but could you give me some pointers? Xenko, the engine I am using, is based on MonoGame and I am using a slightly modified version of the MonoGame Noesis wrapper (from GitHub). Like MonoGame it uses SharpDX for DirectX rendering.
 
User avatar
jsantos
Site Admin
Posts: 3917
Joined: 20 Jan 2012, 17:18
Contact:

Re: [719] Linear color space issues (in Xenko DX11)

15 Apr 2016, 11:05

Looking through SharpDX API you must be creating a RenderTargetView somewhere. Something like this:
new RenderTargetView(device, resource);
At that point, you should also create a new view specifying a non SRGB format, something like this:
var desc = new RenderTargetViewDescription();
desc.Format = SharpDX.DXGI.Format.B8G8R8A8_UNorm;
desc.Dimension = RenderTargetViewDimension.Texture2D;
desc.Texture2D.MipSlice = 0;
renderTargetViewNonSRGB = new RenderTargetView(device, resource, desc);
Note that you should use the same format that was used for creating the original resource but removing the _SRGB, this is the important detail.

Once you have the view created, you must bind it at the NoesisGUI.MonoGameWrapper.PostRender() function. Something like this:
public void PostRender()
{
    this.deviceState.Save(this.DeviceDX11.ImmediateContext);

    this.DeviceDX11.ImmediateContext.OutputMerger.SetRenderTargets(depthStencilView, renderTargetViewNonSRGB);

    this.uiRenderer.PostRender();
    this.deviceState.Restore(this.DeviceDX11.ImmediateContext);
}
Please, let me know if this helps you of if you need more detail.

Thanks!
 
Faerdan
Topic Author
Posts: 73
Joined: 02 Oct 2015, 09:11
Location: Galway, Ireland
Contact:

Re: [719] Linear color space issues (in Xenko DX11)

15 Apr 2016, 13:56

Excellent info, thank you.

I won't have time to try this today, but I will as soon. I'll let you know how I get on.

Thanks again. :)

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 9 guests