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

Add support for Multiple Render Targets (MRT) #495

Open
samdze opened this issue Feb 19, 2020 · 6 comments
Open

Add support for Multiple Render Targets (MRT) #495

samdze opened this issue Feb 19, 2020 · 6 comments

Comments

@samdze
Copy link

samdze commented Feb 19, 2020

Describe the project you are working on:
Top-down 2D rpg with heavy use of visual effects, post-processing and custom depth tests.

Describe the problem or limitation you are having in your project:
Right now, I can't fill several buffers when an object is drawn by Godot (I also need to progressively read some of these same buffers to perform depth tests and the like, multi-pass shaders needed) unless I duplicate each object in different Viewport, which is extremely inconvenient and a waste of resources.

The ViewportContainer -> Viewport -> World approach is also very tedious to just setup a render target, and it doesn't allow spread out nodes to render to it.

So, a more flexible and unrestricted way of assigning render targets would be great.

I know MRT is scheduled for 4.0 as @reduz said here, I hope it can be added as soon as possible as I need to prototype the related features in the game.
I know that customizable render pipelines are scheduled too, together with MRT the possibilities will be very extensive.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
MRT is a very useful feature of modern GPUs and every major engine in the market supports it.
It is useful to create nice effects and post-processing in 3D and even in 2D when more than one buffer needs to be written at once by each object.

I think the rendering code rewrite in Vulkan is the perfect opportunity to add this feature, together with #496

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
<>

If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, severe duplication of nodes would be needed and there would be many inconveniences.

Is there a reason why this should be core and not an add-on in the asset library?:
This would be extremely inefficient to do in a way that is not core related.

@reduz
Copy link
Member

reduz commented Feb 20, 2020

This is planned for 4.0, still debating myself how to do it.

@samdze
Copy link
Author

samdze commented Feb 22, 2020

Thanks! Would also like to highlight this point for the proposal:

The ViewportContainer -> Viewport -> World approach is also very tedious to just setup a render target, and it doesn't allow spread out nodes to render to it.

So, a more flexible and unrestricted way of assigning render targets would be great.

@Zireael07
Copy link

I ran into the limitation of screen reading shaders, namely that they happen before alpha pass. This would likely help a lot in such cases!

@sserafimescu

This comment was marked as off-topic.

@huyi7
Copy link

huyi7 commented Apr 10, 2024

Been checking back from time to time hoping MRT can be implemented in Godot 4. That would enable us to do more efficiently GPGPU processing.

@clayjohn
Copy link
Member

@huyi7 Check out #7916 as this is more likely the approach we would go with for MRTs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants