Merge branch 'X0nk:main' into main

This commit is contained in:
NakiriRuri 2023-07-09 21:44:26 +08:00 committed by GitHub
commit c0581a4a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 346 additions and 289 deletions

View File

@ -35,7 +35,7 @@
####### ----- lightsources ----- #######
block.10005 = minecraft:sculk_sensor:sculk_sensor_phase=active minecraft:soul_fire minecraft:soul_campfire:lit=true minecraft:cave_vines_plant:berries=true minecraft:soul_lantern minecraft:soul_torch minecraft:soul_wall_torch minecraft:conduit minecraft:beacon minecraft:sea_pickle minecraft:respawn_anchor:charges=4 minecraft:smoker:lit=true minecraft:blast_furnace:lit=true minecraft:furnace:lit=true minecraft:lava_cauldron minecraft:sea_lantern minecraft:cave_vines:berries=true minecraft:glowstone minecraft:torch minecraft:wall_torch minecraft:lava minecraft:fire minecraft:redstone_torch minecraft:redstone_wall_torch minecraft:jack_o_lantern minecraft:magma_block minecraft:redstone_lamp:lit=true minecraft:lantern minecraft:campfire:lit=true minecraft:shroomlight minecraft:end_rod minecraft:end_gateway minecraft:lava minecraft:fire
block.10005 = minecraft:candle:lit=true minecraft:sculk_sensor:sculk_sensor_phase=active minecraft:soul_fire minecraft:soul_campfire:lit=true minecraft:cave_vines_plant:berries=true minecraft:soul_lantern minecraft:soul_torch minecraft:soul_wall_torch minecraft:conduit minecraft:beacon minecraft:sea_pickle minecraft:respawn_anchor:charges=4 minecraft:smoker:lit=true minecraft:blast_furnace:lit=true minecraft:furnace:lit=true minecraft:lava_cauldron minecraft:sea_lantern minecraft:cave_vines:berries=true minecraft:glowstone minecraft:torch minecraft:wall_torch minecraft:lava minecraft:fire minecraft:redstone_torch minecraft:redstone_wall_torch minecraft:jack_o_lantern minecraft:magma_block minecraft:redstone_lamp:lit=true minecraft:lantern minecraft:campfire:lit=true minecraft:shroomlight minecraft:end_rod minecraft:end_gateway minecraft:lava minecraft:fire
####### ----- reflective translucents / glass ----- #######

View File

@ -170,44 +170,43 @@ void main() {
vec2 lightmap = dataUnpacked1.yz;
bool translucent = abs(dataUnpacked1.w-0.5) <0.01;
bool translucent2 = abs(dataUnpacked1.w-0.6) <0.01; // Weak translucency
bool translucent3 = abs(dataUnpacked1.w-0.55) <0.01; // Weak translucency
bool translucent4 = abs(dataUnpacked1.w-0.65) <0.01; // Weak translucency
bool entities = abs(dataUnpacked1.w-0.45) <0.01; // Weak translucency
bool hand = abs(dataUnpacked1.w-0.75) <0.01;
// bool lightningBolt = abs(dataUnpacked1.w-0.5) <0.01;
// bool isLeaf = abs(dataUnpacked1.w-0.55) <0.01;
// bool translucent2 = abs(dataUnpacked1.w-0.6) <0.01; // Weak translucency
// bool translucent4 = abs(dataUnpacked1.w-0.65) <0.01; // Weak translucency
bool entities = abs(dataUnpacked1.w-0.45) < 0.01;
bool hand = abs(dataUnpacked1.w-0.75) < 0.01;
// bool blocklights = abs(dataUnpacked1.w-0.8) <0.01;
float minshadowfilt = Min_Shadow_Filter_Radius;
float maxshadowfilt = Max_Shadow_Filter_Radius;
float NdotL = clamp(dot(normal,WsunVec),0.0,1.0);
float vanillAO = clamp(texture2D(colortex15,texcoord).a,0.0,1.0) ;
if(lightmap.y < 0.1 && !entities){
// minshadowfilt *= vanillAO;
maxshadowfilt = mix(minshadowfilt ,maxshadowfilt, vanillAO);
maxshadowfilt = mix(minshadowfilt, maxshadowfilt, vanillAO);
}
float SpecularTex = texture2D(colortex8,texcoord).z;
float LabSSS = clamp((-65.0 + SpecularTex * 255.0) / 190.0 ,0.0,1.0);
#ifndef Variable_Penumbra_Shadows
if (translucent && !hand) minshadowfilt += 25;
if (LabSSS > 0.0 && !hand && NdotL < 0.001) minshadowfilt += 50;
#endif
gl_FragData[0] = vec4(minshadowfilt, 0.1, 0.0, 0.0);
if (z < 1.0){
// if( translucent || translucent2)
if (!hand){
float NdotL = clamp(dot(normal,WsunVec),0.0,1.0);
vec3 fragpos = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z));
@ -224,7 +223,7 @@ void main() {
float distortFactor = calcDistort(projectedShadowPosition.xy);
projectedShadowPosition.xy *= distortFactor;
//do shadows only if on shadow map
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.z) < 6.0){
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.z) < 6.0){
const float threshMul = max(2048.0/shadowMapResolution*shadowDistance/128.0,0.95);
float distortThresh = (sqrt(1.0-NdotL*NdotL)/NdotL+0.7)/distortFactor;
float diffthresh = distortThresh/6000.0*threshMul;
@ -232,7 +231,7 @@ void main() {
float mult = maxshadowfilt;
float avgBlockerDepth = 0.0;
vec2 scales = vec2(0.0,Max_Filter_Depth);
vec2 scales = vec2(0.0, 120.0 - Max_Filter_Depth);
float blockerCount = 0.0;
float rdMul = distortFactor*(1.0+mult)*d0*k/shadowMapResolution;
float diffthreshM = diffthresh*mult*d0*k/20.;
@ -268,6 +267,5 @@ void main() {
#endif
}
}
}
}

View File

@ -12,10 +12,10 @@ const bool shadowHardwareFiltering = true;
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
flat varying vec2 rodExposureDepth;
flat varying vec3 WsunVec;
flat varying vec2 TAA_Offset;
flat varying float tempOffsets;
uniform float eyeAltitude;
@ -597,13 +597,11 @@ void rtGI(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, float lightm
vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos){
float labcurve = pow(Density,LabSSS_Curve);
float density = sqrt(30 - labcurve*15);
vec3 absorbed = max(1.0 - albedo,0.0) * density;
vec3 scatter = exp(-sqrt(Scattering * absorbed)) * exp(Scattering * -density);
vec3 absorbed = max(1.0 - albedo,0.0);
vec3 scatter = exp(absorbed * -sqrt(Scattering * 5)) * exp(Scattering * -density);
scatter *= labcurve;
scatter *= 0.5 + CustomPhase(lightPos, 1.0,30.0)*20;
@ -614,9 +612,8 @@ vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, floa
vec3 SubsurfaceScattering_sky(vec3 albedo, float Scattering, float Density){
vec3 absorbed = max(luma(albedo) - albedo,0.0);
vec3 scatter = sqrt(exp(-(absorbed * Scattering * 15))) * (1.0 - Scattering);
// vec3 scatter = exp(-sqrt(max(Scattering+0.05,0.0) * absorbed * 25)) * exp(Scattering * -5);
vec3 scatter = exp(-sqrt(Scattering * absorbed * 5)) * pow((-Scattering+1.0)*1.25,2.0);
scatter *= pow(Density,LabSSS_Curve);
return scatter;
@ -689,18 +686,21 @@ void GriAndEminShadowFix(
float SkyLightmap,
bool Entities
){
float DistanceOffset = clamp(0.1 + length(WorldPos) / (shadowMapResolution*0.20), 0.0,1.0) ;
vec3 Bias = FlatNormal * DistanceOffset; // adjust the bias thingy's strength as it gets farther away.
vec3 finalBias = Bias;
// stop lightleaking
if(SkyLightmap < 0.1 && !Entities) {
WorldPos += mix(Bias, 0.5 * (0.5 - fract(WorldPos + cameraPosition + FlatNormal*0.01 ) ), VanillaAO) ;
}else{
WorldPos += Bias;
}
vec2 scale = vec2(0.5); scale.y *= 0.5;
vec3 zoomShadow = scale.y - scale.x * fract(WorldPos + cameraPosition + Bias*scale.y);
if(SkyLightmap < 0.1 && !Entities) finalBias = mix(Bias, zoomShadow, clamp(VanillaAO*5,0,1));
WorldPos += finalBias;
}
void LabEmission(
void Emission(
inout vec3 Lighting,
vec3 Albedo,
float Emission
@ -752,10 +752,10 @@ void main() {
float z0 = texture2D(depthtex0,texcoord).x;
float z = texture2D(depthtex1,texcoord).x;
float TranslucentDepth = clamp( ld(z0)-ld(z0) ,0.0,1.0);
float TranslucentDepth = clamp( ld(z0)-ld(z0),0.0,1.0);
vec2 tempOffset=TAA_Offset;
vec3 fragpos = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z));
vec3 fragpos = toScreenSpace(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z));
vec3 fragpos_rtshadow = toScreenSpace(vec3(texcoord/RENDER_SCALE,z));
vec3 fragpos_handfix = fragpos;
@ -780,8 +780,8 @@ void main() {
scatterCoef *= 0.1;
#endif
float noise = blueNoise();
float noise = blueNoise();
float iswaterstuff = texture2D(colortex7,texcoord).a ;
bool iswater = iswaterstuff > 0.99;
@ -818,10 +818,6 @@ void main() {
#endif
float vanilla_AO = normalAndAO.a;
normalAndAO.a = clamp(pow(normalAndAO.a*5,4),0,1);
bool lightningBolt = abs(dataUnpacked1.w-0.5) <0.01;
bool isLeaf = abs(dataUnpacked1.w-0.55) <0.01;
@ -839,7 +835,6 @@ void main() {
vec3 ambientCoefs = normal/dot(abs(normal),vec3(1.));
float lightleakfix = clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2) ,0.0,1.0);
vec3 DirectLightColor = (lightCol.rgb/80.0);
@ -851,13 +846,21 @@ void main() {
vec3 AmbientLightColor = averageSkyCol_Clouds;
int shadowmapindicator = 0;
float cloudShadow = 1.0;
if ( z >= 1.) { //sky
#ifdef Compositing_Sky
gl_FragData[0].rgb = vec3(CompSky_R, CompSky_G, CompSky_B);
#else
if ( z >= 1.) {//sky
//////////////////////////////// ////////////////////////////////
//////////////////////////////// SKY STUFF ////////////////////////////////
//////////////////////////////// ////////////////////////////////
#ifdef Compositing_Sky
gl_FragData[0].rgb = vec3(CompSky_R, CompSky_G, CompSky_B);
#else
vec3 background = vec3(0.0);
vec3 orbitstar = vec3(np3.x,abs(np3.y),np3.z);
@ -874,102 +877,113 @@ void main() {
vec3 skyTEX = skyFromTex(np3,colortex4)/150.0 * 5.0;
background += skyTEX;
// eclipse
// color *=max(1.0 - drawSun(dot(lightCol.a * WsunVec, (np3-0.0002)*1.001),0, vec3(1),vec3(0.0)),0.0);
vec4 cloud = texture2D_bicubic(colortex0,texcoord*CLOUDS_QUALITY);
if(eyeAltitude < 25000) background = background*cloud.a + cloud.rgb;
gl_FragData[0].rgb = clamp(fp10Dither(background ,triangularize(noise)),0.0,65000.);
#endif
}else{//land
////// ----- direct ----- //////
//////////////////////////////// ////////////////////////////////
//////////////////////////////// DIRECT LIGHTING ////////////////////////////////
//////////////////////////////// ////////////////////////////////
vec3 Direct_lighting = vec3(1.0);
float Shadows = clamp(1.0 - filtered.b,0.0,1.0);
float SHADOWBLOCKERDEPTBH = filtered.y;
float NdotL = dot(slopednormal,WsunVec);
NdotL = clamp((-15 + NdotL*255.0) / 240.0 ,0.0,1.0);
if (abs(filtered.y-0.1) < 0.0004 && !iswater) Shadows = clamp((lightmap.y-0.85)*25,0,1);
float SHADOWBLOCKERDEPTBH = filtered.y;
//if (abs(filtered.y-0.1) < 0.0004 && !iswater) SHADOWBLOCKERDEPTBH = 1.0-clamp((lightmap.y-0.85)*25,0,1);
float shadowNDOTL = NdotL;
#ifndef Variable_Penumbra_Shadows
shadowNDOTL += LabSSS;
#endif
vec3 SSS = vec3(0.0);
vec3 p3_shadow = mat3(gbufferModelViewInverse) * fragpos_handfix + gbufferModelViewInverse[3].xyz;
if (NdotL > 0.001) {
vec3 p3_shadow = mat3(gbufferModelViewInverse) * fragpos_handfix + gbufferModelViewInverse[3].xyz;
GriAndEminShadowFix(p3_shadow, viewToWorld(FlatNormals), normalAndAO.a, lightmap.y, entities);
vec3 projectedShadowPosition = mat3(shadowModelView) * p3_shadow + shadowModelView[3].xyz;
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
//apply distortion
float distortFactor = calcDistort(projectedShadowPosition.xy);
projectedShadowPosition.xy *= distortFactor;
// Shadows = 0.0;
vec3 shadew = projectedShadowPosition.xyz;
//do shadows only if on shadow map
if (abs(shadew.x) < 1.0-1.5/shadowMapResolution && abs(shadew.y) < 1.0-1.5/shadowMapResolution && abs(shadew.z) < 6.0){
if(!hand) GriAndEminShadowFix(p3_shadow, viewToWorld(FlatNormals), vanilla_AO, lightmap.y, entities);
float diffthresh = 0.0;
// if(hand && eyeBrightness.y/240. > 0.0) diffthresh = 0.0003;
vec3 projectedShadowPosition = mat3(shadowModelView) * p3_shadow + shadowModelView[3].xyz;
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5);
//apply distortion
float distortFactor = calcDistort(projectedShadowPosition.xy);
projectedShadowPosition.xy *= distortFactor;
//do shadows only if on shadow map
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.z) < 6.0){
if (shadowNDOTL > 0.001){
Shadows = 0.0;
float rdMul = filtered.x*distortFactor*d0*k/shadowMapResolution;
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5);
for(int i = 0; i < SHADOW_FILTER_SAMPLE_COUNT; i++){
// if(hand) noise = 0.0;
vec2 offsetS = tapLocation(i,SHADOW_FILTER_SAMPLE_COUNT,1.618,noise,0.0);
float weight = 1.0+(i+noise)*rdMul/SHADOW_FILTER_SAMPLE_COUNT*shadowMapResolution;
float isShadow = shadow2D(shadow,vec3(projectedShadowPosition + vec3(rdMul*offsetS,-diffthresh*weight))).x;
Shadows += isShadow/SHADOW_FILTER_SAMPLE_COUNT;
}
#ifdef BASIC_SHADOW_FILTER
float rdMul = filtered.x*distortFactor*d0*k/shadowMapResolution;
for(int i = 0; i < SHADOW_FILTER_SAMPLE_COUNT; i++){
vec2 offsetS = tapLocation(i,SHADOW_FILTER_SAMPLE_COUNT,1.618,noise,0.0);
float isShadow = shadow2D(shadow,projectedShadowPosition + vec3(rdMul*offsetS, 0.0) ).x;
Shadows += isShadow/SHADOW_FILTER_SAMPLE_COUNT;
}
#else
Shadows = shadow2D(shadow, projectedShadowPosition).x;
#endif
}
shadowmapindicator = 1;
}
#ifdef Variable_Penumbra_Shadows
bool outsideShadowMap = shadowmapindicator < 1;
if(outsideShadowMap && !iswater) Shadows = clamp((lightmap.y-0.8) * 5,0,1);
float sunSSS_density = LabSSS;
#ifndef RENDER_ENTITY_SHADOWS
if(entities) sunSSS_density = 0.0;
#endif
//////////////////////////////// SUN SSS ////////////////////////////////
vec3 SSS = vec3(0.0);
SSS = SubsurfaceScattering_sun(albedo, SHADOWBLOCKERDEPTBH, sunSSS_density, clamp(dot(np3, WsunVec),0.0,1.0)) ;
SSS *= DirectLightColor;
if (isEyeInWater == 0) SSS *= lightleakfix; // light leak fix
#endif
if (!hand){
if (abs(filtered.y-0.1) < 0.0004 && LabSSS < 0.0 ) SSS = vec3(0.0);
#ifdef SCREENSPACE_CONTACT_SHADOWS
vec3 vec = lightCol.a*sunVec;
float screenShadow = rayTraceShadow(vec, fragpos_rtshadow, interleaved_gradientNoise());
screenShadow *= screenShadow ;
#ifdef Variable_Penumbra_Shadows
Shadows = min(screenShadow, Shadows + luma(SSS));
if (abs(filtered.y-0.1) < 0.0004 ) SSS *= vec3(Shadows);
#endif
#endif
#ifndef Variable_Penumbra_Shadows
if(LabSSS > 0 ) {
SHADOWBLOCKERDEPTBH = pow(1.0 - Shadows,2);
}
#endif
#ifdef Variable_Penumbra_Shadows
SSS *= 1.0-NdotL*Shadows;
#if SSS_TYPE != 0
if (outsideShadowMap) SHADOWBLOCKERDEPTBH = 0.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;
if (isEyeInWater == 0) SSS *= lightleakfix; // light leak fix
#endif
if (!hand){
#ifdef SCREENSPACE_CONTACT_SHADOWS
float screenShadow = rayTraceShadow(lightCol.a*sunVec, fragpos_rtshadow, interleaved_gradientNoise());
screenShadow *= screenShadow;
Shadows = min(screenShadow, Shadows);
if (outsideShadowMap) SSS *= Shadows;
#endif
}
#if SSS_TYPE != 0
SSS *= 1.0-clamp(NdotL*Shadows,0,1);
#endif
#ifdef VOLUMETRIC_CLOUDS
#ifdef CLOUDS_SHADOWS
cloudShadow = GetCloudShadow(p3);
@ -978,14 +992,14 @@ void main() {
#endif
#endif
////// ----- indirect ----- //////
//////////////////////////////// ////////////////////////////////
//////////////////////////////// INDIRECT LIGHTING ////////////////////////////////
//////////////////////////////// ////////////////////////////////
vec3 Indirect_lighting = vec3(1.0);
// float cloudOcclusion = GetCloudShadow_occluson(p3 + cameraPosition);
// AmbientLightColor *= cloudOcclusion*0.5+.5;
float skylight = clamp(abs(ambientCoefs.y + 1.0),0.35,2.0);
// float skylight = clamp(abs(ambientCoefs.y + 1.0),0.35,2.0);
float skylight = clamp(ambientCoefs.y + 0.5,0.25,2.0);
#if indirect_effect == 2 || indirect_effect == 3 || indirect_effect == 4
if (!hand) skylight = 1.0;
@ -993,39 +1007,31 @@ void main() {
// do this to make underwater shading easier.
vec2 newLightmap = lightmap.xy;
if((isEyeInWater == 0 && iswater) || (isEyeInWater == 1 && !iswater)) newLightmap.y = clamp(newLightmap.y,0,1);
#ifndef ambientSSS_view
Indirect_lighting = DoAmbientLighting(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), newLightmap.xy, skylight);
#endif
vec3 AO = vec3(1.0);
vec3 debug = vec3(0.0);
// vanilla AO
#if indirect_effect == 0
// AO = vec3(mix(1.0 - exp2(-5 * pow(1-vanilla_AO,3)), 1.0, pow(newLightmap.x,4))) ;
AO = vec3( exp( (vanilla_AO*vanilla_AO) * -5) ) ;
#endif
// SSAO + vanilla AO
#if indirect_effect == 1
// AO *= mix(1.0 - exp2(-5 * pow(1-vanilla_AO,3)),1.0, pow(newLightmap.x,4));
AO = vec3( exp( (vanilla_AO*vanilla_AO) * -3) ) ;
if (!hand) ssAO(AO, SkySSS, fragpos, 1.0, blueNoise(gl_FragCoord.xy).rg, FlatNormals , texcoord, ambientCoefs, newLightmap.xy, isLeaf);
#endif
// GTAO
#if indirect_effect == 2
int seed = (frameCounter%40000);
vec2 r2 = fract(R2_samples(seed) + blueNoise(gl_FragCoord.xy).rg);
if (!hand) AO = ambient_occlusion(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z), fragpos, worldToView(slopednormal), r2, debug) * vec3(1.0);
if (!hand) AO = ambient_occlusion(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z), fragpos, worldToView(slopednormal), r2, debug) * vec3(1.0);
#endif
// RTAO
@ -1043,35 +1049,47 @@ void main() {
#endif
Indirect_lighting *= AO;
vec3 SSS_forSky = vec3(0.0);
//////////////////////////////// SKY SSS ////////////////////////////////
#ifdef Ambient_SSS
if (!hand){
vec3 SSS_forSky = vec3(0.0);
#if indirect_effect != 1
ScreenSpace_SSS(SkySSS, fragpos, blueNoise(gl_FragCoord.xy).rg, FlatNormals, isLeaf);
#endif
vec3 ambientColor = ((AmbientLightColor * 2.0 * ambient_brightness) * 8./150./3.) * 1.5;
float lightmap = pow(newLightmap.y,3);
float uplimit = clamp(1.0-pow(clamp(ambientCoefs.y + 0.5,0.0,1.0),2),0,1);
SSS_forSky = SubsurfaceScattering_sky(albedo, SkySSS, LabSSS);
SSS_forSky *= (AmbientLightColor* 2.0 * ambient_brightness) * 8./150.;
SSS_forSky *= pow(newLightmap.y,3);
// SSS_forSky *= pow(1.0-clamp(abs(ambientCoefs.y+0.5),0.0,1.0),0.1);
SSS += SSS_forSky * pow(1.0-clamp(abs(ambientCoefs.y+0.5),0.0,1.0),0.1); // Indirect_lighting += SubsurfaceScattering_sky(albedo, SkySSS, LabSSS) * ((AmbientLightColor* 2.0 * ambient_brightness)* 8./150.) * pow(newLightmap.y,3);
SSS_forSky *= ambientColor;
SSS_forSky *= lightmap;
SSS_forSky *= uplimit;
// Combine with the other SSS
SSS += SSS_forSky;
SSS_forSky = vec3((1.0 - SkySSS) * LabSSS);
SSS_forSky *= ambientColor;
SSS_forSky *= lightmap;
////light up dark parts so its more visible
Indirect_lighting = max(Indirect_lighting, SSS_forSky);
}
#endif
// Indirect_lighting = max(Indirect_lighting, SSS_forSky);
////// ----- Under Water Shading ----- //////
//////////////////////////////// ////////////////////////////////
//////////////////////////////// UNDER WATER SHADING ////////////////////////////////
//////////////////////////////// ////////////////////////////////
vec3 waterabsorb_speculars = vec3(1);
if ((isEyeInWater == 0 && iswater) || (isEyeInWater == 1 && !iswater)){
vec3 fragpos0 = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z0));
vec3 fragpos0 = toScreenSpace(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z0));
float Vdiff = distance(fragpos,fragpos0);
float VdotU = np3.y;
float estimatedDepth = Vdiff * abs(VdotU); //assuming water plane
@ -1103,8 +1121,9 @@ void main() {
}
////// ----- Finalize ----- //////
//////////////////////////////// ////////////////////////////////
//////////////////////////////// FINALIZE ////////////////////////////////
//////////////////////////////// ////////////////////////////////
#ifdef Seasons
#ifdef Snowy_Winter
@ -1133,8 +1152,7 @@ void main() {
Direct_lighting = DoDirectLighting(DirectLightColor, Shadows, NdotL, 0.0);
//combine all light sources
vec3 FINAL_COLOR = Indirect_lighting + Direct_lighting + SSS;
#ifndef ambientSSS_view
@ -1145,34 +1163,34 @@ void main() {
MaterialReflections(FINAL_COLOR, SpecularTex.r, SpecularTex.ggg, albedo, WsunVec, (Shadows*NdotL)*DirectLightColor, lightmap.y, slopednormal, np3, fragpos, vec3(blueNoise(gl_FragCoord.xy).rg, interleaved_gradientNoise()), hand, entities);
#endif
LabEmission(FINAL_COLOR, albedo, SpecularTex.a);
Emission(FINAL_COLOR, albedo, SpecularTex.a);
if(lightningBolt) FINAL_COLOR.rgb += vec3(Lightning_R,Lightning_G,Lightning_B) * 255.0;
gl_FragData[0].rgb = FINAL_COLOR ;
// if(LabSSS > 0.0) gl_FragData[0].rgb = vec3(0,25,0);
gl_FragData[0].rgb = FINAL_COLOR;
}
////// ----- Under Water Fog ----- //////
//////////////////////////////// ////////////////////////////////
//////////////////////////////// UNDERWATER FOG ////////////////////////////////
//////////////////////////////// ////////////////////////////////
if (iswater){
vec3 fragpos0 = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z0));
vec3 fragpos0 = toScreenSpace(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z0));
float Vdiff = distance(fragpos,fragpos0);
float VdotU = np3.y;
float estimatedDepth = Vdiff * abs(VdotU) ; //assuming water plane
float estimatedSunDepth = estimatedDepth/abs(WsunVec.y); //assuming water plane
float custom_lightmap_T = pow(texture2D(colortex14, texcoord).a,1.5);
float custom_lightmap_T = pow(texture2D(colortex14, texcoord).a,3.0);
vec3 ambientColVol = (averageSkyCol_Clouds*8./150./1.5) * max(custom_lightmap_T,MIN_LIGHT_AMOUNT*0.0015);
vec3 lightColVol = (lightCol.rgb / 80.);
vec3 ambientColVol = (averageSkyCol_Clouds*8./150./2.) * max(custom_lightmap_T,MIN_LIGHT_AMOUNT*0.0015);
vec3 lightColVol = DirectLightColor;
if (isEyeInWater == 0) waterVolumetrics(gl_FragData[0].rgb, fragpos0, fragpos, estimatedDepth , estimatedSunDepth, Vdiff, noise, totEpsilon, scatterCoef, ambientColVol, lightColVol, dot(np3, WsunVec));
}
#ifdef DOF_JITTER
#if DOF_QUALITY == 5
vec3 laserColor;
#if FOCUS_LASER_COLOR == 0 // Red
laserColor = vec3(25, 0, 0);
@ -1188,14 +1206,16 @@ void main() {
laserColor = vec3(25);
#endif
#if DOF_JITTER_FOCUS < 0
#if MANUAL_FOCUS == -2
float focusDist = rodExposureDepth.y*far;
#elif MANUAL_FOCUS == -1
float focusDist = mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusDist = DOF_JITTER_FOCUS;
float focusDist = MANUAL_FOCUS;
#endif
if( hideGUI < 1.0) gl_FragData[0].rgb += laserColor * pow( clamp( 1.0-abs(focusDist-abs(fragpos.z)) ,0,1),25) ;
#endif
/* DRAWBUFFERS:3 */
/* DRAWBUFFERS:3 */
}

View File

@ -4,6 +4,7 @@
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
flat varying vec2 rodExposureDepth;
flat varying vec3 WsunVec;
flat varying float tempOffsets;
@ -54,15 +55,7 @@ flat varying float WinterTimeForSnow;
void main() {
gl_Position = ftransform();
#ifdef TAA_UPSCALING
gl_Position.xy = (gl_Position.xy*0.5+0.5)*RENDER_SCALE*2.0-1.0;
#endif
tempOffsets = HaltonSeq2(frameCounter%10000);
TAA_Offset = offsets[frameCounter%8];
#ifndef TAA
TAA_Offset = vec2(0.0);
#endif
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
// averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
@ -87,4 +80,19 @@ void main() {
YearCycleColor(color1, color2, WinterTimeForSnow);
#endif
#endif
rodExposureDepth = texelFetch2D(colortex4,ivec2(14,37),0).rg;
rodExposureDepth.y = sqrt(rodExposureDepth.y/65000.0);
TAA_Offset = offsets[frameCounter%8];
#ifndef TAA
TAA_Offset = vec2(0.0);
#endif
#ifdef TAA_UPSCALING
gl_Position.xy = (gl_Position.xy*0.5+0.5)*RENDER_SCALE*2.0-1.0;
#endif
}

View File

@ -17,7 +17,6 @@ uniform sampler2D colortex5;
uniform sampler2D colortex3;
// uniform sampler2D colortex6;
uniform sampler2D colortex7;
// uniform sampler2D colortex10;
// uniform sampler2D colortex8; // specular
// uniform sampler2D colortex9; // specular
uniform sampler2D depthtex0;
@ -67,22 +66,20 @@ float ld(float depth) {
return (2.0 * near) / (far + near - depth * (far - near)); // (-depth * (far - near)) = (2.0 * near)/ld - far - near
}
// blindness fogs
uniform float blindness;
uniform float darknessFactor;
void main() {
/* DRAWBUFFERS:7 */
float vignette = (1.5-dot(texcoord-0.5,texcoord-0.5)*2.);
vec3 col = texture2D(colortex5,texcoord).rgb;
#if DOF_QUALITY >= 0
#if DOF_QUALITY >= 0 && DOF_QUALITY < 5
/*--------------------------------*/
float z = ld(texture2D(depthtex0, texcoord.st*RENDER_SCALE).r)*far;
#ifdef AUTOFOCUS
#if MANUAL_FOCUS == -2
float focus = rodExposureDepth.y*far;
#else
float focus = MANUAL_FOCUS*screenBrightness;
#elif MANUAL_FOCUS == -1
float focus = mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#elif MANUAL_FOCUS > 0
float focus = MANUAL_FOCUS;
#endif
float pcoc = min(abs(aperture * (focal/100.0 * (z - focus)) / (z * (focus - focal/100.0))),texelSize.x*15.0);
#ifdef FAR_BLUR_ONLY
@ -127,14 +124,6 @@ void main() {
float rodCurve = mix(1.0, rodLum/(2.5+rodLum), purkinje);
col = mix(clamp(lum,0.0,0.05)*Purkinje_Multiplier*vec3(Purkinje_R, Purkinje_G, Purkinje_B)+1.5e-3, col, rodCurve);
// #ifdef display_LUT
// vec2 movedTC = texcoord ;
// if(movedTC.x < 0.4 ) col.rgb = texture2D(colortex4,movedTC/2).rgb * 0.001;
// #endif
#ifndef USE_ACES_COLORSPACE_APPROXIMATION
col = LinearTosRGB(TONEMAP(col));
#else

View File

@ -262,7 +262,7 @@ void main() {
vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize+0.5*texelSize;
float z = texture2D(depthtex0,tc).x;
#ifdef DOF_JITTER
#if DOF_QUALITY == 5
vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
jitter = rotate(radians(float(frameCounter))) * jitter;
jitter.y *= aspectRatio;
@ -322,7 +322,8 @@ void main() {
float estEyeDepth = clamp((14.0-eyeBrightnessSmooth.y/255.0*16.0)/14.0,0.,1.0);
estEyeDepth *= estEyeDepth*estEyeDepth*34.0;
vec3 ambientColVol = averageSkyCol_Clouds*8./150./1.5;
vec3 ambientColVol = averageSkyCol_Clouds*8./150./2.0;
vec3 lightColVol = (lightCol.rgb / 80.);
estEyeDepth = max(Water_Top_Layer - cameraPosition.y,0.0);

View File

@ -22,18 +22,19 @@ const int colortex4Format = RGBA16F; //light values and skyboxes (everything)
const int colortex6Format = R11F_G11F_B10F; //additionnal buffer for bloom (composite3->final)
const int colortex7Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex8Format = RGBA16F; //Final output, transparencies id (gbuffer->composite4)
const int colortex9Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex10Format = RGBA16F; //Final output, transparencies id (gbuffer->composite4)
const int colortex7Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex8Format = RGBA16F; //Final output, transparencies id (gbuffer->composite4)
const int colortex9Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex10Format = RGBA16F; //FREE BUFFER
const int colortex11Format = RGBA16; //Final output, transparencies id (gbuffer->composite4)
const int colortex13Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex14Format = RGBA8; // Final output, transparencies id (gbuffer->composite4)
const int colortex15Format = RGBA8; // flat normals and vanilla AO
const int colortex11Format = RGBA16;
const int colortex13Format = RGBA8;
const int colortex14Format = RGBA8;
const int colortex15Format = RGBA8; // flat normals and vanilla AO
*/
//no need to clear the buffers, saves a few fps
/*
const bool colortex0Clear = false;
const bool colortex1Clear = false;
@ -76,6 +77,7 @@ uniform vec2 texelSize;
uniform float frameTimeCounter;
uniform float viewHeight;
uniform float viewWidth;
uniform int hideGUI;
uniform int frameCounter;
uniform int framemod8;
uniform vec3 previousCameraPosition;
@ -456,8 +458,13 @@ void main() {
#ifdef SCREENSHOT_MODE
vec4 color = TAA_hq_render();
gl_FragData[0] = color;
if(hideGUI > 0) {
vec4 color = TAA_hq_render();
gl_FragData[0] = color;
} else {
vec3 color = clamp(fp10Dither(texture2D(colortex3,texcoord).rgb,triangularize(interleaved_gradientNoise())),0.,65000.);
gl_FragData[0].rgb = color;
}
#else

View File

@ -3,10 +3,10 @@
### all the different strengths of subsurface scattering and what entities to put them on.
#medium sss (same as strong sss for blocks)
entity.1100 = slime giant ender_dragon ghast sheep
entity.1100 = slime giant ghast
#weak sss (same as weak sss for blocks)
entity.1200 = player frog chicken snow_golem polar_bear zombie_horse armor_stand arrow squid bat cat cod cow donkey fox horse mooshroom mule ocelot parrot pig piglin polar_bear pufferfish rabbit salmon strider tropical_fish turtle villager wandering_trader bee cave_spider dolphin enderman llama panda spider wolf zombified_piglin blaze creeper drowned endermite evoker guardian hoglin husk magma_cube phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager wither trader_llama
entity.1200 = ender_dragon player sheep frog chicken snow_golem polar_bear zombie_horse armor_stand arrow squid bat cat cod cow donkey fox horse mooshroom mule ocelot parrot pig piglin polar_bear pufferfish rabbit salmon strider tropical_fish turtle villager wandering_trader bee cave_spider dolphin enderman llama panda spider wolf zombified_piglin blaze creeper drowned endermite evoker guardian hoglin husk magma_cube phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager wither trader_llama
# various stuff

View File

@ -128,5 +128,5 @@ void main() {
applyContrast(FINAL_COLOR, CONTRAST); // for fun
gl_FragColor.rgb = FINAL_COLOR;
gl_FragColor.rgb = FINAL_COLOR ;
}

View File

@ -130,15 +130,19 @@ void main() {
//apply distortion
float distortFactor = calcDistort(projectedShadowPosition.xy);
projectedShadowPosition.xy *= distortFactor;
int shadowmapindicator = 0;
//do shadows only if on shadow map
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution){
float diffthresh = 0.0002;
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5);
Shadows = shadow2D_bicubic(shadow,vec3(projectedShadowPosition + vec3(0.0,0.0,-diffthresh*1.2)));
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5);
Shadows = shadow2D_bicubic(shadow,vec3(projectedShadowPosition + vec3(0.0,0.0,0.0)));
shadowmapindicator = 1;
}
if(shadowmapindicator < 1) Shadows = clamp((lmtexcoord.w-0.8) * 5,0,1);
#ifdef CLOUDS_SHADOWS
Shadows *= GetCloudShadow(p3);
#endif

View File

@ -90,16 +90,18 @@ void main() {
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
#endif
#ifdef DOF_JITTER
#if DOF_QUALITY == 5
vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
jitter = rotate(radians(float(frameCounter))) * jitter;
jitter.y *= aspectRatio;
jitter.x *= DOF_ANAMORPHIC_RATIO;
#if DOF_JITTER_FOCUS < 0
#if MANUAL_FOCUS == -2
float focusMul = 0;
#elif MANUAL_FOCUS == -1
float focusMul = gl_Position.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusMul = gl_Position.z - DOF_JITTER_FOCUS;
float focusMul = gl_Position.z - MANUAL_FOCUS;
#endif
vec2 totalOffset = (jitter * JITTER_STRENGTH) * focusMul * 1e-2;

View File

@ -541,7 +541,16 @@ void main() {
if(SpecularTex.g < 229.5/255.0) Albedo.rgb = mix(Albedo.rgb, vec3(0), Puddle_shape*porosity);
#endif
vec4 data1 = clamp( encode(viewToWorld(normal), (blueNoise()*vec2(torchlightmap,lmtexcoord.w) / (30.0 * (1+ (1-RENDER_SCALE.x))) ) + vec2(torchlightmap,lmtexcoord.w)), 0.0, 1.0);
// apply noise to lightmaps to reduce banding.
vec2 PackLightmaps = vec2(torchlightmap,lmtexcoord.w);
#ifndef ENTITIES
#ifndef HAND
PackLightmaps = max(PackLightmaps*blueNoise()*0.05 + PackLightmaps,0.0);
#endif
#endif
vec4 data1 = clamp( encode(viewToWorld(normal),PackLightmaps), 0.0, 1.0);
gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
@ -556,6 +565,6 @@ void main() {
// gl_FragData[5].xyz = velocity *0.5+0.5;
// #endif
gl_FragData[3] = vec4(FlatNormals * 0.5 + 0.5,VanillaAO);
gl_FragData[3] = vec4(FlatNormals * 0.5 + 0.5, VanillaAO);
#endif
}

View File

@ -95,6 +95,7 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
vec2(-7.,-1.)/8.,
vec2(3,7.)/8.,
vec2(7.,-7.)/8.);
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
vec4 toClipSpace3(vec3 viewSpacePosition) {
@ -379,19 +380,21 @@ void main() {
#endif
#ifdef DOF_JITTER
vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
jitter = rotate(radians(float(frameCounter))) * jitter;
jitter.y *= aspectRatio;
jitter.x *= DOF_ANAMORPHIC_RATIO;
#if DOF_QUALITY == 5
vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
jitter = rotate(radians(float(frameCounter))) * jitter;
jitter.y *= aspectRatio;
jitter.x *= DOF_ANAMORPHIC_RATIO;
#if DOF_JITTER_FOCUS < 0
float focusMul = gl_Position.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusMul = gl_Position.z - DOF_JITTER_FOCUS;
#if MANUAL_FOCUS == -2
float focusMul = 0;
#elif MANUAL_FOCUS == -1
float focusMul = gl_Position.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusMul = gl_Position.z - MANUAL_FOCUS;
#endif
vec2 totalOffset = (jitter * JITTER_STRENGTH) * focusMul * 1e-2;
gl_Position.xy += hideGUI >= 1 ? totalOffset : vec2(0);
#endif
vec2 totalOffset = (jitter * JITTER_STRENGTH) * focusMul * 1e-2;
gl_Position.xy += hideGUI >= 1 ? totalOffset : vec2(0);
#endif
}

View File

@ -370,6 +370,7 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
NdotL = clamp((-15 + NdotL*255.0) / 240.0 ,0.0,1.0);
float Shadows = 1.0;
int shadowmapindicator = 0;
//compute shadows only if not backface
if (NdotL > 0.001) {
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
@ -381,33 +382,41 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
projectedShadowPosition.xy *= distortFactor;
//do shadows only if on shadow map
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution){
const float threshMul = max(2048.0/shadowMapResolution*shadowDistance/128.0,0.95);
float distortThresh = (sqrt(1.0-NdotL*NdotL)/NdotL+0.7)/distortFactor;
float diffthresh = distortThresh/6000.0*threshMul;
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5);
Shadows = 0.0;
float noise = blueNoise();
float rdMul = 4.0/shadowMapResolution;
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5);
#ifdef BASIC_SHADOW_FILTER
const float threshMul = max(2048.0/shadowMapResolution*shadowDistance/128.0,0.95);
float distortThresh = (sqrt(1.0-NdotL*NdotL)/NdotL+0.7)/distortFactor;
float diffthresh = distortThresh/6000.0*threshMul;
for(int i = 0; i < 9; i++){
vec2 offsetS = tapLocation(i,9, 1.618,noise,0.0);
float noise = blueNoise();
float rdMul = 4.0/shadowMapResolution;
float weight = 1.0+(i+noise)*rdMul/9.0*shadowMapResolution;
Shadows += shadow2D(shadow,vec3(projectedShadowPosition + vec3(rdMul*offsetS,-diffthresh*weight))).x/9.0;
}
for(int i = 0; i < 9; i++){
vec2 offsetS = tapLocation(i,9, 1.618,noise,0.0);
float weight = 1.0+(i+noise)*rdMul/9.0*shadowMapResolution;
Shadows += shadow2D(shadow,vec3(projectedShadowPosition + vec3(rdMul*offsetS,-diffthresh*weight))).x/9.0;
}
#else
Shadows = shadow2D(shadow, projectedShadowPosition).x;
#endif
shadowmapindicator = 1;
}
#ifdef CLOUDS_SHADOWS
Shadows *= GetCloudShadow(p3);
#endif
}
if(shadowmapindicator < 1) Shadows = clamp((lmtexcoord.w-0.8) * 5,0,1);
#ifdef CLOUDS_SHADOWS
Shadows *= GetCloudShadow(p3);
#endif
vec3 WS_normal = viewToWorld(normal);
vec3 ambientCoefs = WS_normal/dot(abs(WS_normal),vec3(1.));
float skylight = clamp(abs(ambientCoefs.y+1),0.35,2.0) ;
float skylight = clamp(ambientCoefs.y + 0.5,0.25,2.0);
vec2 lightmaps2 = lmtexcoord.zw;
@ -505,6 +514,6 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
gl_FragData[1] = vec4(Albedo,iswater);
#endif
gl_FragData[3].a = lmtexcoord.w;
gl_FragData[3].a = max(lmtexcoord.w*blueNoise()*0.05 + lmtexcoord.w,0.0);
}
}

View File

@ -159,16 +159,18 @@ void main() {
WsunVec = lightCol.a*normalize(mat3(gbufferModelViewInverse) *sunPosition);
#ifdef DOF_JITTER
#if DOF_QUALITY == 5
vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
jitter = rotate(radians(float(frameCounter))) * jitter;
jitter.y *= aspectRatio;
jitter.x *= DOF_ANAMORPHIC_RATIO;
#if DOF_JITTER_FOCUS < 0
#if MANUAL_FOCUS == -2
float focusMul = 0;
#elif MANUAL_FOCUS == -1
float focusMul = gl_Position.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusMul = gl_Position.z - DOF_JITTER_FOCUS;
float focusMul = gl_Position.z - MANUAL_FOCUS;
#endif
vec2 totalOffset = (jitter * JITTER_STRENGTH) * focusMul * 1e-2;

View File

@ -120,6 +120,11 @@ screen.Clouds = Cloud Settings
screen.Climate = Climate Settings
option.Seasons = Seasonal Colors
option.Season_Length = Season Length (In Days)
option.Start_Season = Starting Season
value.Start_Season.0 = Summer (Default)
value.Start_Season.1 = Fall
value.Start_Season.2 = Winter
value.Start_Season.3 = Spring
option.Snowy_Winter = Snow During Winter
screen.Summer_colors = Summer Colors
option.Summer_R = Red Amount
@ -235,8 +240,11 @@ option.DOF_QUALITY=Depth Of Field
value.DOF_QUALITY.2=Medium
value.DOF_QUALITY.3=High
value.DOF_QUALITY.4=Ultra
value.DOF_QUALITY.5=Jitter
option.MANUAL_FOCUS=Focus
option.DOF_ANAMORPHIC_RATIO=Anamorphic Ratio
value.DOF_JITTER_FOCUS.-1=Brightness Slider
value.MANUAL_FOCUS.-2=Autofocus
value.MANUAL_FOCUS.-1=Brightness Slider
value.FOCUS_LASER_COLOR.0=Red
value.FOCUS_LASER_COLOR.1=Green
value.FOCUS_LASER_COLOR.2=Blue
@ -275,7 +283,7 @@ screen.Shadows.comment = Configure the shadows from the sun to your liking.
option.Variable_Penumbra_Shadows.comment = This effect softens the shadows more and more the farther the shadow gets from what casted it. This effect is used to create higher quality shadows and Sub-surface scattering. §aPERFORMANCE COST:§r low to high;
option.VPS_Search_Samples.comment = The quality of the variable penumbra shadow filter. §aPERFORMANCE COST:§r low to high; Increasing this should reduce some noise in the sub-surface scattering and very soft shadows.
option.Max_Shadow_Filter_Radius.comment = The maximum softness the shadows can get when far away from what casted it.
option.Max_Filter_Depth = Configure the size of the sun. If the sun is larger, shadows get softer closer to what casts them.
option.Max_Filter_Depth.comment = Configure the size of the sun. If the sun is larger, shadows get softer closer to what casts them.
screen.Ambient_light.comment = Configure settings related to the lighting in shaded places
option.AO_Strength.comment = Configure the strength of the ambient occlusion created by SSAO, GTAO, RTAO, and SSGI. §bWhat is this?§r ambient occlusion is the small soft shadows in corners and such.

View File

@ -400,7 +400,7 @@
vec2(-0.992326501717018, -0.062069798758671524)
);
#endif
#if defined(DOF_JITTER) || defined(DOF_JITTER_SHADOW) // DOF_QUALITY == 5 && defined(SCREENSHOT_MODE)
#if DOF_QUALITY == 5 || defined(DOF_JITTER_SHADOW) // DOF_QUALITY == 5 && defined(SCREENSHOT_MODE)
const vec2 jitter_offsets[64] = vec2[](
vec2(0.08838834764831845, 0),
vec2(-0.1846432401149469, -0.8598513673187094),

View File

@ -48,7 +48,7 @@
int SeasonLength = Season_Length;
// loop the year. multiply the season length by the 4 seasons to create a years time.
float YearLoop = mod(worldDay, SeasonLength * 4);
float YearLoop = mod(worldDay + Start_Season * SeasonLength, SeasonLength * 4);
// the time schedule for each season
float SummerTime = clamp(YearLoop ,0, SeasonLength) / SeasonLength;

View File

@ -38,6 +38,7 @@
#define Seasons
#define Season_Length 24 // [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91]
#define Start_Season 0 // [0 1 2 3]
#define Snowy_Winter
#define Summer_R 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
@ -118,8 +119,9 @@ const float shadowDistanceRenderMul = -1.0; // [-1.0 1.0]
#define VPS_Search_Samples 4 // [4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
#define Min_Shadow_Filter_Radius 5.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
#define Max_Shadow_Filter_Radius 30.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
#define Max_Filter_Depth 20.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
#define Max_Filter_Depth 99.0 // [0.1 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 220.0]
#define BASIC_SHADOW_FILTER
#define SHADOW_FILTER_SAMPLE_COUNT 13 // [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 ]
#define SHADOW_DISABLE_ALPHA_MIPMAPS
#define Stochastic_Transparent_Shadows
@ -320,17 +322,16 @@ uniform int moonPhase;
// ----- DEPTH OF FIELD RELATED SETTINGS ----- //
/////////////////////////////////////////////////
#define DOF_QUALITY -1 // [-1 0 1 2 3 4]
#define DOF_QUALITY -1 // [-1 0 1 2 3 4 5]
#define DOF_ANAMORPHIC_RATIO 1.0 // [0.3 0.6 1.0]
#define AUTOFOCUS
// // #define AUTOFOCUS
//#define FAR_BLUR_ONLY
#define focal 2.4 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
#define aperture 0.8 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
#define MANUAL_FOCUS 48.0 // [0.06948345122280154 0.07243975703425146 0.07552184450877376 0.07873506526686186 0.0820849986238988 0.08557746127787037 0.08921851740926011 0.09301448921066349 0.09697196786440505 0.10109782498721881 0.10539922456186433 0.10988363537639657 0.11455884399268773 0.11943296826671962 0.12451447144412296 0.129812176855438 0.1353352832366127 0.1410933807013415 0.1470964673929768 0.15335496684492847 0.1598797460796939 0.16668213447794653 0.17377394345044514 0.18116748694692214 0.18887560283756183 0.19691167520419406 0.20528965757990927 0.21402409717744744 0.22313016014842982 0.2326236579172927 0.2425210746356487 0.25283959580474646 0.26359713811572677 0.27481238055948964 0.2865047968601901 0.29869468928867837 0.3114032239145977 0.32465246735834974 0.3384654251067422 0.3528660814588489 0.36787944117144233 0.3835315728763107 0.39984965434484737 0.4168620196785084 0.4345982085070782 0.453089017280169 0.4723665527410147 0.49246428767540973 0.513417119032592 0.5352614285189903 0.5580351457700471 0.5817778142098083 0.6065306597126334 0.6323366621862497 0.6592406302004438 0.6872892787909722 0.7165313105737893 0.7470175003104326 0.7788007830714049 0.8119363461506349 0.8464817248906141 0.8824969025845955 0.9200444146293233 0.9591894571091382 1.0 1.0425469051899914 1.086904049521229 1.1331484530668263 1.1813604128656459 1.2316236423470497 1.2840254166877414 1.338656724353094 1.3956124250860895 1.4549914146182013 1.5168967963882134 1.5814360605671443 1.6487212707001282 1.7188692582893286 1.7920018256557555 1.8682459574322223 1.9477340410546757 2.030604096634748 2.117000016612675 2.2070718156067044 2.300975890892825 2.398875293967098 2.5009400136621287 2.6073472713092674 2.718281828459045 2.833936307694169 2.9545115270921065 3.080216848918031 3.211270543153561 3.347900166492527 3.4903429574618414 3.638846248353525 3.7936678946831774 3.955076722920577 4.123352997269821 4.298788906309526 4.4816890703380645 4.672371070304759 4.871165999245474 5.0784190371800815 5.29449005047003 5.51975421667673 5.754602676005731 5.999443210467818 6.254700951936329 6.5208191203301125 6.798259793203881 7.087504708082256 7.38905609893065 7.703437568215379 8.031194996067258 8.372897488127265 8.72913836372013 9.10053618607165 9.487735836358526 9.891409633455755 10.312258501325767 10.751013186076355 11.208435524800691 11.685319768402522 12.182493960703473 12.700821376227164 13.241202019156521 13.804574186067095 14.391916095149892 15.00424758475255 15.642631884188171 16.30817745988666 17.00203994009402 17.725424121461643 18.479586061009854 19.265835257097933 20.085536923187668 20.940114358348602 21.831051418620845 22.75989509352673 23.728258192205157 24.737822143832553 25.790339917193062 26.88763906446752 28.03162489452614 29.22428378123494 30.46768661252054 31.763992386181833 33.11545195869231 34.52441195350251 35.99331883562839 37.524723159600995 39.12128399815321 40.78577355933337 42.52108200006278 44.3302224444953 46.21633621589248 48.182698291098816 50.23272298708815 52.36996988945491 54.598150033144236 56.92113234615337 59.34295036739207 61.867809250367884 64.50009306485578 67.24437240923179 70.10541234668786 73.08818067910767 76.19785657297057 79.43983955226133 82.81975887399955 86.3434833026695 90.01713130052181 93.84708165144015 97.83998453682129 102.00277308269969 106.34267539816554 110.86722712598126 115.58428452718766 120.50203812241894 125.62902691361414 130.9741532108186 136.54669808981876 142.35633750745257 148.4131591025766 154.72767971186107 161.3108636308289 168.17414165184545 175.32943091211476 182.78915558614753 190.56626845863 198.67427341514983 ]
#define MANUAL_FOCUS -2 // [-2 -1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 20 21 22 24 25 26 28 29 30 32 33 35 36 38 40 41 43 45 47 48 50 52 54 56 58 60 63 65 67 70 72 75 77 80 83 85 88 91 94 98 101 104 108 111 115 119 123 127 132 136 141 146 151 156 161 167 173 179 186 193 200 207 215 224 232 242 251 262 273 284 297 310 324 339 355 372 391 411 433 457 483 512]
#define DoF_Adaptation_Speed 1.00 // [0.20 0.21 0.23 0.24 0.25 0.27 0.29 0.30 0.32 0.34 0.36 0.39 0.41 0.43 0.46 0.49 0.52 0.55 0.59 0.62 0.66 0.70 0.74 0.79 0.84 0.89 0.94 1.00 1.06 1.13 1.20 1.27 1.35 1.43 1.52 1.61 1.71 1.82 1.93 2.05 2.18 2.31 2.45 2.60 2.76 2.93 3.11 3.30 3.51 3.72 3.95 4.19 4.45 4.73 5.02 5.33 5.65 6.00]
// #define DOF_JITTER
// #define DOF_JITTER_SHADOW
#define DOF_JITTER_FOCUS 32 // [-1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 20 21 22 24 25 26 28 29 30 32 33 35 36 38 40 41 43 45 47 48 50 52 54 56 58 60 63 65 67 70 72 75 77 80 83 85 88 91 94 98 101 104 108 111 115 119 123 127 132 136 141 146 151 156 161 167 173 179 186 193 200 207 215 224 232 242 251 262 273 284 297 310 324 339 355 372 391 411 433 457 483 512]
// // #define DOF_JITTER_FOCUS 32 // [-1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 20 21 22 24 25 26 28 29 30 32 33 35 36 38 40 41 43 45 47 48 50 52 54 56 58 60 63 65 67 70 72 75 77 80 83 85 88 91 94 98 101 104 108 111 115 119 123 127 132 136 141 146 151 156 161 167 173 179 186 193 200 207 215 224 232 242 251 262 273 284 297 310 324 339 355 372 391 411 433 457 483 512]
#define JITTER_STRENGTH 1.0 // sorry [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0]
#define FOCUS_LASER_COLOR 1 // Red, Green, Blue, Pink, Yellow, White [0 1 2 3 4 5]

View File

@ -192,6 +192,7 @@ vec3 SampleVNDFGGX(
// This gives the normal on the hemisphere
// xonk note, i added those magic numbers huhuhuh
vec3 halfway = reflected*0.5 + viewerDirection*1.5;
// vec3 halfway = reflected + viewerDirection;
// Transform the halfway direction back to hemiellispoid configuation
// This gives the final sampled normal

View File

@ -74,7 +74,7 @@ PhysicsMod_support [LabPBR]
screen.Subsurface_Scattering = SSS_TYPE LabSSS_Curve <empty> MISC_BLOCK_SSS MOB_SSS <empty> Ambient_SSS ambientsss_brightness
screen.Filtering.columns=1
screen.Filtering = SHADOW_FILTER_SAMPLE_COUNT Min_Shadow_Filter_Radius <empty> Variable_Penumbra_Shadows VPS_Search_Samples Max_Shadow_Filter_Radius Max_Filter_Depth
screen.Filtering = BASIC_SHADOW_FILTER SHADOW_FILTER_SAMPLE_COUNT Min_Shadow_Filter_Radius <empty> Variable_Penumbra_Shadows VPS_Search_Samples Max_Shadow_Filter_Radius Max_Filter_Depth
### AMBIENT LIGHT
screen.Ambient_light.columns=1
@ -114,7 +114,7 @@ PhysicsMod_support [LabPBR]
## SEASONS
screen.Seasons.columns=1
screen.Seasons = Seasons Season_Length Snowy_Winter <empty> [Summer_colors] [Fall_colors] [Winter_colors] [Spring_colors]
screen.Seasons = Seasons Season_Length Start_Season Snowy_Winter <empty> [Summer_colors] [Fall_colors] [Winter_colors] [Spring_colors]
screen.Summer_colors.columns=1
screen.Summer_colors = Summer_R Summer_G Summer_B <empty> Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B
@ -176,7 +176,7 @@ PhysicsMod_support [LabPBR]
screen.DepthOfField.columns = 1
screen.DepthOfField = [JITTER_DOF] DOF_QUALITY DOF_ANAMORPHIC_RATIO AUTOFOCUS focal aperture MANUAL_FOCUS DoF_Adaptation_Speed FAR_BLUR_ONLY
screen.JITTER_DOF.columns=1
screen.JITTER_DOF = DOF_JITTER DOF_JITTER_SHADOW DOF_JITTER_FOCUS JITTER_STRENGTH DOF_CAMERA_WIDTH FOCUS_LASER_COLOR <empty> SCREENSHOT_MODE
screen.JITTER_DOF = JITTER_STRENGTH FOCUS_LASER_COLOR SCREENSHOT_MODE
### EXPOSURE
screen.Exposure.columns = 1
screen.Exposure = AUTO_EXPOSURE EXPOSURE_MULTIPLIER Exposure_Speed Manual_exposure_value

View File

@ -31,16 +31,20 @@ uniform float screenBrightness;
uniform vec3 sunVec;
uniform float aspectRatio;
uniform float sunElevation;
uniform vec3 sunPosition;
uniform float lightSign;
uniform float cosFov;
uniform vec3 shadowViewDir;
uniform vec3 shadowCamera;
uniform vec3 shadowLightVec;
uniform float shadowMaxProj;
attribute vec4 mc_Entity;
attribute vec4 mc_midTexCoord;
varying vec4 glcolor;
attribute vec4 mc_Entity;
uniform int blockEntityId;
uniform int entityId;
const float PI48 = 150.796447372*WAVY_SPEED;
float pi2wt = PI48*frameTimeCounter;
@ -96,7 +100,6 @@ vec4 toClipSpace3(vec3 viewSpacePosition) {
}
void main() {
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
// HHHHHHHHH ITS THE JITTER DOF HERE TO SAY HELLO
@ -134,44 +137,36 @@ void main() {
// return;
// }
// #endif
//Check if the vertice is going to cast shadows
// #ifdef SHADOW_FRUSTRUM_CULLING
// if (intersectCone(cosFov, shadowCamera, shadowViewDir, position, -shadowLightVec, shadowMaxProj)) {
// #endif
// #ifdef WAVY_PLANTS
// bool istopv = gl_MultiTexCoord0.t < mc_midTexCoord.t;
// if ((mc_Entity.x == 10001&&istopv) && length(position.xy) < 24.0) {
// vec3 worldpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
// worldpos.xyz += calcMovePlants(worldpos.xyz + cameraPosition)*gl_MultiTexCoord1.y;
// position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz ;
// }
// if ((mc_Entity.x == 10003) && length(position.xy) < 24.0) {
// vec3 worldpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
// worldpos.xyz += calcMoveLeaves(worldpos.xyz + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*gl_MultiTexCoord1.y;
// position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz ;
// }
// #endif
#ifdef WAVY_PLANTS
bool istopv = gl_MultiTexCoord0.t < mc_midTexCoord.t;
if ((mc_Entity.x == 10001&&istopv) && length(position.xy) < 24.0) {
vec3 worldpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
worldpos.xyz += calcMovePlants(worldpos.xyz + cameraPosition)*gl_MultiTexCoord1.y;
position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz ;
}
if ((mc_Entity.x == 10003) && length(position.xy) < 24.0) {
vec3 worldpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
worldpos.xyz += calcMoveLeaves(worldpos.xyz + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*gl_MultiTexCoord1.y;
position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz ;
}
#endif
// gl_Position = BiasShadowProjection_altered(toClipSpace3(position),mat3(shadowProjection),mat3(shadowModelView), gl_NormalMatrix * gl_Normal);
gl_Position = BiasShadowProjection(toClipSpace3(position));
gl_Position.z /= 6.0;
texcoord.xy = gl_MultiTexCoord0.xy;
if(mc_Entity.x == 8 || mc_Entity.x == 9) gl_Position.w = -1.0;
/// this is to ease the shadow acne on big fat entities like ghasts.
#ifdef SHADOW_FRUSTRUM_CULLING
}
else
gl_Position.xyzw = vec4(0.0,0.0,1e30,0.0); //Degenerates the triangle
#endif
float bias = 6.0;
vec3 FlatNormals = normalize(gl_NormalMatrix *gl_Normal);
vec3 WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(shadowModelViewInverse) * sunPosition);
if(entityId == 1100) bias = 6.0 + (1-clamp(dot(WsunVec,FlatNormals),0,1))*0.3;
gl_Position.z /= bias;
}

View File

@ -305,7 +305,7 @@ vec4 blueNoise(vec2 coord){
return texelFetch2D(colortex6, ivec2(coord )%512 , 0);
}
void LabEmission(
void Emission(
inout vec3 Lighting,
vec3 Albedo,
float Emission
@ -467,7 +467,7 @@ void main() {
MaterialReflections_N(gl_FragData[0].rgb, SpecularTex.r, SpecularTex.ggg, albedo, normal, np3, fragpos, vec3(blueNoise(gl_FragCoord.xy).rg,noise), hand);
#endif
LabEmission(gl_FragData[0].rgb, albedo, SpecularTex.a);
Emission(gl_FragData[0].rgb, albedo, SpecularTex.a);
if(lightningBolt) gl_FragData[0].rgb += vec3(Lightning_R,Lightning_G,Lightning_B) ;

View File

@ -303,7 +303,7 @@ vec4 blueNoise(vec2 coord){
return texelFetch2D(colortex6, ivec2(coord )%512 , 0);
}
void LabEmission(
void Emission(
inout vec3 Lighting,
vec3 Albedo,
float Emission
@ -459,7 +459,7 @@ void main() {
if(!hand) gl_FragData[0].rgb *= ssao(fragpos,noise,FlatNormals) * AO;
LabEmission(gl_FragData[0].rgb, albedo, SpecularTex.a);
Emission(gl_FragData[0].rgb, albedo, SpecularTex.a);
if(lightningBolt) gl_FragData[0].rgb = LightColor * 10 ;