Skip to content

Clip+Draw on parent plus Clip Only on child has different behavior on opengl and vulkan #74186

@Gnumaru

Description

@Gnumaru

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

Screenshot (295)

On opengl

Screenshot (294)

Steps to reproduce

  1. On an empty scene, create a sprite and set clip_children to Clip+Draw
  2. Create a new sprite as a child and set clip_children to Clip Only and make it smaller than the parent
  3. Set the renderer to mobile or forward+ and notice how the child sprite "carves out" the parent sprite, showing what's behind the parent
  4. 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)

Minimal reproduction project

ClipNDrawOnParentPlusClipOnlyOnChildWorksDifferentOnOpenGl.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions