indirect light glow from internal cloud light from end lightning

This commit is contained in:
Xonk 2023-12-22 16:19:44 -05:00
parent 5b7fa2ce52
commit 3983939d2a
4 changed files with 14 additions and 20 deletions

View File

@ -121,6 +121,7 @@ void main() {
#ifndef BLOOMY_PARTICLES
gl_FragData[1].a = 0.0; // for bloomy rain and stuff
#endif
vec3 Direct_lighting = vec3(0.0);
vec3 Indirect_lighting = vec3(0.0);
vec3 Torch_Color = vec3(TORCH_R,TORCH_G,TORCH_B);

View File

@ -443,17 +443,6 @@ void SSRT_Shadows(vec3 viewPos, vec3 lightDir, float noise, bool isSSS, bool ins
}
}
#ifdef END_SHADER
float GetShading(vec3 WorldPos, vec3 LightPos, vec3 Normal){
float NdotL = clamp(dot(Normal, normalize(-LightPos))*0.5+0.5,0.0,1.0);
NdotL *= NdotL;
float FogShadow = GetCloudShadow(WorldPos, LightPos);
return endFogPhase(LightPos) * NdotL * FogShadow;
}
#endif
float CustomPhase(float LightPos){
float PhaseCurve = 1.0 - LightPos;
@ -835,17 +824,20 @@ void main() {
#ifdef END_SHADER
float vortexBounds = clamp(vortexBoundRange - length(feetPlayerPos+cameraPosition), 0.0,1.0);
vec3 lightPos = LightSourcePosition(feetPlayerPos+cameraPosition, cameraPosition,vortexBounds);
float lightningflash = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0;
vec3 lightColors = LightSourceColors(vortexBounds, lightningflash);
float end_NdotL = clamp(dot(slopednormal, normalize(-lightPos))*0.5+0.5,0.0,1.0);
end_NdotL *= end_NdotL;
Direct_lighting += lightColors * GetShading(feetPlayerPos+cameraPosition, lightPos, slopednormal) ;
float fogShadow = GetCloudShadow(feetPlayerPos+cameraPosition, lightPos);
float endPhase = endFogPhase(lightPos);
Direct_lighting += lightColors * endPhase * end_NdotL * fogShadow;
AmbientLightColor += lightColors * (endPhase*endPhase) * (1.0-exp(vec3(0.6,2.0,2) * -(endPhase*0.1))) ;
#endif
/////////////////////////////////////////////////////////////////////////////////
@ -877,8 +869,10 @@ void main() {
#endif
#ifdef END_SHADER
float fresnelGlow = pow(clamp(1.5 + dot(normal, feetPlayerPos_normalized)*0.5,0,2),2);
vec3 AmbientLightColor = (vec3(0.5,0.75,1.0) *0.9 + 0.1)* fresnelGlow;
AmbientLightColor += vec3(0.5,0.75,1.0) * 0.9 + 0.1;
AmbientLightColor *= clamp(1.5 + dot(normal, feetPlayerPos_normalized)*0.5,0,2);
#endif
Indirect_lighting = DoAmbientLightColor(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy);

View File

@ -346,8 +346,7 @@ void main() {
#ifdef OVERWORLD_SHADER
// bloomy rain effect
float rainDrops = clamp(texture2D(colortex9,texcoord).a, 0.0,1.0);
if(rainDrops > 0.0) bloomyFogMult *= clamp(1.0 - pow(rainDrops*5.0,2),0.0,1.0);
// if(rainDrops > 0.0) bloomyFogMult *= exp((1.0 - rainDrops) * -0.1);
if(rainDrops > 0.0) bloomyFogMult *= clamp(1.0 - pow(rainDrops*5.0,2),0.0,1.0);
#endif
/// lava.

View File

@ -302,5 +302,5 @@ float GetCloudShadow(vec3 WorldPos, vec3 LightPos){
Shadow += Cast;
}
return clamp(exp(Shadow * -5.0),0.0,1.0);
return clamp(exp(Shadow * -10.0),0.0,1.0);
}