playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.52k stars 1.33k forks source link

Exception noted when using bloom renderpass #6113

Open MAG-AdrianMeredith opened 6 months ago

MAG-AdrianMeredith commented 6 months ago

Description

I'm seeing an exception after testing the lastest builds when using the new renderpasses. Looking at the code in vscode makes it quite clear that it can be undefined so looks like a simple oversight

image

exception here playcanvas.mjs:32653 Uncaught TypeError: Cannot read properties of null (reading 'id') at ForwardRenderer.buildFrameGraph (playcanvas.mjs:32653:1) at AppBase.renderComposition (playcanvas.mjs:42356:1) at AppBase.render (playcanvas.mjs:42352:1) at eval (playcanvas.mjs:42761:1)

I don't have an example repo case but hopefully the ide warning is enough

mvaligursky commented 6 months ago

Could you please look in the debugger to see when this happens? Render actions are created for rendering of layers, so typically this cannot be null. Is there maybe an instance of RenderPassForward with no layers added to it?

MAG-AdrianMeredith commented 6 months ago

Looks like it happens when we use our "Outline" posteffect it appears to be creating 3 renderActions, with the last one being totally empty. Any background information on what creates render actions?

Screenshot 2024-03-06 at 14 56 32

MAG-AdrianMeredith commented 6 months ago

Do post effects still work in the new world or does this need porting to render passes?

mvaligursky commented 6 months ago

Post-effects work if you do not use render passes. If you use render passes, you cannot use post-effects as those are not converted to render passes.

MAG-AdrianMeredith commented 6 months ago

Thats probably the issue then would it be unreasonable to log an error to the console in this case?

mvaligursky commented 6 months ago

Yeah that's definitely on the list. For now it's just a work in progress that's not released for public use. When we'll get it release-ready and documented, we'll port multiple engine examples to use it, make sure issues / errors are reported and similar.

I'll see if I can add some assets for case early though.

MAG-AdrianMeredith commented 6 months ago

Thanks for your help, this is is why I wanted to test things to see what breaks ;). I'll give it another go again next release or two