mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-20 07:57:55 +08:00
fix hardcoded ambient light skylight direction being used when rtao/ssgi are enabled. remove skylight direction as lightmap falls off for all AO effects.. bring back lightning flash effect on the world
This commit is contained in:
parent
2a5de55319
commit
6fdc95dff4
@ -825,15 +825,17 @@ void main() {
|
|||||||
///////////////////////////// INDIRECT LIGHTING /////////////////////////////
|
///////////////////////////// INDIRECT LIGHTING /////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef OVERWORLD_SHADER
|
#if defined OVERWORLD_SHADER && (indirect_effect == 0 || indirect_effect == 1)
|
||||||
|
|
||||||
vec3 ambientcoefs = slopednormal / dot(abs(slopednormal), vec3(1));
|
vec3 ambientcoefs = slopednormal / dot(abs(slopednormal), vec3(1));
|
||||||
|
|
||||||
float SkylightDir = ambientcoefs.y*1.5;
|
float SkylightDir = ambientcoefs.y*1.5;
|
||||||
if(isGrass) SkylightDir = 1.25;
|
if(isGrass) SkylightDir = 1.25;
|
||||||
|
|
||||||
float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.25) ;
|
|
||||||
|
|
||||||
|
float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.25 + (1.0-lightmap.y) * 0.75) ;
|
||||||
|
|
||||||
AmbientLightColor *= skylight;
|
AmbientLightColor *= skylight;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NETHER_SHADER
|
#ifdef NETHER_SHADER
|
||||||
@ -852,9 +854,10 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Indirect_lighting = DoAmbientLightColor(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy);
|
Indirect_lighting = DoAmbientLightColor(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy);
|
||||||
|
|
||||||
// Indirect_lighting += LightningFlashLighting;
|
#ifdef OVERWORLD_SHADER
|
||||||
|
Indirect_lighting += LightningFlashLighting;
|
||||||
|
#endif
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////// UNDER WATER SHADING ////////////////////////////////
|
//////////////////////////////// UNDER WATER SHADING ////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -257,6 +257,8 @@ void ApplySSRT(
|
|||||||
#ifdef OVERWORLD_SHADER
|
#ifdef OVERWORLD_SHADER
|
||||||
if(isGrass) rayDir.y = clamp(rayDir.y + 0.5,-1,1);
|
if(isGrass) rayDir.y = clamp(rayDir.y + 0.5,-1,1);
|
||||||
|
|
||||||
|
rayDir.y = mix(-1.0,rayDir.y, lightmaps.y*lightmaps.y);
|
||||||
|
|
||||||
skycontribution = (skyCloudsFromTexLOD(rayDir, colortex4, 0).rgb / 10.0) * Lighting.a + Lighting.rgb;
|
skycontribution = (skyCloudsFromTexLOD(rayDir, colortex4, 0).rgb / 10.0) * Lighting.a + Lighting.rgb;
|
||||||
#else
|
#else
|
||||||
skycontribution = (skyCloudsFromTexLOD2(rayDir, colortex4, 6).rgb / 10.0) * Lighting.a + Lighting.rgb;
|
skycontribution = (skyCloudsFromTexLOD2(rayDir, colortex4, 6).rgb / 10.0) * Lighting.a + Lighting.rgb;
|
||||||
@ -267,7 +269,7 @@ void ApplySSRT(
|
|||||||
if(isGrass) rayDir.y = clamp(rayDir.y + 0.25,-1,1);
|
if(isGrass) rayDir.y = clamp(rayDir.y + 0.25,-1,1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
skycontribution = skylightcolor * (max(rayDir.y,0.0)*0.9+0.1) + Lighting.rgb;
|
skycontribution = skylightcolor * (max(rayDir.y,pow(1.0-lightmaps.y,2))*0.9+0.1) + Lighting.rgb;
|
||||||
|
|
||||||
#if indirect_effect == 4
|
#if indirect_effect == 4
|
||||||
skycontribution2 = skylightcolor + Lighting.rgb;
|
skycontribution2 = skylightcolor + Lighting.rgb;
|
||||||
|
@ -261,13 +261,6 @@ vec4 renderClouds(
|
|||||||
|
|
||||||
|
|
||||||
#ifdef Cumulus
|
#ifdef Cumulus
|
||||||
|
|
||||||
// float shadowStepSize[3] = float[](
|
|
||||||
// 0.05,
|
|
||||||
// 0.25 + Dither.y*0.1,
|
|
||||||
// 0.50 + Dither.y*0.1
|
|
||||||
// );
|
|
||||||
|
|
||||||
for(int i=0;i<maxIT_clouds;i++) {
|
for(int i=0;i<maxIT_clouds;i++) {
|
||||||
|
|
||||||
// IntersecTerrain = length(progress_view - cameraPosition) > lViewPosM;
|
// IntersecTerrain = length(progress_view - cameraPosition) > lViewPosM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user