spheremap orientation fix, static sky exposure

This commit is contained in:
Turánszki János
2023-08-25 08:40:47 +02:00
parent c6c145f1f9
commit 19280fc45e
2 changed files with 13 additions and 4 deletions
+12 -3
View File
@@ -161,12 +161,21 @@ float3 GetStaticSkyColor(in float3 V)
);
V.xz = mul(V.xz, rot);
float3 sky = 0;
if (GetFrame().options & OPTION_BIT_STATIC_SKY_SPHEREMAP)
{
float2 uv = (float2(atan2(V.z, V.x) / PI, -V.y) + 1.0) * 0.5;
return bindless_textures[GetScene().globalenvmap].SampleLevel(sampler_linear_clamp, uv, 0).rgb;
float2 uv = (float2(-atan2(V.z, V.x) / PI, -V.y) + 1.0) * 0.5;
sky = bindless_textures[GetScene().globalenvmap].SampleLevel(sampler_linear_clamp, uv, 0).rgb;
}
return bindless_cubemaps[GetScene().globalenvmap].SampleLevel(sampler_linear_clamp, V, 0).rgb;
else
{
sky = bindless_cubemaps[GetScene().globalenvmap].SampleLevel(sampler_linear_clamp, V, 0).rgb;
}
sky *= GetWeather().sky_exposure;
return sky;
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 277;
const int revision = 278;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);