Godot Version
4.3
Question
I’m creating a raymarcher (pretty similar to a raytracer)
Until now, I was rendering everything on a big plane at the center of the scene
To determine the direction towards which to shoot the ray, I used this code:
normalize(VERTEX-CAMERA_POSITION_WORLD)
and everything worked perfectly
To make the plane “follow” the camera, I’m currently using this code
void vertex() {
POSITION = vec4(VERTEX.xy, 1.0, 1.0);
}
to make the object fully cover the screen
But now in the fragment shader the values I get from VERTEX are totally wrong and the rest of the shader is totally broken
Does anybody know how to solve this problem?
Thanks in advance