Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP pull request, the goal of this feature is to make it easier to use shaders to perform instant compute operations in the GPU, without the need to support compute shaders, that can be used on lower-end devices ("instant" means that the shader runs in sync with the caller thread, so it can freeze the thread for some time if the shader performs expensive calculations). The idea is to blit a source texture into a output texture, using any user-defined shader, being Spatial or Canvas Item shader.
The feature is available as a single VisualServer method call:
VisualServer.material_blit(RID material, RID source_texture, RID output_texture)
The
source_texture
can be read in a CanvasItem shader asTEXTURE
input.I had some issues to write the code, as I don't understand much of rendering back-end, so the code is a bit messy and I may need some help to complete this feature if relevant. I'm targetting 3.x as it is OpenGL only for now, and I don't have Vulkan support in my machine to write a 4.x version.
Here is a demo run of a simple paint program using this feature:
Demo.mp4
Don't mind my drawing skills 😅
Here is the paint demo project:
Paint.zip
Bugsquad edit: This partially addresses godotengine/godot-proposals#1010.