Feedback Wanted: Lightweight Render Pipeline

For those wondering how to create/queue custom passes in LWRP 5.7.2 now that IBeforeRender and IAfterOpaquePass and similar intefaces are gone, this youtube video (sponsored by unity) really helped.

Strange they are prioritizing sponsored youtube content for the out of preview feature instead of updating the docs, but hey at least I found it! :wink:

4 Likes

marketing typically has a lower work load than the developers in the majority of businesses.

I do both marketing & development for two diff companies, and I typically complete all of my marketing work in an EXTREMELY short period of time, while on apps Im always behind.

Cant automate coding yet!!!

Or before updating their own example project. Or before even replying to Github issues about aforementioned official example projects…

https://github.com/UnityTechnologies/LWRPScriptableRenderPass_ExampleLibrary/issues/5

1 Like

Very true. Engineering team seems behind where they probably wanted to be (and where marketing thought they would be) when out of preview. Very grateful to have found the video, so thanks marketing team!

You can still achieve creating/queuing custom passes similar to using IAfterOpaquePass using ScriptableRenderFeature/ScriptableRenderPass. These are scriptable object based, and when creating them there are analogous enums that allows you to define when the pass should be queued. It’s relatively straightforward, the complexity mostly comes from the lack of documentation.

Sadly there isn’t a single tutorial/video/github project/documentation page that has a fully working solution that I’ve found (probably a side effect of the new way packages are rolled out and iterated on vs the editor itself), but between that video and the few examples they’ve provided, I was able to better understand how the lower level pieces work and figure out how to achieve what I wanted using the new way

2 Likes

Hi @Andre_Mcgrail , will DOTS integration happen at the end of the year? Does it means all of SRPs including LWRP and HDRP will slowly rewrite to DOTS style code?

I’m one of the early adopters of LWRP and I built my entire game using it until finding out there was no way to stack cameras. I’ve been watching the thread hoping for details on the solution. I’m hopeful it’ll get done at some point but for now I’ve just returned to the standard renderer.

Mostly I need it to render isometric dice on top of a perspective camera. If anyone from Unity wants to get any more details for my use case I’d be happy to provide them. If not no worries. Good luck getting this sorted out.

BestSourHyrax

Hey All,

Custom Renderer Examples are HERE!

It took a long time(much longer than it should have but time is a hard thing to find these days) but alas we have cleaned up and roughly documented the examples shown at GDC this year. There is 3 examples in this showing usages of the new Custom Renderer system where you can make your own Forward Renderer and add Renderer Features to control how LWRP renders your content.

Grab it here:
https://github.com/Unity-Technologies/LWRP-CustomRendererExamples

We’ve still yet to write out how the Toon Outline and the Occlusion examples are put together, but will add it in the coming days hopefully.

Also with these examples is the GDC talk:

And the smaller GDC booth talk of a similar nature:

5 Likes

prasbe

Yikes. The FPS example looks like will work for some people but there are some really weird things going on that have been hidden by super low quality settings. I wonder if this was done on purpose or not.

If you add cascades to the shadows you can see that the shadow pass is being dropped on top of the gun. That means a shadow on the floor is also drawn as if it is cast onto the gun. Take a look:
4498513--415105--upload_2019-5-3_10-33-52.png

Ya’ll should have hired me when I applied as rendering QA a while back :stuck_out_tongue:

4498513--415102--upload_2019-5-3_10-32-25.png

3 Likes

Confirmed. Toss me a guild invite too

3 Likes

Hi!

Does anybody know how to get the planar reflections working in 2019.1? Or any new solution?
https://github.com/UnityTechnologies/LWRPScriptableRenderPass_ExampleLibrary

Thanks

1 Like

Looks like ScriptableRendererFeature and ScriptableRenderPass are how you are going to implement it, check the Scripts folder in this repo for starters.

But this question brings up a relevant point: In theory, LWRP could just offer us the “mirror camera” option via rendering object, I think it’s a good feature to add.

“Less glue code and easier render pass”, I believe this should be the motto for LWRP 5.x;

(5.x has largely limit us to a few selected API for good reasons, but I expect it goes further to offer easier solutions to common problems.)

(I am happy to write my own render pass though, just want to make sure ScriptableRendererFeature and ScriptableRenderPass will not simply go away in 6.x like IBeforeCameraRender in 5.x)

2 Likes

Yes we know about this :slight_smile: , hence the RenderObjects(Experimental) and all. The issue is that it does no longer render to the DepthPrepass meaning things like Screen Space Shadows(Cascades) and DOF etc will not work correctly since it is using the CameraDepthTexture. Once we make sure we can get the RenderObjects to also contribute to the depth preps without too much overhead(and fix the UI/UX issues) we will bring it out of preview.

This unfortunately hasn’t been updated for a while, the original authors have been put onto other things. We are very tight on resources and it might be a while before this is updated, you will be able to grab a more updated PlanaReflections from the Boat Attack demo.

ScriptableRenderPass will stay for some time, the ScriptableRenderFeature most likely will change in the future, but really right now it is more just a data container, and the ScriptableObject, as for the logic of the rendering it is all in the ScriptableRenderPass.

1 Like

I just want to reiterate one big important matter. LWRP is out of preview. This means no more breaking C# API or shaders. It’s safe to write your own render pass library using ScriptableRenderPass and ScriptableRendererFeature.

2 Likes

Thx Andre and Phil.

Quick question: is custom ScriptableRenderPass better than beginCameraRendering if you want to add a pass like planar reflection?

The boat attack still use latter I assume because the new API wasn’t available then.

That’s understandable. However - please spend 5 minutes updating the readme to make it clear that it’s broken on newer versions of the LWRP.

It will save people from wasting their time trying it.

It depends. If you have different visible renderers/lights for the reflected camera, then you should do what boat attack does, call LightweightRenderPipeline.RenderSingleCamera. This will do culling then execute the camera renderer. (which renders all enqueued render passes, setup lights, etc)

If you know you have the same visible renderers/lights then you can add a render pass that renders objects (opaques, skybox, transparents or anything else that you need) with a custom camera matrix.

1 Like

Hi Phil

Will we ever have some way to submit a renderer for an additional rendering pass with custom material? We have some effects that require us to render a renderer twice with another material, so we add the other material onto the renderer. But there is a whole lot of issues with this especially with dynamic effects that require procedural materials etc… Having the manage the renderers list of materials and having multiple effects coexist is a big hassle.

I was excited about the Render objects pass, but the issue with it is that it does all the rendering entirely before or entirely after certain stages. I would ideally have our render operations sort correct in and amongst the other materials in the scene. Is there some way to achieve this effect?

Secondly I was wondering when the RenderObjects pass will support renderer layer mask filtering instead of layermask? I tried to implement it myself but saw that the SRO filtering functions don’t yet accept Renderer Layer Mask?

Reporting a LWRP 5.13.0 bug (perhaps also a Unity 2019.1.1 bug) that I really don’t have a clue about:

case 1152557 details a problem where LWRP 5.x Lit shader appears to be fully black in standalone build and can’t be troubleshooted with Frame Debugger. I have tried everything I can think of, including instance shader stripping, shader preloading list, disabling SRP batcher, even tried direct gameobject reference, the rendering is simply bugged.

Below is comparison between editor play mode and standalone build. The extra screenshot for standalone build is to show the before/after when we enable Frame Debugger: it stops rendering DrawMeshInstanced objects, which I believe is another bug (you can see editor shows these draw calls just fine.)

1 Like