mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
Merge pull request #10014 from samcake/blue
Fixing the roughness/reflection quantization bug
This commit is contained in:
commit
a1bf1beab4
4 changed files with 6 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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@>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
//
|
||||
|
||||
<@include DeferredBufferRead.slh@>
|
||||
<@include gpu/Color.slh@>
|
||||
<$declareColorWheel()$>
|
||||
|
||||
uniform sampler2D linearDepthMap;
|
||||
uniform sampler2D halfLinearDepthMap;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue