Skip to content

Commit

Permalink
transparency fix
Browse files Browse the repository at this point in the history
  • Loading branch information
null511 committed Oct 23, 2022
1 parent ac2580c commit d9634e0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion shaders/info/buffers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ shadowcolor1 RG32UI 1.0 R: rsm-color; G: normal-XYZ, sss*
colortex2 RGBA32 1.0 deferred= R: color; G: normal; B: specular; A: lighting
colortex3 R16F 1.0 AO
colortex4 RGB16F 1.0 pre-exposed HDR scene
colortex5 RGBA16F 0.25 HDR previous frame = RGB: pre-exposed HDR, A: Log Luminance
colortex5 RGBA16F 0.25 HDR previous frame [RGB: pre-exposed HDR, A: Log Luminance]
colortex6 R16F 0.25 Log Luminance

colortex7 RGB16F 1.0 HDR transparent / VL / bloom tiles
Expand Down
9 changes: 5 additions & 4 deletions shaders/lib/lighting/pbr.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
sssDist = max(sssDist, contactLightDist);

float maxDist = SSS_MAXDIST * material.scattering;
float contactSSS = material.scattering * max(1.0 - sssDist / maxDist, 0.0);
float contactSSS = 0.7 * pow2(material.scattering) * max(1.0 - contactLightDist / maxDist, 0.0);
shadowSSS = mix(shadowSSS, contactSSS, contactShadowMix);
//shadowSSS *= mix(1.0, contactShadow, saturate(contactLightDist / (SSS_MAXDIST * material.scattering)));
#endif
Expand Down Expand Up @@ -301,7 +301,8 @@
iblSpec *= (1.0 - roughL) * reflectColor * occlusion;

float iblFmax = max(max(iblF.x, iblF.y), iblF.z);
final.a += iblFmax * max(1.0 - final.a, 0.0);
//final.a += iblFmax * max(1.0 - final.a, 0.0);
final.a = min(final.a + iblFmax * exposure * final.a, 1.0);
}
#endif

Expand Down Expand Up @@ -360,7 +361,7 @@
if (NoLm > EPSILON) {
float NoHm = max(dot(viewNormal, halfDir), 0.0);

vec3 sunSpec = GetSpecularBRDF(sunF, NoVm, NoLm, NoHm, roughL) * skyLightColorFinal * skyLight2 * shadowFinal;
vec3 sunSpec = GetSpecularBRDF(sunF, NoVm, NoLm, NoHm, roughL) * skyLightColorFinal * skyLight2 * shadowFinal * final.a;

specular += sunSpec;// * material.albedo.a;

Expand Down Expand Up @@ -565,7 +566,7 @@
fogFactor = ApplyFog(final.rgb, viewPos, lightData);
#elif defined RENDER_GBUFFER
#if defined RENDER_WATER || defined RENDER_HAND_WATER
fogFactor = ApplyFog(final, viewPos, lightData, EPSILON);
fogFactor = ApplyFog(final, viewPos, lightData, 1.0/255.0);
#else
fogFactor = ApplyFog(final, viewPos, lightData, alphaTestRef);
#endif
Expand Down
6 changes: 3 additions & 3 deletions shaders/lib/material/default.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void ApplyHardCodedMaterials() {

if (mc_Entity.x == 100.0 || mc_Entity.x == 101.0) {
// Water
matSmooth = 0.96;
matSmooth = 0.98;
matF0 = 0.02;
}
else if (mc_Entity.x == 102.0) {
Expand All @@ -16,7 +16,7 @@ void ApplyHardCodedMaterials() {
else if (mc_Entity.x >= 10001.0 && mc_Entity.x <= 10004.0) {
// Foliage
matSmooth = 0.08;
matSSS = 0.85;
matSSS = 0.7;
matF0 = 0.03;
}
else if (mc_Entity.x >= 11000.0 && mc_Entity.x < 11010) {
Expand All @@ -43,7 +43,7 @@ void ApplyHardCodedMaterials() {
// Snow
matSmooth = 0.4;
matF0 = 0.02;
matSSS = 0.5;
matSSS = 0.6;
}
else if (mc_Entity.x == 11011) {
// Slime
Expand Down
2 changes: 1 addition & 1 deletion shaders/program/composite5.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ out vec2 texcoord;

blockLightBrightness = pow3(blockLightBrightness) * BlockLightLux;

return 4.0 + 0.05 * max(blockLightBrightness, skyLightBrightness);
return 0.04 * (MinWorldLux + max(blockLightBrightness, skyLightBrightness));
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion shaders/shaders.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ profile.POTATO=CAMERA_EXPOSURE_MODE:1 ATMOSPHERE_TYPE:0 REFLECTION_MODE:1 SSR_QU
AO_ENABLED !SSAO_ENABLED !SSS_SCATTER SSS_PCF_SAMPLES:12 !PARALLAX_ENABLED !BLOOM_ENABLED !BLOOM_SMOOTH \
!VL_ENABLED VL_SAMPLE_COUNT:15 VL_DITHER !VL_PARTICLES

profile.LOW=CAMERA_EXPOSURE_MODE:1 ATMOSPHERE_TYPE:0 REFLECTION_MODE:2 SSR_QUALITY:0 WATER_FANCY WATER_REFRACTION:0 \
profile.LOW=CAMERA_EXPOSURE_MODE:1 ATMOSPHERE_TYPE:0 REFLECTION_MODE:2 SSR_QUALITY:0 WATER_FANCY WATER_REFRACTION:1 \
SHADOW_TYPE:2 SHADOW_FILTER:0 shadowMapResolution:2048 shadowDistance:50 !SHADOW_EXCLUDE_ENTITIES !SHADOW_EXCLUDE_FOLIAGE SHADOW_PCF_SAMPLES:12 \
!RSM_ENABLED RSM_SCALE:2 RSM_SAMPLE_COUNT:35 RSM_FILTER_SIZE:0.8 RSM_INTENSITY:4 RSM_UPSCALE \
AO_ENABLED !SSAO_ENABLED !SSS_SCATTER SSS_PCF_SAMPLES:12 PARALLAX_ENABLED BLOOM_ENABLED !BLOOM_SMOOTH \
Expand Down

0 comments on commit d9634e0

Please sign in to comment.