Skip to content
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

Implement modular and more explicit render passes #4271

Closed
mvaligursky opened this issue May 25, 2022 · 3 comments
Closed

Implement modular and more explicit render passes #4271

mvaligursky opened this issue May 25, 2022 · 3 comments
Assignees
Labels
area: graphics Graphics related issue feature performance Relating to load times or frame rate 🔥🔥‎
Milestone

Comments

@mvaligursky
Copy link
Contributor

Currently, the PlayCanvas engine does not implement explicit render passes (rendering processes with outputs going to different render targets), and rendering is driven directly by ForwardRenderer, making it pretty complex and harder to extend. This includes rendering of the main scene, depth and color grab passes, shadow maps, shadow and cookie atlases and multiple post-processing effects and similar.

We're facing multiple issues with this system currently:

  • WebGPU requires the rendering to be submitted using render passes, to allow optimal performance on tiled architectures, in relation to load and store operations on the render attachments.
  • WebGL can benefit from similar organisation, and use invalidateFramebuffer to save considerable memory bandwidth on tiled architectures.
  • Without clear understanding of render passes, the management of resolves of multisampled attachments as well as mipmap generation (specifically for cube maps) becomes complicated, and we are wasting a lot of performance performing those when not needed.

We've identified a solution to improve this, which is the FrameGraph. It allows the frame rendering to be described in a graph form, where the nodes represent render passes (rendering into a render target). Edges represent dependencies of those render targets. This will allow us to solve the mentioned issues, and implement more flexible and performant rendering architecture.

References:
https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/invalidateFramebuffer
https://www.gdcvault.com/play/1024612/FrameGraph-Extensible-Rendering-Architecture-in
https://www.dropbox.com/s/89pvx9obhv6m0pk/High%20Quality,%20High%20Performance%20Graphics%20in%20Filament%20(Handout).pdf?dl=0

@Adriaaaaan
Copy link

I'd just like to say, I think its awesome you're working on these kinds of tasks. Its so easy nowadays to focus on visual flashy features but its the architecture work that really helps to deliver them in a practical, maintainable and performant manner.

@mvaligursky
Copy link
Contributor Author

I'll close this, as on a generic level this has been done already, and will open separate issues on further work in this area.

@github-project-automation github-project-automation bot moved this from Todo to Done in PlayCanvas Roadmap Sep 28, 2023
@mvaligursky
Copy link
Contributor Author

mvaligursky commented Sep 28, 2023

Related: #5686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature performance Relating to load times or frame rate 🔥🔥‎
Projects
Development

No branches or pull requests

4 participants