Add toggle for entity shadows

This commit is contained in:
Xonk 2023-07-02 17:27:20 -04:00
parent 9c844795e1
commit 5f7f23c2a9
5 changed files with 26 additions and 6 deletions

View File

@ -601,6 +601,8 @@ void rtGI(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, float lightm
vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos){ vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos){
float labcurve = pow(Density,LabSSS_Curve); float labcurve = pow(Density,LabSSS_Curve);
float density = sqrt(30 - labcurve*15); float density = sqrt(30 - labcurve*15);
@ -939,8 +941,14 @@ void main() {
#ifdef Sub_surface_scattering #ifdef Sub_surface_scattering
#ifdef Variable_Penumbra_Shadows #ifdef Variable_Penumbra_Shadows
SSS = SubsurfaceScattering_sun(albedo, SHADOWBLOCKERDEPTBH, LabSSS, clamp(dot(np3, WsunVec),0.0,1.0)) ; float sunSSS_density = LabSSS;
#ifndef RENDER_ENTITY_SHADOWS
if(entities) sunSSS_density = 0.0;
#endif
SSS = SubsurfaceScattering_sun(albedo, SHADOWBLOCKERDEPTBH, sunSSS_density, clamp(dot(np3, WsunVec),0.0,1.0)) ;
SSS *= DirectLightColor; SSS *= DirectLightColor;
if (isEyeInWater == 0) SSS *= lightleakfix; // light leak fix if (isEyeInWater == 0) SSS *= lightleakfix; // light leak fix
#endif #endif

View File

@ -9,6 +9,7 @@ screen.Direct_Light = Direct Light
screen.Filtering = Shadow Filtering Settings screen.Filtering = Shadow Filtering Settings
screen.Shadows = Shadows screen.Shadows = Shadows
option.SCREENSPACE_CONTACT_SHADOWS = Contact Shadows option.SCREENSPACE_CONTACT_SHADOWS = Contact Shadows
option.RENDER_ENTITY_SHADOWS = Shadows for Entities
option.shadowMapResolution = Shadow Resolution option.shadowMapResolution = Shadow Resolution
option.shadowDistance = Shadow Distance option.shadowDistance = Shadow Distance

View File

@ -273,6 +273,9 @@ const float shadowDistanceRenderMul = -1.0; //[-1.0 1.0] THIS WILL BREAK SUBSURF
#define SHADOW_DISABLE_ALPHA_MIPMAPS // Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases #define SHADOW_DISABLE_ALPHA_MIPMAPS // Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases
#define Stochastic_Transparent_Shadows // Highly recommanded to enable SHADOW_DISABLE_ALPHA_MIPMAPS with it. Uses noise to simulate transparent objects' shadows (not colored). It is also recommended to increase Min_Shadow_Filter_Radius with this. #define Stochastic_Transparent_Shadows // Highly recommanded to enable SHADOW_DISABLE_ALPHA_MIPMAPS with it. Uses noise to simulate transparent objects' shadows (not colored). It is also recommended to increase Min_Shadow_Filter_Radius with this.
#define RENDER_ENTITY_SHADOWS
// --- SSGI/RTAO --- // --- SSGI/RTAO ---

View File

@ -1,5 +1,12 @@
#shaders/shaders.properties #shaders/shaders.properties
#Minecraft Settings #Minecraft Settings
#ifndef RENDER_ENTITY_SHADOWS
shadowBlockEntities = false
shadowEntities = false
#endif
oldLighting=false oldLighting=false
underwaterOverlay=false underwaterOverlay=false
sun=true sun=true
@ -57,7 +64,7 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds]
screen.Direct_Light = [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] sunPathRotation sun_illuminance moon_illuminance screen.Direct_Light = [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] sunPathRotation sun_illuminance moon_illuminance
screen.Shadows.columns=1 screen.Shadows.columns=1
screen.Shadows = SCREENSPACE_CONTACT_SHADOWS <empty> [Filtering] shadowMapResolution shadowDistance screen.Shadows = SCREENSPACE_CONTACT_SHADOWS RENDER_ENTITY_SHADOWS <empty> [Filtering] shadowMapResolution shadowDistance
screen.Subsurface_Scattering.columns=1 screen.Subsurface_Scattering.columns=1
screen.Subsurface_Scattering = SSS_TYPE LabSSS_Curve <empty> Ambient_SSS ambientsss_brightness screen.Subsurface_Scattering = SSS_TYPE LabSSS_Curve <empty> Ambient_SSS ambientsss_brightness
@ -179,7 +186,7 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds]
screen.Editing = Compositing_Sky CompSky_R CompSky_G CompSky_B screen.Editing = Compositing_Sky CompSky_R CompSky_G CompSky_B
######## MISC SETTINGS ######## MISC SETTINGS
screen.Misc_Settings.columns=1 screen.Misc_Settings.columns=1
screen.Misc_Settings = [the_orb] [lightning_color] WhiteWorld ambientLight_only Glass_Tint display_LUT ambientSSS_view screen.Misc_Settings = [the_orb] [lightning_color] WhiteWorld ambientLight_only Glass_Tint display_LUT ambientSSS_view
screen.the_orb.columns = 1 screen.the_orb.columns = 1
screen.the_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B screen.the_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B
@ -366,8 +373,6 @@ uniform.float.shadowMaxProj = 150.0/abs(sunPosY)
# photon shit # photon shit
uniform.vec2.view_res = vec2(viewWidth, viewHeight) uniform.vec2.view_res = vec2(viewWidth, viewHeight)
uniform.vec2.view_pixel_size = vec2(1.0 / viewWidth, 1.0 / viewHeight) uniform.vec2.view_pixel_size = vec2(1.0 / viewWidth, 1.0 / viewHeight)

View File

@ -25,6 +25,9 @@ void main() {
gl_FragData[0].a = texture2DLod(tex,texcoord.xy,0).a; gl_FragData[0].a = texture2DLod(tex,texcoord.xy,0).a;
#endif #endif
#ifdef RENDER_ENTITY_SHADOWS
#endif
#ifdef Stochastic_Transparent_Shadows #ifdef Stochastic_Transparent_Shadows
gl_FragData[0].a = float(gl_FragData[0].a >= R2_dither()); gl_FragData[0].a = float(gl_FragData[0].a >= R2_dither());
#endif #endif