-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewport data not being sent to shader parameter in runtime #16006
Comments
Of note, when also using the same texture to a sprite the correct texture gets send to the shader. I'm guessing the shader handling code doesn't correctly tell the texture to update itself. |
Not that it was on the agenda, just thought I'd mention that the bug exists in 3.0 stable too. |
Not sure if this is related, but when I try to set an image texture to a new ViewportTexture via gdScript (changing the viewport_texture property too of course) it shows nothing when I run it. I know the viewport works fine, and oddly enough when I make the sprite through the editor, set it to the viewport, clear the path and set the path through gdScript it shows fine too. Problem seems to be initiating a new ViewportTexture through code. Should this be a new ticket? |
My tests have been completely in 2D, should that make any difference in diagnosis |
Related to #7998. |
Related to #17651 |
Confirming this issue exists in 3D as well. My scene structure is:
As described, the label node text appears on the texture in the editor, but when a scene containing the node is run the texture is black without the label text |
This is not a bug (Material was not set as local to scene), but usability was pretty bad to let you know what was going on. |
Godot version:
3.0 RC2
OS/device including version:
Windows 10
AMD Radeon HD 7700 Series
Driver version: Adrenalin (17.12.1)
Issue description:
Viewports aren't properly sending their output to shaders (at least in 2D, haven't tested for 3D). While it appears to work fine in-editor, when the scene is ran the output is all black.
Steps to reproduce:
First I created an empty scene, root type node2D. I made a viewport, set it up, and added an image under it, setting the texture to a png. I then made a new sprite outside that viewport and set the texture to the viewport output to test if it was outputting fine. I ran the scene and all seemed to work, I saw the circle image.
I then replaced the texture of the output image with a blank png (Color(1, 1 ,1 ,1)) the size of the screen, and created a new shader, using this code:
Then I set the parameter
mask
to the viewport output, and I saw the results immediately in the editor, however when I run the scene the output is all black. I also tried sending the viewport data through gdScript usingget_texture
, and it too led to the black screen output.Minimal reproduction project:
Test project attached. I created two output sprites for it, one direct from the viewport, one with the shader. With this bug any shader needing more than a single viewport won't work.
Viewport Bug.zip
The text was updated successfully, but these errors were encountered: