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
Setting "Clip+Draw" on a parent and "Clip Only" on it's direct child is an easy way of creating masks for "carving out" part of the parent image, similar to how light masks worked on godot 3.
But unfortunately it only works on vulkan. On opengl the child image is drawn all white.
On vulkan
On opengl
Steps to reproduce
On an empty scene, create a sprite and set clip_children to Clip+Draw
Create a new sprite as a child and set clip_children to Clip Only and make it smaller than the parent
Set the renderer to mobile or forward+ and notice how the child sprite "carves out" the parent sprite, showing what's behind the parent
Then set the renderer to compatibility and notice how the child sprite is drawn all white (except any transparent parts, which show the parent behind)
I feel like it probably isn't intended, as recursive clip just broke clipping before and that was a known limitation.
I customized the internal clip shader a bit (seen here) to get it working with blend modes:
but it wasn't added (maybe for a technical reason, but it just seems like it was glossed over).
EDIT: To be clear, I am a lurker so someone else will need to evaluate and implement.
I did add this after that comment:
Multiply is still broken, but can be fixed by in the clip shader, add after setting rgb: COLOR.a *= c.a;
I think that might be all that's needed for getting subtraction (considering clip (only) allows the top-right example).
Though I don't think that would allow for a texture to properly subtract (like the bottom-right example, because textures are not handled the same as polygons), but other blend modes might work. (admittedly, I don't recall testing that and have not tested in a while)
Godot version
4.0.stable
System information
windows 10, nvidia graphics
Issue description
Setting "Clip+Draw" on a parent and "Clip Only" on it's direct child is an easy way of creating masks for "carving out" part of the parent image, similar to how light masks worked on godot 3.
But unfortunately it only works on vulkan. On opengl the child image is drawn all white.
On vulkan
On opengl
Steps to reproduce
Minimal reproduction project
ClipNDrawOnParentPlusClipOnlyOnChildWorksDifferentOnOpenGl.zip
The text was updated successfully, but these errors were encountered: