make roughness threshold harder to see

This commit is contained in:
Xonk 2023-06-22 16:47:25 -04:00
parent 4d1673a54c
commit f40c20f3c8
3 changed files with 10 additions and 11 deletions

View File

@ -272,6 +272,7 @@ void main() {
float Puddle_shape = 0.; float Puddle_shape = 0.;
#ifndef ENTITIES #ifndef ENTITIES
#ifndef HAND
#ifdef WORLD #ifdef WORLD
#ifdef Puddles #ifdef Puddles
Puddle_shape = (1.0 - clamp(exp(-15 * pow(texture2D(noisetex, worldpos.xz * (0.015 * Puddle_Size) ).b ,5)),0,1)) * lightmap ; Puddle_shape = (1.0 - clamp(exp(-15 * pow(texture2D(noisetex, worldpos.xz * (0.015 * Puddle_Size) ).b ,5)),0,1)) * lightmap ;
@ -280,6 +281,7 @@ void main() {
#endif #endif
#endif #endif
#endif #endif
#endif
#ifdef POM #ifdef POM
@ -492,7 +494,7 @@ void main() {
vec4 SpecularTex = texture2D(specular, lmtexcoord.xy, bias); vec4 SpecularTex = texture2D(specular, lmtexcoord.xy, bias);
SpecularTex.r = max(SpecularTex.r, Puddle_shape); SpecularTex.r = max(SpecularTex.r, Puddle_shape);
SpecularTex.g = max(SpecularTex.g, Puddle_shape*0.04); SpecularTex.g = max(SpecularTex.g, Puddle_shape*0.02);
// #ifdef ENTITIES // #ifdef ENTITIES
// if(NameTags == 1) SpecularTex = vec4(0.0); // if(NameTags == 1) SpecularTex = vec4(0.0);

View File

@ -271,17 +271,14 @@ void MaterialReflections(
vec3 F = mix_vec3(f0, vec3(1.0), fresnel); vec3 F = mix_vec3(f0, vec3(1.0), fresnel);
vec3 rayContrib = F; vec3 rayContrib = F;
float VisibilityFactor = rayContrib.x * pow(1.0-roughness,3.0); float rayContribLuma = luma(rayContrib);
float VisibilityFactor = rayContribLuma * pow(1.0-roughness,3.0);
bool hasReflections = Roughness_Threshold == 1.0 ? true : (f0.y * (1.0 - roughness * Roughness_Threshold)) > 0.01; bool hasReflections = Roughness_Threshold == 1.0 ? true : (f0.y * (1.0 - roughness * Roughness_Threshold)) > 0.01;
float hasReflections2 = max(1.0 - roughness*1.75,0.0);
// // if (!hasReflections) Outdoors = 0.0;
// SunReflection = directlighting * SunGGX(normal, -np3, sunPos, roughness, f0.y) / 5.0;
SunReflection = directlighting * GGX(normal, -np3, sunPos, roughness, vec3(f0.y)); SunReflection = directlighting * GGX(normal, -np3, sunPos, roughness, vec3(f0.y));
//
if (hasReflections) { // Skip sky reflection and SSR if its just not very visible anyway if (hasReflections) { // Skip sky reflection and SSR if its just not very visible anyway
#ifdef Sky_reflection #ifdef Sky_reflection
SkyReflection = ( skyCloudsFromTex(L, colortex4).rgb / 150. ) * 5.; SkyReflection = ( skyCloudsFromTex(L, colortex4).rgb / 150. ) * 5.;
@ -289,7 +286,7 @@ void MaterialReflections(
#ifdef Screen_Space_Reflections #ifdef Screen_Space_Reflections
float rayQuality = mix_float(reflection_quality,6.0,luma(rayContrib)); // Scale quality with ray contribution float rayQuality = mix_float(reflection_quality,6.0,rayContribLuma); // Scale quality with ray contribution
@ -331,7 +328,7 @@ void MaterialReflections(
// put reflections onto the scene // put reflections onto the scene
#ifdef Rough_reflections #ifdef Rough_reflections
Output = hand ? mix_vec3(Output, Reflections.rgb, VisibilityFactor) : mix_vec3(Output, Reflections.rgb, luma(rayContrib)); Output = hand ? mix_vec3(Output, Reflections.rgb, VisibilityFactor) : mix_vec3(Output, Reflections.rgb, rayContribLuma * (1.0 - roughness * Roughness_Threshold));
#else #else
Output = mix_vec3(Output, Reflections.rgb, VisibilityFactor); Output = mix_vec3(Output, Reflections.rgb, VisibilityFactor);
#endif #endif

View File

@ -136,7 +136,7 @@ vec4 getVolumetricRays(
vec3 AtmosphericFog = skyCol0 * (rL+m) ; vec3 AtmosphericFog = skyCol0 * (rL+m) ;
// extra fog effects // extra fog effects
vec3 rainRays = (sunColor*sh) * (rayL*phaseg(SdotV,0.5)) * clamp(pow(WsunVec.y,5)*2,0.0,1) * rainStrength * noPuddleAreas * RainFog_amount; vec3 rainRays = (sunColor*sh) * (rayL*phaseg(SdotV,0.5)) * clamp(pow(WsunVec.y,5)*2,0.0,1) * rainStrength * noPuddleAreas * RainFog_amount * 0.5;
vec3 CaveRays = (sunColor*sh) * phaseg(SdotV,0.7) * 0.001 * (1.0 - max(eyeBrightnessSmooth.y,0)/240.); vec3 CaveRays = (sunColor*sh) * phaseg(SdotV,0.7) * 0.001 * (1.0 - max(eyeBrightnessSmooth.y,0)/240.);
vec3 vL0 = (DirectLight + AmbientLight + AtmosphericFog + rainRays ) * max(eyeBrightnessSmooth.y,0)/240. ; vec3 vL0 = (DirectLight + AmbientLight + AtmosphericFog + rainRays ) * max(eyeBrightnessSmooth.y,0)/240. ;