Skip to content
Snippets Groups Projects
Commit ef98be88 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Use an SRGB buffer for initial reflection map capture for proper linear sampling

Fix irradiance gen up vector to be properly normalized
parent d2d257cf
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ void main()
vec3 N = normalize(vary_dir);
vec3 up = vec3(0.0, 1.0, 0.0);
vec3 right = normalize(cross(up, N));
up = cross(N, right);
up = normalize(cross(N, right));
const float TWO_PI = PI * 2.0;
const float HALF_PI = PI * 0.5;
......
......@@ -335,7 +335,6 @@ void main()
#if PBR_USE_IRRADIANCE_HACK
irradiance = max(amblit,irradiance) * ambocc;
#endif
specLight = srgb_to_linear(specLight);
#if DEBUG_PBR_SPECLIGHT051
specLight = vec3(0,0.5,1.0);
irradiance = specLight;
......@@ -670,6 +669,9 @@ else
diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14035
sampleReflectionProbes(ambenv, glossenv, legacyenv, pos.xyz, norm.xyz, spec.a, envIntensity);
ambenv.rgb = linear_to_srgb(ambenv.rgb);
glossenv.rgb = linear_to_srgb(glossenv.rgb);
legacyenv.rgb = linear_to_srgb(legacyenv.rgb);
amblit = max(ambenv, amblit);
color.rgb = amblit*ambocc;
......
......@@ -80,7 +80,7 @@ void LLReflectionMapManager::update()
if (!mRenderTarget.isComplete())
{
U32 color_fmt = GL_RGBA;
U32 color_fmt = GL_SRGB8_ALPHA8;
const bool use_depth_buffer = true;
const bool use_stencil_buffer = true;
U32 targetRes = LL_REFLECTION_PROBE_RESOLUTION * 2; // super sample
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment