fix: prefer skysphere over skyenv

main
Dominik Madarász 2024-04-23 11:22:04 +02:00
parent 98bdd7136a
commit 46e2769572
1 changed files with 3 additions and 3 deletions

View File

@ -282,15 +282,15 @@ vec3 sample_irradiance_slow( vec3 normal, vec3 vertex_tangent )
vec3 sample_irradiance_fast( vec3 normal, vec3 vertex_tangent ) vec3 sample_irradiance_fast( vec3 normal, vec3 vertex_tangent )
{ {
// Sample the irradiance map if it exists, otherwise fall back to blurred reflection map. // Sample the irradiance map if it exists, otherwise fall back to blurred reflection map.
if ( has_tex_skyenv ) if ( has_tex_skysphere )
{ {
vec2 polar = sphere_to_polar( normal ); vec2 polar = sphere_to_polar( normal );
return pow(textureLod( tex_skyenv, polar, 0.0 ), vec4(1.0/2.2)).rgb * exposure; return pow(textureLod( tex_skysphere, polar, 0.80 * skysphere_mip_count ), vec4(1.0/2.2)).rgb * exposure;
} }
else else
{ {
vec2 polar = sphere_to_polar( normal ); vec2 polar = sphere_to_polar( normal );
return pow(textureLod( tex_skysphere, polar, 0.80 * skysphere_mip_count ), vec4(1.0/2.2)).rgb * exposure; return pow(textureLod( tex_skyenv, polar, 0.0 ), vec4(1.0/2.2)).rgb * exposure;
} }
} }