+ | FPS ~ | Single triangle shader

This commit is contained in:
TheRedShip
2024-10-15 01:10:57 +02:00
parent 9d7a30800e
commit 1c25a29c38
4 changed files with 27 additions and 9 deletions

View File

@ -51,7 +51,8 @@ void main()
vec2 uv;
vec4 color;
uv = gl_FragCoord.xy / u_resolution.xy * 2.0 - 1.0;
uv = gl_FragCoord.xy / u_resolution.xy;
uv = uv * 2.0 - 1.0;
uv.x *= u_resolution.x / u_resolution.y;
vec3 rayOrigin = vec3(0.0, 0.0, 0.0);
@ -70,6 +71,6 @@ void main()
vec3 color = computeLighting(hitPoint, normal, viewDir);
FragColor = vec4(color, 1.0);
} else {
FragColor = vec4(0.0, 0.0, 0.0, 1.0);
FragColor = vec4(0., 0.0, 0.0, 1.0);
}
}