View Issue Details

IDProjectCategoryView StatusLast Update
0003771NoesisGUIUnity3Dpublic2024-11-22 18:24
ReporterSvenRH Assigned Tojsantos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.5 
Target Version3.2.6Fixed in Version3.2.6 
Summary0003771: Unity 6 / URP - RenderGraph Support
DescriptionThe NoesisScriptableRenderPass doesn't support RenderGraph, so when trying to use Noesis the following Warning is emitted (and Noesis doesn't work)

> The render pass NoesisView+NoesisScriptableRenderPass does not have an implementation of the RecordRenderGraph method. Please implement this method, or consider turning on Compatibility Mode (RenderGraph disabled) in the menu Edit > Project Settings > Graphics > URP. Otherwise the render pass will have no effect.




Tried a quick ugly hack and added the following to the NoesisScritableRenderPass (made some stuff in the NoesisRenderer public so i could access it). It seems to work. There are some additonal things that are would be done in RenderOnScreen (FixCommandBuffers / Invalidate) that I skipped here as it wasn't necessary for my test case (DX12)

        private class PassData
        {
            public View view;
            public CommandBuffer commands;
        }
        
        public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
        {
            if (_view._uiView != null && _view._visible) {
                using (var builder = renderGraph.AddUnsafePass<PassData>("Just testing", out var passData)) {
                    
                    //bool flipY = !IsGL() && !IsBackbuffer(_view._camera);
                    // var flipY = false;
                    // _view._commands.name = Profiling.RenderOnScreen;
                    passData.commands = _view._commands;
                    passData.view = _view._uiView;
                    
                    builder.AllowPassCulling(false);
        
                    builder.SetRenderFunc((PassData passData, UnsafeGraphContext context) => {
                        // var commands = passData.commands;
                        var eventId = 0x6449;
                        var invalidate = true;
                        context.cmd.IssuePluginEventAndData(NoesisRenderer._renderOnscreenCallback, eventId, passData.view.Renderer.CPtr.Handle);
                    });
                }
            }
        }
Steps To ReproduceAdd Noesis to a Unity 6 URP project, press play.
TagsNo tags attached.
PlatformAny

Activities

jsantos

jsantos

2024-11-04 16:48

manager   ~0010103

Last edited: 2024-11-04 16:48

Thanks for the time creating this ticket and proposing a workaround.

We will work on this as soon as possible.
SvenRH

SvenRH

2024-11-04 17:06

reporter   ~0010104

Got a bit nicer workaround now.
In NoesisScriptableRenderPass

        private class PassData
        {
            public View view;
            public bool clearStencil;
        }
        
        public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
        {
            if (_view._uiView != null && _view._visible) {
                using (var builder = renderGraph.AddUnsafePass<PassData>("Noesis", out var passData)) {
                    

                    passData.view = _view._uiView;
                    passData.clearStencil = _view._clearStencil;
                    
                    builder.AllowPassCulling(false);
                    
                    builder.SetRenderFunc((PassData passData, UnsafeGraphContext context) =>
                    {
                        bool flipY = !IsGL(); // && !IsBackbuffer(_view._camera);
                        NoesisRenderer.RenderOnscreen(passData.view, flipY, context.cmd, true, passData.clearStencil);
                    });
                    
                }
            }
        }

and in
NoesisRenderer
    public static void RenderOnscreen(Noesis.View view, bool flipY, UnityEngine.Rendering.UnsafeCommandBuffer commands,
        bool invalidate, bool clearStencil)
    {
        FixCommandBuffer(commands);
    
        if (clearStencil)
        {
            commands.ClearRenderTarget(UnityEngine.Rendering.RTClearFlags.Stencil, UnityEngine.Color.black, 1.0f, 0);
        }
    
        var eventId = flipY ? EventId.RenderOnscreenFlipY : EventId.RenderOnscreen;
        
        commands.IssuePluginEventAndData(_renderOnscreenCallback, (int)eventId, view.Renderer.CPtr.Handle);
        if (invalidate) InvalidateState(commands);
    }

and FixCommandBuffer & InvalidateState are just copies of the 'normal' versions, but with UnityEngine.Rendering.UnsafeCommandBuffer as a parameter.
jsantos

jsantos

2024-11-22 18:24

manager   ~0010152

Thanks for the great feedback!

Issue History

Date Modified Username Field Change
2024-11-02 12:57 SvenRH New Issue
2024-11-04 16:47 jsantos Assigned To => jsantos
2024-11-04 16:47 jsantos Status new => assigned
2024-11-04 16:47 jsantos Target Version => 3.2.6
2024-11-04 16:48 jsantos Note Added: 0010103
2024-11-04 16:48 jsantos Note Edited: 0010103
2024-11-04 17:06 SvenRH Note Added: 0010104
2024-11-22 18:17 jsantos Status assigned => resolved
2024-11-22 18:17 jsantos Resolution open => fixed
2024-11-22 18:17 jsantos Fixed in Version => 3.2.6
2024-11-22 18:24 jsantos Note Added: 0010152