ViewportTexture in shader disappears when running the game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Freya

I am trying to code a spatial shader, which takes the color values from the pixels of a (uniform) texture and sets the y coordinates of the vertices of a plane mesh accordingly. The texture is a ViewportTexture. In the editor it works, but as soon as i start to run my project the debugger says “ViewportTexture: Path to node is invalid” and my plane stays flat. However assigning a ViewportTexture of the same Viewport to a TextureFrame works fine. Can anyone tell me what is going on?

:bust_in_silhouette: Reply From: eons

Check if setting viewport update mode to always fixes it.

it didn’t help unfortunately

Freya | 2018-08-26 05:38

:bust_in_silhouette: Reply From: Svampen

I had the same issue and turns out it’s an open issue on github
If i recall correctly i managed to work around it by first assigning the viewport texture to a Sprite2D or something similar.

I hope it get’s fixed soon. Thanks anyway!

Freya | 2018-08-27 16:26