You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
General 2D VFX, particularly custom lighting and interactive foliage
Describe the problem or limitation you are having in your project
For advanced VFX, being able to render to multiple buffers that hold different information is quite valuable.
The best way to do this currently is to create viewports via RenderingServer.viewport_create() and manually force them to draw before the main viewport, to avoid a 1-frame delay.
This is not the most performance friendly way, and still does not allow you to do things like creating a velocity texture.
The compositor does allow for some more functionality, but this is limited to 3D and still not sufficient.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
What would solve all of these problems is a way to ask the rendering server to draw a canvas like it usually would, but to a custom output, using a custom shader (the same for all nodes) and with custom data.
For the example of a velocity texture, you would ask the rendering server for the list of canvas items to be drawn, generate a buffer containing a vec2 of each nodes velocity, then ask the rendering server to draw those nodes to a supplied texture, using a supplied shader and the supplied buffer.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
There are hacks to achieve some of this, but they are not good for performance nor are they convenient or able to cover all the necessary use cases.
Is there a reason why this should be core and not an add-on in the asset library?
There is no way to implement this via either gdscript or gdextension, because the engine exposes no relevant hooks.
Additionally, this enhances the functionality of the rendering server.
The whole job of the rendering server is to allow culling and sorting of a canvas via the SceneTree, and drawing of all the various types of canvas items, without putting unnecessary work on the user. This would still do exactly that, but allow for more flexibility in how the drawing itself happens.
The text was updated successfully, but these errors were encountered:
I would be happy to contribute to this myself, but the engine render code is rather dense.
So far I believe that RendererCanvasRenderRD::_render_batch_items is probably close to what needs to be exposed from the engine
So any knowledge about the internals of the engine would be appreciated as well and perhaps I could work on this myself
Describe the project you are working on
General 2D VFX, particularly custom lighting and interactive foliage
Describe the problem or limitation you are having in your project
For advanced VFX, being able to render to multiple buffers that hold different information is quite valuable.
The best way to do this currently is to create viewports via
RenderingServer.viewport_create()
and manually force them to draw before the main viewport, to avoid a 1-frame delay.This is not the most performance friendly way, and still does not allow you to do things like creating a velocity texture.
The compositor does allow for some more functionality, but this is limited to 3D and still not sufficient.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
What would solve all of these problems is a way to ask the rendering server to draw a canvas like it usually would, but to a custom output, using a custom shader (the same for all nodes) and with custom data.
For the example of a velocity texture, you would ask the rendering server for the list of canvas items to be drawn, generate a buffer containing a vec2 of each nodes velocity, then ask the rendering server to draw those nodes to a supplied texture, using a supplied shader and the supplied buffer.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The basic usage would look something like
If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
There are hacks to achieve some of this, but they are not good for performance nor are they convenient or able to cover all the necessary use cases.
Is there a reason why this should be core and not an add-on in the asset library?
There is no way to implement this via either gdscript or gdextension, because the engine exposes no relevant hooks.
Additionally, this enhances the functionality of the rendering server.
The whole job of the rendering server is to allow culling and sorting of a canvas via the SceneTree, and drawing of all the various types of canvas items, without putting unnecessary work on the user. This would still do exactly that, but allow for more flexibility in how the drawing itself happens.
The text was updated successfully, but these errors were encountered: