You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than using a sample range (0 to 1 in both x and y directions) such as for uv, screen_uv uses the visual position of the node in the editor. This has no effect on the shader in-game, but makes it more difficult to make a shader as this forces you to swap between uv while building a shader and screen_uv while testing it ingame.
Steps to reproduce
Create new VisualShader.
Add a new input, set the type to be screen_uv, enable preview.
Drag the node around and observe that it changes colour.
Drag it to the top left and it starts going dark, drag it to the right to make it red, drag it to the bottom right to make it yellow and finally drag it to the bottom left to make it green.
Minimal reproduction project
Reproduction is trivial, visual of bug has been provided.
The text was updated successfully, but these errors were encountered:
The current behaviour is strange though, I think it's ok to align the behaviour with uv.
cc @Chaosus Is it a good practice to hack some logic in VisualShaderNodeInput::generate_code when generating preview code? Tested locally it worked, can make a pr if it's ok to you.
Is it a good practice to hack some logic in VisualShaderNodeInput::generate_code when generating preview code? Tested locally it worked, can make a pr if it's ok to you.
Yes, why not? If it's lead to better results... It's not a critical part of the engine, after all.
Godot version
v4.1.2.stable.mono.official [399c9dc], v4.2.beta4.mono.official [93cdacb]
System information
Godot v4.2.beta4.mono - Windows 10.0.22621 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 31.0.15.3713) - AMD Ryzen 5 5600H with Radeon Graphics (12 Threads)
Issue description
Use the output section as positional reference:
Rather than using a sample range (0 to 1 in both x and y directions) such as for uv, screen_uv uses the visual position of the node in the editor. This has no effect on the shader in-game, but makes it more difficult to make a shader as this forces you to swap between uv while building a shader and screen_uv while testing it ingame.
Steps to reproduce
Drag it to the top left and it starts going dark, drag it to the right to make it red, drag it to the bottom right to make it yellow and finally drag it to the bottom left to make it green.
Minimal reproduction project
Reproduction is trivial, visual of bug has been provided.
The text was updated successfully, but these errors were encountered: