diff --git a/data/shaders/IBL.frag b/data/shaders/IBL.frag index 468af4541..b7be2db54 100644 --- a/data/shaders/IBL.frag +++ b/data/shaders/IBL.frag @@ -142,6 +142,9 @@ void main(void) int x = int(gl_FragCoord.x), y = int(gl_FragCoord.y); vec3 FragPos = getXcYcZc(x, y, lineardepth); + // Fallback + vec3 fallback = .25 * SpecularIBL(normal, eyedir, specval); + // Better implementation: ::::::::::::::::::::::::::::::::::: float View_Depth = makeLinear(1000.0, 0.001, lineardepth); @@ -161,8 +164,7 @@ void main(void) vec3 hitPos = View_Pos.xyz; float dDepth; float minRayStep = 100.0f; - // Fallback - vec3 fallback = .25 * SpecularIBL(normal, eyedir, specval); + vec3 outColor = RayCast(reflected * max(minRayStep, -View_Pos.z), hitPos, dDepth, dtex, fallback, 0.001); vec3 outColor2 = RayCast(reflected2 * max(minRayStep, -View_Pos.z), hitPos, dDepth, dtex, fallback, 0.001); outColor = mix(outColor, outColor2, 1.0 - specval); diff --git a/data/shaders/combine_diffuse_color.frag b/data/shaders/combine_diffuse_color.frag index 9aa4865b4..a870b16be 100644 --- a/data/shaders/combine_diffuse_color.frag +++ b/data/shaders/combine_diffuse_color.frag @@ -28,7 +28,7 @@ void main() vec3 SpecularComponent = texture(specular_map, tc).xyz; vec3 diffuse_color_for_mix = diffuseMatColor.xyz * 4.0; - vec3 metallicMatColor = mix(vec3(0.2), diffuse_color_for_mix, metallicMapValue); + vec3 metallicMatColor = mix(vec3(0.5), diffuse_color_for_mix, metallicMapValue); vec3 tmp = DiffuseComponent * mix(diffuseMatColor.xyz, vec3(0.0), metallicMapValue) + (metallicMatColor * SpecularComponent); vec3 emitCol = diffuseMatColor.xyz + (diffuseMatColor.xyz * diffuseMatColor.xyz * emitMapValue * emitMapValue * 10.0); diff --git a/data/shaders/sp_solid.frag b/data/shaders/sp_solid.frag index e8d74a38d..b57f7e2c8 100644 --- a/data/shaders/sp_solid.frag +++ b/data/shaders/sp_solid.frag @@ -39,7 +39,7 @@ void main(void) o_normal_color.xy = 0.5 * EncodeNormal(normalize(normal)) + 0.5; o_normal_color.zw = layer_2.xy; - //o_normal_color.z = 0; + o_normal_color.z = 0.5; #else o_diffuse_color = vec4(final_color, 1.0); #endif