void main() { vec2 uv = (gl_FragCoord.xy / u_resolution) * 2.0 - 1.0; float aspect = u_resolution.x / u_resolution.y; uv.x *= aspect; mat3 view3 = mat3(u_view); vec3 forward = -vec3(u_view[0][2], u_view[1][2], u_view[2][2]); vec3 right = vec3(u_view[0][0], u_view[1][0], u_view[2][0]); vec3 up = vec3(u_view[0][1], u_view[1][1], u_view[2][1]); float fovy = 2.0 * atan(1.0 / u_proj[1][1]); float fovScale = tan(fovy * 0.5); vec3 n = normalize(forward + right * uv.x * fovScale + up * uv.y * fovScale); vec3 sky = textureLod(t_sky, n, u_roughness * 8.0).rgb * u_strength; out_color0 = vec4(sky, 1.0); }