mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #884 from Azaezel/alpha41/probeSaveSpace
shift the probe file colorspace to gamma
This commit is contained in:
commit
bd94ec6886
|
|
@ -56,5 +56,5 @@ void main()
|
|||
}
|
||||
irradiance = M_PI_F * irradiance * (1.0 / float(nrSamples));
|
||||
|
||||
OUT_col = vec4(irradiance, 1.0);
|
||||
OUT_col = vec4(toGamma(irradiance), 1.0);
|
||||
}
|
||||
|
|
@ -84,13 +84,13 @@ vec3 ImportanceSampleGGX(vec2 Xi, vec3 N)
|
|||
return normalize(sampleVec);
|
||||
}
|
||||
|
||||
vec4 prefilterEnvMap(vec3 R)
|
||||
vec3 prefilterEnvMap(vec3 R)
|
||||
{
|
||||
int sampleCount = resolution*2;
|
||||
vec3 N = R;
|
||||
vec3 V = R;
|
||||
float totalWeight = 0.0;
|
||||
vec4 prefilteredColor = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec3 prefilteredColor = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
for (int i = 0; i < sampleCount; ++i)
|
||||
{
|
||||
|
|
@ -112,7 +112,7 @@ vec4 prefilterEnvMap(vec3 R)
|
|||
|
||||
float mipLevel = roughness == 0.0 ? 0.0 : 0.5 * log2(saSample / saTexel);
|
||||
|
||||
prefilteredColor += texture(environmentMap, L, mipLevel) * NdotL;
|
||||
prefilteredColor += texture(environmentMap, L, mipLevel).rgb * NdotL;
|
||||
|
||||
totalWeight += NdotL;
|
||||
}
|
||||
|
|
@ -126,6 +126,5 @@ out vec4 OUT_col;
|
|||
void main()
|
||||
{
|
||||
vec3 N = getCubeDir(face, uv0);
|
||||
OUT_col = prefilterEnvMap(N);
|
||||
OUT_col.a = 1;
|
||||
OUT_col = vec4(toGamma(prefilterEnvMap(N)),1);
|
||||
}
|
||||
|
|
@ -59,5 +59,5 @@ float4 main(ConnectData IN) : TORQUE_TARGET0
|
|||
}
|
||||
irradiance = M_PI_F * irradiance * (1.0 / float(nrSamples));
|
||||
|
||||
return float4(irradiance, 1.0);
|
||||
return float4(toGamma(irradiance), 1.0);
|
||||
}
|
||||
|
|
@ -126,5 +126,5 @@ float4 prefilterEnvMap(float3 R)
|
|||
float4 main(ConnectData IN) : TORQUE_TARGET0
|
||||
{
|
||||
float3 N = getCubeDir(face, IN.uv);
|
||||
return float4(prefilterEnvMap(N).rgb,1.0);
|
||||
return float4(toGamma(prefilterEnvMap(N).rgb),1.0);
|
||||
}
|
||||
Loading…
Reference in a new issue