Hey guys. I am new to godot and shaders and textures but I want to try out new things. As a first project I wanted to write a game that has a starfield in the background. For the starfield I found a great tutorial using shader and noise texture. The shader itself works fine and looks ok for the first version of the game. A starfield should have movement in it so I tried to set a speed variable in the shader from the scene that holds the starfield, what works more or less. The starship is controlled via cursor keys. Hitting the up key increases the speed, hitting the down key decreases the speed. This should reflect in the shader.
Now the issue: If I hit the respective keys, the shader starts to go crazy and seems to “race” imensely fast. If I release the key, the speed is set to the expected speed and the “animation” looks as I expect it to.
Perhaps someone has time to check whats going wrong? That would be awesome. The shader is in the background scene. The code to connect the ship and the background is in game.
Indeed, I saw your video the last night and wanted to try out directly. Unfortunately my addition didn’t work as intended and my debugging-skills with godot are not very good yet.
I tested the project and seems to be an issue with the shader, i recommend you use the shader at speed zero and use a Parallax2D node to make the movement (this needs Godot 4.4 dev 3 or higher to work):
Strange, the first one i understand you can’t see because is in h265, but the second is in h264. Anyways, if you dont see now is totally your pc fault: https://youtu.be/yHUx_geCqKI