Skip to content

Commit

Permalink
Fix composite1.fsh breaking on AMD
Browse files Browse the repository at this point in the history
  • Loading branch information
X0nk committed Jul 14, 2023
1 parent 3ee5e1e commit dc2028a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions shaders/composite1.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ void main() {


bool ShadowBounds = false;
if(shadowDistanceRenderMul > 0.0) ShadowBounds = length(p3_shadow) < max(shadowDistance,0);
if(shadowDistanceRenderMul > 0.0) ShadowBounds = length(p3_shadow) < shadowDistance;

if(shadowDistanceRenderMul < 0.0) ShadowBounds = abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.z) < 6.0;

Expand Down Expand Up @@ -957,7 +957,7 @@ void main() {

bool outsideShadowMap = shadowmapindicator < 1;

if(outsideShadowMap && !iswater) Shadows = min(max(lightmap.y-0.8, 0) * 25,1);
if(outsideShadowMap && !iswater) Shadows = min(max(lightmap.y-0.8, 0.0) * 25,1.0);



Expand Down Expand Up @@ -991,10 +991,13 @@ void main() {
bool dodistantSSS = outsideShadowMap && LabSSS > 0.0;
float screenShadow = rayTraceShadow(lightCol.a*sunVec, fragpos_rtshadow, interleaved_gradientNoise(), dodistantSSS);
screenShadow *= screenShadow;

Shadows = min(screenShadow, Shadows);

if (outsideShadowMap) SSS *= Shadows;

#else

if (outsideShadowMap) SSS = vec3(0.0);
#endif
}
Expand Down

0 comments on commit dc2028a

Please sign in to comment.