-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PassNode: Implement Auto-MRT. #28749
Comments
My plan is to advanced effects to |
This is very important and something I was planning too, I'll try publish something for the next release. |
Have you considered a g buffer pass or something with specialized packing for those effects? e.g. https://github.com/0beqz/realism-effects/blob/v2/src/gbuffer/shader/gbuffer_packing.glsl I worry this can be very bandwidth hungry if generalized to an attachment per element of data since we can't have mixed precision between MRT attachments -- have to implement that ourselves with packing like the above. |
I would recommend to start with a default MRT setup and get this going first. Investigating optimizations based on packing is something I would do after that. In general, I'm afraid of potential artifacts that might occur when aggressively packing data so this needs to be investigated closely. What kind of experience did you make in that regard so far? |
Agree on MRT as a baseline since that's quick and easy. I misunderstood this as an enhancement to the existing post-processing effects, so I was speaking from a different context. I don't have much to say here for generalizing a packing scheme other than this among a few topics actively designed in pmndrs/postprocessing#419. The source I've shared has battled against different ANGLE backends with notes inline for hazards. I think this can be considered a separate issue with data packing functions as a prerequisite and #28708 for quality control. |
The packages are very interesting, transpiling them into nodes would be great, which would be very compatible with the current approach. |
Description
More advanced effects like AO, Bloom or Motion Blur require next to beauty and depth a normal and potentially a velocity buffer from the scene pass. It would be good for performance if normal and velocity would be generated in one pass with beauty and depth. To do that, the renderer needs to automatically configure the scene's materials so they output whatever is requested in the current render target.
Solution
In
PassNode
I have added the following two methods:However, they only configure the render target and the texture nodes for further use in effects. It's also required to auto-configure all node materials in the scene to produce the correct output according to the render targets setting. I've seen
OutputStructNode
and its usage inwebgpu_multiple_rendertargets
but this class needs to be used internally somehow.Alternatives
Doing post processing without MRT but this has performance implications when implementing more complex effects.
Additional context
#27808 tries to add this for
WebGLRenderer
but there is an unsolved material updating issue when switching render targets.The text was updated successfully, but these errors were encountered: