I have an image that is partly transparent layered with control node elements in a viewport, and I am putting that viewport texture on a Sprite3D node. The problem I get is that the part that is transparent is only transparent some of the time.

In this image you can see that the sides of the cards on the left are not transparent, while the cards on the right are. I have no clue why this is. I have tried doing the same thing by putting the texture on a mesh instance and somehow get the exact same problem. For the viewport I have Transparent BG enabled, but as you can see it only works part of the time.

Is what I am trying to do possible, or is there a better way to achieve the same effect?

  • I stumbled on a solution that works by changing the render priority of the cards, but I wish there was a better answer.

Any insight would be helpful. Thank you.

Might be a glitch. Which part is the viewport? Maybe there are issues with overlapping transparent viewports (that has always been sketchy) so you can try reducing it so it's within the card.

    cybereality At the moment there is a scene with a viewport with children that are sprites for the card art, borders and icons, and labels for text. That scene is instantiated in a 3D scene with the Sprite3D, Area3D, and collision shape.

    This is how I get the viewport texture

    #Card2D is the scene with the viewport
    func _ready() -> void:
    	$Card2D.set_clear_mode(SubViewport.CLEAR_MODE_ONCE)
    	$Card2D.set_update_mode(SubViewport.UPDATE_ONCE)
    	$Card2D.transparent_bg = true
    	$Sprite3D.texture = $Card2D.get_texture()

    I don't know how I would be able to reduce the size of the viewport without cutting off part of the icons that are meant to be hanging off the card.

    I stumbled on a solution that works by changing the render priority of the cards, but I wish there was a better answer.

    Render priority probably is the best way to do this. If you feel the UX for this is not very good and you think you have ideas on how to improve it then consider opening a proposal on the proposals repo.

    Just upgraded my project to 4.1 and this is thankfully no longer an issue. I don't even have to change the render priority for stuff to stay transparent.