Mikael Gyth
Topic Author
Posts: 33
Joined: 15 Aug 2013, 12:53

Unity3D ImageEffects

20 Mar 2014, 13:38

Hello.
There might be a simple solutions to this, but I haven't discovered it yet.
Is there a way to have Unitys ImageEffects not effect NoesisGui?
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Unity3D ImageEffects

21 Mar 2014, 13:36

Hi,

We are currently doing our render on the MonoBehavior.PostRender() function, that gets called after Unity's Render.TransparentGeometry layer, but before Camera.ImageEffects.

I've been investigating and I think we can move our Render to the end of frame by using a corutine that waits until then. We will probably change it for 1.2 version, but if you want to try it now, you will have to modify a pair of scripts:

- In Assets/Plugins/NoesisGUI/Scripts/NoesisGUIPanel.cs, change the PostRender() function to:
void OnPostRender()
{
    if (_uiRenderer != null)
    {
        StartCoroutine(EndOfFrameRender());
    }
}

IEnumerator EndOfFrameRender()
{
    yield return new WaitForEndOfFrame();
    _uiRenderer.PostRender();
}
- In Assets/Plugins/NoesisGUI/Scripts/Core/NoesisUIRenderer.cs, in the function UpdateSettings(), comment the line that flips render vertically for deferred lighting:
private void UpdateSettings(Noesis.AntialiasingMode aaMode,
    Noesis.TessellationMode tessMode, Noesis.TessellationQuality tessQuality,
    Noesis.RendererFlags flags)
{
    // update renderer size
    if (_texture == null)
    {
        // ...

        if (_isGraphicsDeviceDirectX)
        {
            // ...

            if (camera != null &&
                camera.actualRenderingPath == UnityEngine.RenderingPath.DeferredLighting)
            {
                // vvv   H E R E   vvv
                //flags |= RendererFlags.FlipY;
            }
        }
    }
    else // Render to Texture
    {
        // ...
    }

    // ...
}
 
Mikael Gyth
Topic Author
Posts: 33
Joined: 15 Aug 2013, 12:53

Re: Unity3D ImageEffects

22 Mar 2014, 17:28

I will give it a try.
Your customer service never seizes to astonish me. Thank you very much. :D
 
Mikael Gyth
Topic Author
Posts: 33
Joined: 15 Aug 2013, 12:53

Re: Unity3D ImageEffects

25 Mar 2014, 17:20

Just popped in to say that the fix seems to work as expected.
I did notice that Unitys Bloom affect still affected NoesisGUI after the changes tough (But thats not a problem for us right now).
Thanks again for the quick reply :)
 
g33rt
Posts: 23
Joined: 14 Jan 2014, 16:02

Re: Unity3D ImageEffects

27 Mar 2014, 17:10

If you change this for the 1.2 version, could this be made optional somehow? I'm currently using the Unity3D Image effects to create some cool transitions between the NoesisGUI pages ...

Geert
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Unity3D ImageEffects

28 Mar 2014, 23:45

Just popped in to say that the fix seems to work as expected.
I did notice that Unitys Bloom affect still affected NoesisGUI after the changes tough (But thats not a problem for us right now).
Thanks again for the quick reply :)
Yes, Bloom is affecting all the textures (brush gradients, text glyphs, images...) that we use to render the GUI. We will investigate how to avoid this issues when rendering the GUI without image effects.
If you change this for the 1.2 version, could this be made optional somehow? I'm currently using the Unity3D Image effects to create some cool transitions between the NoesisGUI pages ...

Geert
It sounds right to me, we can provide a check box in the NoesisGUI Panel component to decide if Image Effects should affect the GUI or not. Thanks for the suggestion.

Who is online

Users browsing this forum: No registered users and 1 guest