Merge pull request #10014 from samcake/blue

Fixing the roughness/reflection quantization bug
This commit is contained in:
samcake 2017-03-28 14:50:24 -07:00 committed by GitHub
commit a1bf1beab4
4 changed files with 6 additions and 3 deletions

View file

@ -76,6 +76,7 @@ static const std::string DEFAULT_ROUGHNESS_SHADER {
"vec4 getFragmentColor() {"
" DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"
" return vec4(vec3(pow(frag.roughness, 1.0 / 2.2)), 1.0);"
// " return vec4(vec3(pow(colorRamp(frag.roughness), vec3(1.0 / 2.2))), 1.0);"
" }"
};
static const std::string DEFAULT_NORMAL_SHADER {

View file

@ -39,7 +39,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 f
<@if supportAmbientMap@>
{
float levels = getLightAmbientMapNumMips(ambient);
float lod = min(floor((roughness)* levels), levels);
float lod = min(((roughness)* levels), levels);
specularLight = evalSkyboxLight(direction, lod).xyz;
}
<@endif@>

View file

@ -13,6 +13,8 @@
//
<@include DeferredBufferRead.slh@>
<@include gpu/Color.slh@>
<$declareColorWheel()$>
uniform sampler2D linearDepthMap;
uniform sampler2D halfLinearDepthMap;

View file

@ -24,8 +24,8 @@ void main(void) {
// Gather 2 by 2 quads from texture
// Try different filters for Z
// vec4 Zeyes = textureGather(linearDepthMap, varTexCoord0, 0);
// float Zeye = min(min(Zeyes.x, Zeyes.y), min(Zeyes.z, Zeyes.w));
//vec4 Zeyes = textureGather(linearDepthMap, varTexCoord0, 0);
//float Zeye = min(min(Zeyes.x, Zeyes.y), min(Zeyes.z, Zeyes.w));
float Zeye = texture(linearDepthMap, varTexCoord0).x;
vec4 rawNormalsX = textureGather(normalMap, varTexCoord0, 0);