mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:37:35 +02:00
Fixing the roughness/reflection quantization bug
This commit is contained in:
parent
e5326d146e
commit
e87bc91d0e
4 changed files with 6 additions and 3 deletions
|
@ -76,6 +76,7 @@ static const std::string DEFAULT_ROUGHNESS_SHADER {
|
||||||
"vec4 getFragmentColor() {"
|
"vec4 getFragmentColor() {"
|
||||||
" DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"
|
" DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"
|
||||||
" return vec4(vec3(pow(frag.roughness, 1.0 / 2.2)), 1.0);"
|
" 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 {
|
static const std::string DEFAULT_NORMAL_SHADER {
|
||||||
|
|
|
@ -39,7 +39,7 @@ vec3 evalAmbientSpecularIrradiance(LightAmbient ambient, vec3 fragEyeDir, vec3 f
|
||||||
<@if supportAmbientMap@>
|
<@if supportAmbientMap@>
|
||||||
{
|
{
|
||||||
float levels = getLightAmbientMapNumMips(ambient);
|
float levels = getLightAmbientMapNumMips(ambient);
|
||||||
float lod = min(floor((roughness)* levels), levels);
|
float lod = min(((roughness)* levels), levels);
|
||||||
specularLight = evalSkyboxLight(direction, lod).xyz;
|
specularLight = evalSkyboxLight(direction, lod).xyz;
|
||||||
}
|
}
|
||||||
<@endif@>
|
<@endif@>
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
<@include DeferredBufferRead.slh@>
|
<@include DeferredBufferRead.slh@>
|
||||||
|
<@include gpu/Color.slh@>
|
||||||
|
<$declareColorWheel()$>
|
||||||
|
|
||||||
uniform sampler2D linearDepthMap;
|
uniform sampler2D linearDepthMap;
|
||||||
uniform sampler2D halfLinearDepthMap;
|
uniform sampler2D halfLinearDepthMap;
|
||||||
|
|
|
@ -24,8 +24,8 @@ void main(void) {
|
||||||
// Gather 2 by 2 quads from texture
|
// Gather 2 by 2 quads from texture
|
||||||
|
|
||||||
// Try different filters for Z
|
// Try different filters for Z
|
||||||
// vec4 Zeyes = textureGather(linearDepthMap, varTexCoord0, 0);
|
//vec4 Zeyes = textureGather(linearDepthMap, varTexCoord0, 0);
|
||||||
// float Zeye = min(min(Zeyes.x, Zeyes.y), min(Zeyes.z, Zeyes.w));
|
//float Zeye = min(min(Zeyes.x, Zeyes.y), min(Zeyes.z, Zeyes.w));
|
||||||
float Zeye = texture(linearDepthMap, varTexCoord0).x;
|
float Zeye = texture(linearDepthMap, varTexCoord0).x;
|
||||||
|
|
||||||
vec4 rawNormalsX = textureGather(normalMap, varTexCoord0, 0);
|
vec4 rawNormalsX = textureGather(normalMap, varTexCoord0, 0);
|
||||||
|
|
Loading…
Reference in a new issue