diff options
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/sky.glsl')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/sky.glsl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/servers/rendering/renderer_rd/shaders/sky.glsl b/servers/rendering/renderer_rd/shaders/sky.glsl index b258e89c66..d63444456a 100644 --- a/servers/rendering/renderer_rd/shaders/sky.glsl +++ b/servers/rendering/renderer_rd/shaders/sky.glsl @@ -199,14 +199,15 @@ void main() { vec4 quarter_res_color = vec4(1.0); vec4 custom_fog = vec4(0.0); + vec3 eyedir = cube_normal; + eyedir.z *= -1.0; + #ifdef USE_CUBEMAP_PASS - vec3 inverted_cube_normal = cube_normal; - inverted_cube_normal.z *= -1.0; #ifdef USES_HALF_RES_COLOR - half_res_color = texture(samplerCube(half_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), inverted_cube_normal) * params.luminance_multiplier; + half_res_color = texture(samplerCube(half_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), eyedir) * params.luminance_multiplier; #endif #ifdef USES_QUARTER_RES_COLOR - quarter_res_color = texture(samplerCube(quarter_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), inverted_cube_normal) * params.luminance_multiplier; + quarter_res_color = texture(samplerCube(quarter_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), eyedir) * params.luminance_multiplier; #endif #else #ifdef USES_HALF_RES_COLOR |