#How to make screen texture cover popups?

20 messages · Page 1 of 1 (latest)

quiet plover
#

Working on a filter with node structure like this, basically a wrapper, using the screen texture in a shader in the Filter node.

- Game ( default Control node)
  - GameLoader (default Control node as a parent)
    - GameContent( all the game scenes, UI and nodes)
  - Filter(ColorRect)

But popup and option buttons seems to be on a different Viewport and unaffected by the filter. Nothing seems to affect them. Anyone know how to do this?

So far have tried:

  • putting game content in SubViewport
  • using ViewportTexture as shader input
  • changing the Filter z order to absolute and max
  • enabled top level on the Filter node
  • put Filter shader in GameLoader
  • change GameLoader into CanvasLayer
  • wrap filter in a CanvasLayer
  • add a Filter node as child to OptionButton.get_popup(), this blocked the content, or is getting empty screen texture
still gorge
#

@quiet plover Are you using canvas item?

quiet plover
#

Sorry, which node are you referring to?

#

@still gorge The Filter(ColorRect) node is using material, which came from canvas item I think, and it's using shadermaterial to do the filter effects.

still gorge
#

For your buttons

quiet plover
#

Just OptionButton and Popup from native Godot

#

It could be the popup from option button is same as Popup, which extends from Window/Viewport.

still gorge
#

Are they inside a canvas item?

#

Ah, yeah, that would make sense.

quiet plover
#

Game content is pretty much all under or is Control/CanvasItem yeah

still gorge
#

You could try using your filter in a new canvas item and have it placed in a layer above your UI.

quiet plover
#

That is an idea, thanks, I'll try it out soon.

quiet plover
#

unfortunately moving the filter didn't make much difference. Parent of UI > filter doesnt work; Sibiling of parent > no change. The different viewports might be something tho, although not quite sure how to handle OptionButton, since it doesn't seems to create a new node.

still gorge
#

It's kind of hard to determine what's going on with your game without any views of code or images to help explain, but there are other options available too, like in the color_rect, you could check the top_level marker in the visibility drop down. However, it's usually best to try and figure out your layer situation. So, if you're wanting nodes to show above nodes we know about y_sort and z_index, but nodes are not always plain 2d nodes, but are control nodes. Control nodes have different affect when used because they are considered for the most part, a UI node.

#

You can layer canvas items, and they are similar to viewport.

#

If you can't get the layer to properly work for the shader, try using one in the UI that holds the button. Alternativly, you could just hide the node with code after the shader takes affect.

still gorge
#

I guess that wouldn't be the desired affect though.

quiet plover
#

Here's a minimal reproduction project, it's simpler than imagined. Made a theme where all the panel should be pink and a filter that makes every grayscale.

#

the only workaround i have right now is to just copy the ColorRect filter under the Popup/Viewport node. Tho, hoping for a do it once and cover everything type method