diff --git a/CREDITS.txt b/CREDITS.txt index 5319f6f..297f383 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -4,7 +4,7 @@ Credit to the creator of the entire shader that Bliss is an edit of: -Credit to the creators of various code, code contributions, or code snippets: +Credit to the creators of code contributions, various code uses, or code snippets: EminGt / https://github.com/EminGT Gri573 / https://github.com/gri573 diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index 92937a4..849071f 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -8,6 +8,7 @@ varying vec4 lmtexcoord; varying vec4 color; +flat varying float exposure; #ifdef LINES flat varying int SELECTION_BOX; @@ -34,7 +35,6 @@ uniform int isEyeInWater; uniform sampler2D texture; uniform sampler2D noisetex; uniform sampler2D colortex4; - #ifdef IS_LPV_ENABLED uniform sampler3D texLpv1; uniform sampler3D texLpv2; @@ -118,6 +118,135 @@ float encodeVec2(float x,float y){ } + +// #undef BASIC_SHADOW_FILTER +#ifdef OVERWORLD_SHADER +float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDistFade){ + + if(maxDistFade <= 0.0) return 1.0; + + // setup shadow projection + vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz; + projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; + + // un-distort + #ifdef DISTORT_SHADOWMAP + float distortFactor = calcDistort(projectedShadowPosition.xy); + projectedShadowPosition.xy *= distortFactor; + #else + float distortFactor = 1.0; + #endif + + // hamburger + projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5); + + float shadowmap = 0.0; + vec3 translucentTint = vec3(0.0); + + #ifdef TRANSLUCENT_COLORED_SHADOWS + + // determine when opaque shadows are overlapping translucent shadows by getting the difference of opaque depth and translucent depth + float shadowDepthDiff = pow(clamp((shadow2D(shadowtex1, projectedShadowPosition).x - projectedShadowPosition.z) * 2.0,0.0,1.0),2.0); + + // get opaque shadow data to get opaque data from translucent shadows. + float opaqueShadow = shadow2D(shadowtex0, projectedShadowPosition).x; + shadowmap += max(opaqueShadow, shadowDepthDiff); + + // get translucent shadow data + vec4 translucentShadow = texture2D(shadowcolor0, projectedShadowPosition.xy); + + // this curve simply looked the nicest. it has no other meaning. + float shadowAlpha = pow(1.0 - pow(translucentShadow.a,5.0),0.2); + + // normalize the color to remove luminance, and keep the hue. remove all opaque color. + // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + + // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 + translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); + + #else + shadowmap += shadow2D(shadow, projectedShadowPosition).x; + #endif + + #ifdef TRANSLUCENT_COLORED_SHADOWS + // tint the lightsource color with the translucent shadow color + directLightColor *= mix(vec3(1.0), translucentTint.rgb, maxDistFade); + #endif + + return mix(1.0, shadowmap, maxDistFade); +} +#endif + +#if defined DAMAGE_BLOCK_EFFECT && defined POM +#extension GL_ARB_shader_texture_lod : enable + +mat3 inverseMatrix(mat3 m) { + float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2]; + float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2]; + float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2]; + + float b01 = a22 * a11 - a12 * a21; + float b11 = -a22 * a10 + a12 * a20; + float b21 = a21 * a10 - a11 * a20; + + float det = a00 * b01 + a01 * b11 + a02 * b21; + + return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11), + b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10), + b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det; +} +const float MAX_OCCLUSION_DISTANCE = MAX_DIST; +const float MIX_OCCLUSION_DISTANCE = MAX_DIST*0.9; +const int MAX_OCCLUSION_POINTS = MAX_ITERATIONS; + +varying vec4 vtexcoordam; // .st for add, .pq for mul +varying vec4 vtexcoord; + +vec2 dcdx = dFdx(vtexcoord.st*vtexcoordam.pq)*exp2(Texture_MipMap_Bias); +vec2 dcdy = dFdy(vtexcoord.st*vtexcoordam.pq)*exp2(Texture_MipMap_Bias); + + +#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z) +#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz) + +uniform mat4 gbufferProjection; + +vec3 toClipSpace3(vec3 viewSpacePosition) { + return projMAD(gbufferProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5; +} + + flat varying vec3 WsunVec2; +const float mincoord = 1.0/4096.0; +const float maxcoord = 1.0-mincoord; + + uniform sampler2D normals; + varying vec4 tangent; + varying vec4 normalMat; + + vec4 readNormal(in vec2 coord) + { + return texture2DGradARB(normals,fract(coord)*vtexcoordam.pq+vtexcoordam.st,dcdx,dcdy); + } + vec4 readTexture(in vec2 coord) + { + return texture2DGradARB(texture,fract(coord)*vtexcoordam.pq+vtexcoordam.st,dcdx,dcdy); + } +#endif +uniform float near; +// uniform float far; +float ld(float dist) { + return (2.0 * near) / (far + near - dist * (far - near)); +} + +vec3 texture2D_POMSwitch( + sampler2D sampler, + vec2 lightmapCoord, + vec4 dcdxdcdy +){ + return texture2DGradARB(sampler, lightmapCoord, dcdxdcdy.xy, dcdxdcdy.zw).rgb; +} + //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// @@ -132,6 +261,73 @@ float encodeVec2(float x,float y){ void main() { +#ifdef DAMAGE_BLOCK_EFFECT + vec2 adjustedTexCoord = lmtexcoord.xy; + #ifdef POM + vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(0.0)); + vec3 worldpos = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz + cameraPosition; + + vec3 normal = normalMat.xyz; + vec3 tangent2 = normalize(cross(tangent.rgb,normal)*tangent.w); + mat3 tbnMatrix = mat3(tangent.x, tangent2.x, normal.x, + tangent.y, tangent2.y, normal.y, + tangent.z, tangent2.z, normal.z); + + adjustedTexCoord = fract(vtexcoord.st)*vtexcoordam.pq+vtexcoordam.st; + vec3 viewVector = normalize(tbnMatrix*fragpos); + + float dist = length(fragpos); + + float maxdist = MAX_OCCLUSION_DISTANCE; + + // float depth = gl_FragCoord.z; + if (dist < maxdist) { + + float depthmap = readNormal(vtexcoord.st).a; + float used_POM_DEPTH = 1.0; + + if ( viewVector.z < 0.0 && depthmap < 0.9999 && depthmap > 0.00001) { + + #ifdef Adaptive_Step_length + vec3 interval = (viewVector.xyz /-viewVector.z/MAX_OCCLUSION_POINTS * POM_DEPTH) * clamp(1.0-pow(depthmap,2),0.1,1.0); + used_POM_DEPTH = 1.0; + #else + vec3 interval = viewVector.xyz/-viewVector.z/ MAX_OCCLUSION_POINTS*POM_DEPTH; + #endif + vec3 coord = vec3(vtexcoord.st, 1.0); + + coord += interval * used_POM_DEPTH; + + float sumVec = 0.5; + for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - POM_DEPTH + POM_DEPTH * readNormal(coord.st).a ) < coord.p && coord.p >= 0.0; ++loopCount) { + coord = coord + interval * used_POM_DEPTH; + sumVec += used_POM_DEPTH; + } + + if (coord.t < mincoord) { + if (readTexture(vec2(coord.s,mincoord)).a == 0.0) { + coord.t = mincoord; + discard; + } + } + + adjustedTexCoord = mix(fract(coord.st)*vtexcoordam.pq+vtexcoordam.st, adjustedTexCoord, max(dist-MIX_OCCLUSION_DISTANCE,0.0)/(MAX_OCCLUSION_DISTANCE-MIX_OCCLUSION_DISTANCE)); + + // vec3 truePos = fragpos + sumVec*inverseMatrix(tbnMatrix)*interval; + + // depth = toClipSpace3(truePos).z; + } + } + + vec3 Albedo = toLinear(texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy))); + #else + vec3 Albedo = toLinear(texture2D(texture, adjustedTexCoord.xy).rgb); + #endif + + gl_FragData[0] = vec4(encodeVec2(vec2(0.5)), encodeVec2(Albedo.rg), encodeVec2(vec2(Albedo.b,0.02)), 1.0); +#endif + +#if !defined DAMAGE_BLOCK_EFFECT #ifdef LINES #ifndef SELECT_BOX if(SELECTION_BOX > 0) discard; @@ -145,8 +341,9 @@ void main() { vec4 TEXTURE = texture2D(texture, lmtexcoord.xy)*color; - - + #ifdef WhiteWorld + TEXTURE.rgb = vec3(0.5); + #endif vec3 Albedo = toLinear(TEXTURE.rgb); @@ -160,104 +357,77 @@ void main() { lightmap.x = max(lightmap.x, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(viewPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0)); #endif - - #ifdef WEATHER gl_FragData[1].a = TEXTURE.a; // for bloomy rain and stuff #endif - -#ifndef WEATHER - #ifndef LINES - gl_FragData[0].a = TEXTURE.a; - #else - gl_FragData[0].a = 1.0; - #endif - #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 MinimumLightColor = vec3(1.0); - if(isEyeInWater == 1) MinimumLightColor = vec3(10.0); - - vec3 Torch_Color = vec3(TORCH_R,TORCH_G,TORCH_B); - - - if(lightmap.x >= 0.9) Torch_Color *= LIT_PARTICLE_BRIGHTNESS; - - #ifdef OVERWORLD_SHADER - vec3 Shadows = vec3(1.0); - - vec3 feetPlayerPos_shadow = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; - vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos_shadow + shadowModelView[3].xyz; - projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; - - //apply distortion - #ifdef DISTORT_SHADOWMAP - float distortFactor = calcDistort(projectedShadowPosition.xy); - projectedShadowPosition.xy *= distortFactor; - #else - float distortFactor = 1.0; - #endif - - //do shadows only if on shadow map - if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution){ - Shadows = vec3(0.0); - - projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5); - - #ifdef TRANSLUCENT_COLORED_SHADOWS - float opaqueShadow = shadow2D(shadowtex0, projectedShadowPosition).x; - Shadows += vec3(opaqueShadow); - - if(shadow2D(shadowtex1, projectedShadowPosition).x > projectedShadowPosition.z){ - vec4 translucentShadow = texture2D(shadowcolor0, projectedShadowPosition.xy); - if(translucentShadow.a < 0.9) Shadows += normalize(translucentShadow.rgb+0.0001) * (1.0-opaqueShadow); - } - #else - Shadows = vec3(shadow2D(shadow, projectedShadowPosition).x); - #endif - } - - float cloudShadow = GetCloudShadow(feetPlayerPos); - - Direct_lighting = (lightCol.rgb/80.0) * Shadows * cloudShadow; - - + #ifndef WEATHER #ifndef LINES - Direct_lighting *= phaseg(clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), 0.65)*2 + 0.5; + gl_FragData[0].a = TEXTURE.a; + #else + gl_FragData[0].a = 1.0; + #endif + #ifndef BLOOMY_PARTICLES + gl_FragData[1].a = 0.0; // for bloomy rain and stuff #endif - vec3 AmbientLightColor = (averageSkyCol_Clouds / 30.0) * 3.0; + vec3 Direct_lighting = vec3(0.0); + vec3 directLightColor = vec3(0.0); + + vec3 Indirect_lighting = vec3(0.0); + vec3 AmbientLightColor = vec3(0.0); + vec3 Torch_Color = vec3(TORCH_R,TORCH_G,TORCH_B); + vec3 MinimumLightColor = vec3(1.0); + + if(isEyeInWater == 1) MinimumLightColor = vec3(10.0); + if(lightmap.x >= 0.9) Torch_Color *= LIT_PARTICLE_BRIGHTNESS; + + #ifdef OVERWORLD_SHADER + directLightColor = lightCol.rgb/80.0; + float Shadows = 1.0; + + vec3 shadowPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; + + float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(shadowPlayerPos) / (shadowDistance+16),0.0)*5.0,1.0)); + float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(shadowPlayerPos) / (shadowDistance+11),0.0)*5.0,1.0)); + + float LM_shadowMapFallback = min(max(lightmap.y-0.8, 0.0) * 25,1.0); + + Shadows = ComputeShadowMap(directLightColor, shadowPlayerPos, shadowMapFalloff); + + Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2); + + float cloudShadow = GetCloudShadow(feetPlayerPos); + + Direct_lighting = directLightColor * Shadows * cloudShadow; + + #ifndef LINES + Direct_lighting *= phaseg(clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), 0.65)*2 + 0.5; + #endif + + AmbientLightColor = averageSkyCol_Clouds / 30.0; + AmbientLightColor *= 2.5; + #endif + + #ifdef IS_LPV_ENABLED + vec3 lpvPos = GetLpvPosition(feetPlayerPos); + #else + const vec3 lpvPos = vec3(0.0); + #endif + + Indirect_lighting = DoAmbientLightColor(lpvPos, AmbientLightColor, MinimumLightColor, Torch_Color, clamp(lightmap.xy,0,1), exposure); + + #ifdef LINES + gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * toLinear(color.rgb); + #else + gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * Albedo; + #endif + + // distance fade targeting the world border... + if(TEXTURE.a < 0.7 && TEXTURE.a > 0.2) gl_FragData[0] *= clamp(1.0 - length(feetPlayerPos) / 100.0 ,0.0,1.0); + + gl_FragData[0].rgb *= 0.1; #endif - - #ifdef NETHER_SHADER - // vec3 AmbientLightColor = skyCloudsFromTexLOD2(vec3( 0, 1, 0), colortex4, 6).rgb / 15; - vec3 AmbientLightColor = vec3(0.1); - #endif - - #ifdef END_SHADER - vec3 AmbientLightColor = vec3(1.0); - #endif - - Indirect_lighting = DoAmbientLightColor(feetPlayerPos, AmbientLightColor,MinimumLightColor, Torch_Color, clamp(lightmap.xy,0,1)); - - #ifdef LINES - gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * toLinear(color.rgb); - #else - gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * Albedo; - #endif - - #ifdef DAMAGE_BLOCK_EFFECT - - gl_FragData[0] = vec4(0.0, encodeVec2(TEXTURE.rg), encodeVec2(vec2(TEXTURE.b,0.0)), TEXTURE.a); - #endif - - // distance fade targeting the world border... - if(TEXTURE.a < 0.7 && TEXTURE.a > 0.2) gl_FragData[0] *= clamp(1.0 - length(feetPlayerPos) / 100.0 ,0.0,1.0); #endif } \ No newline at end of file diff --git a/shaders/dimensions/all_solid.fsh b/shaders/dimensions/all_solid.fsh index d675dd0..b2a24ad 100644 --- a/shaders/dimensions/all_solid.fsh +++ b/shaders/dimensions/all_solid.fsh @@ -280,12 +280,10 @@ vec4 texture2D_POMSwitch( //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// -varying vec3 pos; - -#ifdef HAND - /* RENDERTARGETS: 1,7,8,15,2 */ +#if defined HAND || defined ENTITIES + /* RENDERTARGETS:1,7,8,15,2 */ #else - /* RENDERTARGETS: 1,7,8,15 */ + /* RENDERTARGETS:1,7,8,15 */ #endif void main() { @@ -312,19 +310,9 @@ void main() { vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0)); vec3 worldpos = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz + cameraPosition; - // #if defined DH_OVERDRAW_PREVENTION && defined DISTANT_HORIZONS - // // overdraw prevention - // if(clamp(1.0-length(pos.xyz)/max(far - 16.0 * sqrt(interleaved_gradientNoise_temporal()),0.0),0.0,1.0) <= 0.0 ){ - // discard; - // return; - // } - // #endif - float torchlightmap = lmtexcoord.z; #ifdef Hand_Held_lights - - if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(fragpos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0)); #ifdef HAND @@ -365,7 +353,7 @@ void main() { float used_POM_DEPTH = 1.0; if ( viewVector.z < 0.0 && depthmap < 0.9999 && depthmap > 0.00001) { - float noise = blueNoise(); + // float noise = blueNoise(); #ifdef Adaptive_Step_length vec3 interval = (viewVector.xyz /-viewVector.z/MAX_OCCLUSION_POINTS * POM_DEPTH) * clamp(1.0-pow(depthmap,2),0.1,1.0); used_POM_DEPTH = 1.0; @@ -374,9 +362,9 @@ void main() { #endif vec3 coord = vec3(vtexcoord.st , 1.0); - coord += interval * noise * used_POM_DEPTH; + coord += interval * used_POM_DEPTH; - float sumVec = noise; + float sumVec = 0.5; for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - POM_DEPTH + POM_DEPTH * readNormal(coord.st).a ) < coord.p && coord.p >= 0.0; ++loopCount) { coord = coord + interval * used_POM_DEPTH; sumVec += used_POM_DEPTH; @@ -392,13 +380,11 @@ void main() { adjustedTexCoord = mix(fract(coord.st)*vtexcoordam.pq+vtexcoordam.st, adjustedTexCoord, max(dist-MIX_OCCLUSION_DISTANCE,0.0)/(MAX_OCCLUSION_DISTANCE-MIX_OCCLUSION_DISTANCE)); vec3 truePos = fragpos + sumVec*inverseMatrix(tbnMatrix)*interval; - // #ifdef Depth_Write_POM - gl_FragDepth = toClipSpace3(truePos).z; - // #endif + + gl_FragDepth = toClipSpace3(truePos).z; } } #endif - if(!ifPOM) adjustedTexCoord = lmtexcoord.xy; @@ -408,7 +394,6 @@ void main() { float textureLOD = bias(); vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD) * color; - #if defined HAND if (Albedo.a < 0.1) discard; #endif @@ -432,7 +417,7 @@ void main() { blockID == BLOCK_SSS_STRONG || blockID == BLOCK_SSS_WEAK || blockID >= 10 && blockId < 80 ) { - // IR Reflective (Pink-red) + // IR Reflective (Pink-red) Albedo.rgb = mix(vec3(gray), aerochrome_color, 0.7); } else if(blockID == BLOCK_GRASS) { @@ -462,10 +447,14 @@ void main() { if (Albedo.a > 0.1){ Albedo.a = 0.75; gl_FragData[4].a = 0.0; - } else Albedo.a = 1.0; - + } else { + Albedo.a = 1.0; + } #endif + #ifdef ENTITIES + gl_FragData[4].a = 0.0; + #endif //////////////////////////////// //////////////////////////////// //////////////////////////////// NORMAL //////////////////////////////// @@ -483,15 +472,14 @@ void main() { NormalTex.xy = NormalTex.xy * 2.0-1.0; NormalTex.z = sqrt(max(1.0 - dot(NormalTex.xy, NormalTex.xy), 0.0)); - #if defined HEIGTHMAP_DEPTH_OFFSET && !defined HAND - gl_FragDepth = gl_FragCoord.z; - vec3 truePos = fragpos; - truePos.z -= Heightmap * POM_DEPTH * (1.0 + ld(truePos.z)); + // #if defined HEIGTHMAP_DEPTH_OFFSET && !defined HAND + // gl_FragDepth = gl_FragCoord.z; + // vec3 truePos = fragpos; + // truePos.z -= Heightmap * POM_DEPTH * (1.0 + ld(truePos.z)); - gl_FragDepth = toClipSpace3(truePos).z; - #endif + // gl_FragDepth = toClipSpace3(truePos).z; + // #endif - normal = applyBump(tbnMatrix, NormalTex.xyz, mix(1.0,1-Puddle_shape,rainfall) ); // normal = applyBump(tbnMatrix, NormalTex.xyz, 0.0); #endif @@ -572,10 +560,6 @@ void main() { // apply noise to lightmaps to reduce banding. vec2 PackLightmaps = vec2(torchlightmap, lmtexcoord.w); - #if !defined ENTITIES && !defined HAND - // PackLightmaps = clamp(PackLightmaps*blueNoise()*0.05 + PackLightmaps,0.0,1.0); - #endif - vec4 data1 = clamp( encode(viewToWorld(normal), PackLightmaps), 0.0, 1.0); // gl_FragData[0] = vec4(.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)); diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index 82d9ebc..29fce04 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -185,26 +185,18 @@ float luma(vec3 color) { //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// - -varying vec3 pos; void main() { gl_Position = ftransform(); - vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz; - pos = position; - /////// ----- COLOR STUFF ----- /////// color = gl_Color; VanillaAO = 1.0 - clamp(color.a,0,1); if (color.a < 0.3) color.a = 1.0; // fix vanilla ao on some custom block models. - - - /////// ----- RANDOM STUFF ----- /////// // gl_TextureMatrix[0] for animated things like charged creepers lmtexcoord.xy = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; @@ -217,7 +209,8 @@ void main() { vtexcoord.xy = sign(texcoordminusmid)*0.5+0.5; // #endif - vec2 lmcoord = gl_MultiTexCoord1.xy / 255.0; // is this even correct? lol' + + vec2 lmcoord = gl_MultiTexCoord1.xy / 240.0; lmtexcoord.zw = lmcoord; @@ -239,7 +232,6 @@ void main() { SIGN = 0; #ifdef WORLD - // disallow POM to work on signs. if(blockEntityId == BLOCK_SIGN) SIGN = 1; if(blockEntityId == BLOCK_END_PORTAL) PORTAL = 1; @@ -257,7 +249,6 @@ void main() { // if( dot(gl_Color.rgb, vec3(1.0/3.0)) < 1.0) NameTags = 1; // if(gl_Color.a < 1.0) NameTags = 1; // if(gl_Color.a >= 0.24 && gl_Color.a <= 0.25 ) gl_Position = vec4(10,10,10,1); - if(entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SSS_WEAK || entityId == ENTITY_PLAYER || entityId == 2468) normalMat.a = 0.45; #endif @@ -265,8 +256,8 @@ void main() { if(mc_Entity.x == BLOCK_AIR_WAVING) normalMat.a = 0.55; /////// ----- EMISSIVE STUFF ----- /////// - EMISSIVE = 0.0; - LIGHTNING = 0; + EMISSIVE = 0.0; + LIGHTNING = 0; // if(NameTags > 0) EMISSIVE = 0.9; // normal block lightsources @@ -281,18 +272,16 @@ void main() { #endif /////// ----- SSS STUFF ----- /////// - SSSAMOUNT = 0.0; + SSSAMOUNT = 0.0; HELD_ITEM_BRIGHTNESS = 0.0; #ifdef Hand_Held_lights - if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_ITEM_BRIGHTNESS = 0.9; +if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_ITEM_BRIGHTNESS = 0.9; #endif #ifdef WORLD - - /////// ----- SSS ON BLOCKS ----- /////// // strong if ( @@ -311,7 +300,6 @@ void main() { ) { SSSAMOUNT = 0.75; } - // low #ifdef MISC_BLOCK_SSS if(mc_Entity.x == BLOCK_SSS_WEIRD || mc_Entity.x == BLOCK_GRASS) SSSAMOUNT = 0.5; // weird SSS on blocks like grass and stuff @@ -352,7 +340,7 @@ void main() { mc_Entity.x == BLOCK_SAPLING ) && istopv && abs(position.z) < 64.0 ) { - vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz + cameraPosition; + vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz + cameraPosition; worldpos.xyz += calcMovePlants(worldpos.xyz)*lmtexcoord.w - cameraPosition; position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz; } @@ -363,9 +351,7 @@ void main() { position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz; } #endif - gl_Position = toClipSpace3(position); - #endif #if defined Seasons && defined WORLD && !defined ENTITIES && !defined BLOCKENTITIES && !defined HAND diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index e8760ab..c1087fd 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -8,6 +8,7 @@ varying vec4 lmtexcoord; varying vec4 color; +uniform vec4 entityColor; #ifdef OVERWORLD_SHADER const bool shadowHardwareFiltering = true; @@ -26,14 +27,7 @@ varying vec4 color; flat varying vec4 lightCol; #endif -#ifdef BLOCKENTITIES - #undef WATER_REFLECTIONS -#endif -#ifdef ENTITIES - #undef WATER_BACKGROUND_SPECULAR - #undef SCREENSPACE_REFLECTIONS -#endif flat varying float HELD_ITEM_BRIGHTNESS; @@ -41,10 +35,14 @@ const bool colortex4MipmapEnabled = true; uniform sampler2D noisetex; uniform sampler2D depthtex1; uniform sampler2D depthtex0; +#ifdef DISTANT_HORIZONS uniform sampler2D dhDepthTex1; +#endif +uniform sampler2D colortex7; uniform sampler2D colortex12; uniform sampler2D colortex14; uniform sampler2D colortex5; +uniform sampler2D colortex6; uniform sampler2D texture; uniform sampler2D specular; @@ -61,6 +59,7 @@ varying vec3 binormal; varying vec3 flatnormal; +flat varying float exposure; uniform vec3 sunVec; @@ -114,26 +113,22 @@ uniform vec3 nsunColor; #endif #include "/lib/diffuse_lighting.glsl" - float blueNoise(){ return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter); } -float R2_dither(){ - vec2 alpha = vec2(0.75487765, 0.56984026); - return fract(alpha.x * gl_FragCoord.x + alpha.y * gl_FragCoord.y + 1.0/1.6180339887 * frameCounter) ; +float interleaved_gradientNoise_temporal(){ + return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+frameTimeCounter*51.9521); } float interleaved_gradientNoise(){ - vec2 coord = gl_FragCoord.xy + (frameCounter%40000); - // vec2 coord = gl_FragCoord.xy + frameTimeCounter; - // vec2 coord = gl_FragCoord.xy; - float noise = fract( 52.9829189 * fract( (coord.x * 0.06711056) + (coord.y * 0.00583715)) ); - return noise ; -} -float interleaved_gradientNoise(float temporal){ vec2 coord = gl_FragCoord.xy; - float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y)+temporal); + float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y)); return noise; } +float R2_dither(){ + vec2 coord = gl_FragCoord.xy + (frameCounter%40000) * 2.0; + vec2 alpha = vec2(0.75487765, 0.56984026); + return fract(alpha.x * coord.x + alpha.y * coord.y ) ; +} const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), vec2(-1.,3.)/8., @@ -150,35 +145,26 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), -#define PW_DEPTH 1.0 //[0.5 1.0 1.5 2.0 2.5 3.0] -#define PW_POINTS 1 //[2 4 6 8 16 32] +#define PW_DEPTH 1.5 //[0.5 1.0 1.5 2.0 2.5 3.0] +#define PW_POINTS 2 //[2 4 6 8 16 32] varying vec3 viewVector; vec3 getParallaxDisplacement(vec3 posxz) { vec3 parallaxPos = posxz; - vec2 vec = viewVector.xy * (1.0 / float(PW_POINTS)) * 22.0; - float waterHeight = getWaterHeightmap(posxz.xz); - parallaxPos.xz += waterHeight * vec; + vec2 vec = viewVector.xy * (1.0 / float(PW_POINTS)) * 22.0 * PW_DEPTH; + // float waterHeight = (1.0 - (getWaterHeightmap(posxz.xz)*0.5+0.5)) * 2.0 - 1.0; + float waterHeight = getWaterHeightmap(posxz.xz) * 2.0; + parallaxPos.xz -= waterHeight * vec; return parallaxPos; } -// vec3 getParallaxDisplacement(vec3 posxz,float bumpmult,vec3 viewVec) { - -// vec3 parallaxPos = posxz; -// vec2 vec = viewVector.xy * (1.0 / float(PW_POINTS)) * 22.0 * PW_DEPTH; -// float waterHeight = getWaterHeightmap(posxz.xz) ; - -// parallaxPos.xz += waterHeight * vec; - -// return parallaxPos; - -// } vec3 applyBump(mat3 tbnMatrix, vec3 bump, float puddle_values){ - float bumpmult = 1; + float bumpmult = puddle_values; bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult); + // return normalize(bump*tbnMatrix); } @@ -275,12 +261,8 @@ vec3 rayTrace(vec3 dir, vec3 position,float dither, float fresnel, bool inwater) // decode depth buffer // float sp = sqrt(texelFetch2D(colortex4,ivec2(spos.xy/texelSize/4),0).w/65000.0); - #ifdef HAND - vec2 testthing = spos.xy*texelSize; // fix for ssr on hand - #else - vec2 testthing = spos.xy/texelSize/4.0; - #endif - float sp = sqrt((texelFetch2D(colortex4,ivec2(testthing),0).a)/65000.0); + + float sp = sqrt(texelFetch2D(colortex4,ivec2(spos.xy/texelSize/4.0),0).a/65000.0); sp = invLinZ(sp); if(sp <= max(maxZ,minZ) && sp >= min(maxZ,minZ)) return vec3(spos.xy/RENDER_SCALE,sp); @@ -299,8 +281,8 @@ vec3 rayTrace(vec3 dir, vec3 position,float dither, float fresnel, bool inwater) return vec3(1.1); } -vec3 GGX (vec3 n, vec3 v, vec3 l, float r, vec3 F0) { - r = pow(r,2.5); +float GGX(vec3 n, vec3 v, vec3 l, float r, float f0) { + r = max(pow(r,2.5), 0.0001); vec3 h = l + v; float hn = inversesqrt(dot(h, h)); @@ -310,94 +292,202 @@ vec3 GGX (vec3 n, vec3 v, vec3 l, float r, vec3 F0) { float dotNL = clamp(dot(n,l),0.,1.); float dotNHsq = dotNH*dotNH; - float denom = dotNHsq * r - dotNHsq + 1.0; + float denom = dotNHsq * r - dotNHsq + 1.; float D = r / (3.141592653589793 * denom * denom); - vec3 F = 0.2 + (1. - F0) * exp2((-5.55473*dotLH-6.98316)*dotLH); + + float F = f0 + (1. - f0) * exp2((-5.55473*dotLH-6.98316)*dotLH); float k2 = .25 * r; return dotNL * D * F / (dotLH*dotLH*(1.0-k2)+k2); } + uniform float dhFarPlane; #include "/lib/DistantHorizons_projections.glsl" -//////////////////////////////VOID MAIN////////////////////////////// -//////////////////////////////VOID MAIN////////////////////////////// -//////////////////////////////VOID MAIN////////////////////////////// -//////////////////////////////VOID MAIN////////////////////////////// -//////////////////////////////VOID MAIN////////////////////////////// -float darkSpecularHighlight(vec3 playerPos, vec3 normal, float roughness, float f0){ - roughness = max(pow(1.0 - roughness, 2.0),0.002); - float distanceFalloff = clamp( exp(-7.0 * (length(playerPos) / 16.0)) ,0.0,1.0); - float NdotP = clamp(1.0 + dot(normal, normalize(playerPos)),0.0,1.0); +// #undef BASIC_SHADOW_FILTER - float specularHighlight = exp( -(1.0 / roughness) * NdotP ) * f0; +#ifdef OVERWORLD_SHADER +float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDistFade, float noise){ - return specularHighlight * distanceFalloff; + if(maxDistFade <= 0.0) return 1.0; + + // setup shadow projection + vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz; + projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; + + // un-distort + #ifdef DISTORT_SHADOWMAP + float distortFactor = calcDistort(projectedShadowPosition.xy); + projectedShadowPosition.xy *= distortFactor; + #else + float distortFactor = 1.0; + #endif + + // hamburger + projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5); + + float shadowmap = 0.0; + vec3 translucentTint = vec3(0.0); + + #ifndef HAND + projectedShadowPosition.z -= 0.0001; + #endif + + #if defined ENTITIES + projectedShadowPosition.z -= 0.0002; + #endif + + #ifdef BASIC_SHADOW_FILTER + int samples = int(SHADOW_FILTER_SAMPLE_COUNT * 0.5); + float rdMul = 14.0*distortFactor*d0*k/shadowMapResolution; + + for(int i = 0; i < samples; i++){ + vec2 offsetS = tapLocation_simple(i, 7, 9, noise) *0.5; + projectedShadowPosition.xy += rdMul*offsetS; + #else + int samples = 1; + #endif + + + #ifdef TRANSLUCENT_COLORED_SHADOWS + + // determine when opaque shadows are overlapping translucent shadows by getting the difference of opaque depth and translucent depth + float shadowDepthDiff = pow(clamp((shadow2D(shadowtex1, projectedShadowPosition).x - projectedShadowPosition.z) * 2.0,0.0,1.0),2.0); + + // get opaque shadow data to get opaque data from translucent shadows. + float opaqueShadow = shadow2D(shadowtex0, projectedShadowPosition).x; + shadowmap += max(opaqueShadow, shadowDepthDiff); + + // get translucent shadow data + vec4 translucentShadow = texture2D(shadowcolor0, projectedShadowPosition.xy); + + // this curve simply looked the nicest. it has no other meaning. + float shadowAlpha = pow(1.0 - pow(translucentShadow.a,5.0),0.2); + + // normalize the color to remove luminance, and keep the hue. remove all opaque color. + // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + + // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 + translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); + + #else + shadowmap += shadow2D(shadow, projectedShadowPosition).x; + #endif + + #ifdef BASIC_SHADOW_FILTER + } + #endif + + #ifdef TRANSLUCENT_COLORED_SHADOWS + // tint the lightsource color with the translucent shadow color + directLightColor *= mix(vec3(1.0), translucentTint.rgb / samples, maxDistFade); + #endif + + return mix(1.0, shadowmap / samples, maxDistFade); } +#endif + +void convertHandDepth(inout float depth) { + float ndcDepth = depth * 2.0 - 1.0; + ndcDepth /= MC_HAND_DEPTH; + depth = ndcDepth * 0.5 + 0.5; +} +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// -uniform vec4 entityColor; /* RENDERTARGETS:2,7,11,14 */ + + void main() { if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) { + vec3 FragCoord = gl_FragCoord.xyz; + + #ifdef HAND + convertHandDepth(FragCoord.z); + #endif + vec2 tempOffset = offsets[framemod8]; + + vec3 viewPos = toScreenSpace(FragCoord*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5, 0.0)); + + vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos; - vec3 viewPos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0)); - - vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////// MATERIAL MASKS //////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + float MATERIALS = normalMat.w; - //////////////////////////////// - //////////////////////////////// ALBEDO - //////////////////////////////// + // 1.0 = water mask + // 0.9 = entity mask + // 0.8 = reflective entities + // 0.7 = reflective blocks + // 0.1 = hand mask + #ifdef HAND + MATERIALS = 0.1; + #endif + // bool isHand = abs(MATERIALS - 0.1) < 0.01; + bool isWater = MATERIALS > 0.99; + bool isReflectiveEntity = abs(MATERIALS - 0.8) < 0.01; + bool isReflective = abs(MATERIALS - 0.7) < 0.01 || isWater || isReflectiveEntity; + bool isEntity = abs(MATERIALS - 0.9) < 0.01 || isReflectiveEntity; + +//////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////// ALBEDO ///////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// gl_FragData[0] = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color; - - - vec3 Albedo = toLinear(gl_FragData[0].rgb); float UnchangedAlpha = gl_FragData[0].a; - - float iswater = normalMat.w; - - #ifdef HAND - iswater = 0.1; + + #ifdef WhiteWorld + gl_FragData[0].rgb = vec3(0.5); + gl_FragData[0].a = 1.0; #endif - #ifdef Vanilla_like_water - if (iswater > 0.95){ - Albedo *= sqrt(luma(Albedo)); - // Albedo = toLinear( gl_FragData[0].rgb * sqrt(luma(gl_FragData[0].rgb))); - } - #else - if (iswater > 0.95){ - Albedo = vec3(0.0); - gl_FragData[0].a = 1.0/255.0; - } + vec3 Albedo = toLinear(gl_FragData[0].rgb); + + #ifndef WhiteWorld + #ifdef Vanilla_like_water + if (isWater) Albedo *= sqrt(luma(Albedo)); + #else + if (isWater){ + Albedo = vec3(0.0); + gl_FragData[0].a = 1.0/255.0; + } + #endif #endif + #ifdef ENTITIES + Albedo.rgb = mix(Albedo.rgb, entityColor.rgb, clamp(entityColor.a*1.5,0,1)); + #endif - vec4 COLORTEST = vec4(Albedo, UnchangedAlpha); + vec4 GLASS_TINT_COLORS = vec4(Albedo, UnchangedAlpha); #ifdef BIOME_TINT_WATER - if (iswater > 0.95) COLORTEST.rgb = color.rgb; + if (isWater) GLASS_TINT_COLORS.rgb = toLinear(color.rgb); #endif +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////// NORMALS /////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// - //////////////////////////////// - //////////////////////////////// NORMAL - //////////////////////////////// - - vec3 normal = normalMat.xyz; + vec3 normal = normalMat.xyz; // in viewSpace + vec3 worldSpaceNormal = viewToWorld(normal).xyz; vec2 TangentNormal = vec2(0); // for refractions vec3 tangent2 = normalize(cross(tangent.rgb,normal)*tangent.w); @@ -405,40 +495,44 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) tangent.y, tangent2.y, normal.y, tangent.z, tangent2.z, normal.z); - vec4 NormalTex = texture2D(normals, lmtexcoord.xy, Texture_MipMap_Bias).rgba; - + vec3 NormalTex = vec3(texture2D(normals, lmtexcoord.xy, Texture_MipMap_Bias).xy,0.0); NormalTex.xy = NormalTex.xy*2.0-1.0; NormalTex.z = clamp(sqrt(1.0 - dot(NormalTex.xy, NormalTex.xy)),0.0,1.0) ; + + // tangent space normals for refraction TangentNormal = NormalTex.xy*0.5+0.5; - - normal = applyBump(tbnMatrix, NormalTex.xyz, 1.0); - #ifndef HAND - if (iswater > 0.95){ - vec3 posxz = feetPlayerPos + cameraPosition; + if (isWater){ + vec3 posxz = (mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz) + cameraPosition; + + // make the waves flow in the direction the water faces, except for perfectly up facing parts. + if(abs(worldSpaceNormal.y) < 0.9995) posxz.xz -= (posxz.y + frameTimeCounter*3 * WATER_WAVE_SPEED) * normalize(worldSpaceNormal.xz) ; - float bumpmult = 1.0; - - posxz.xyz = getParallaxDisplacement(posxz) ; - + posxz.xyz = getParallaxDisplacement(posxz); vec3 bump = normalize(getWaveNormal(posxz, false)); - TangentNormal = (bump.xy/3.0)*0.5+0.5; // tangent space normals for refraction - + float bumpmult = 10.0 * WATER_WAVE_STRENGTH; bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult); - normal = normalize(bump * tbnMatrix); + + NormalTex.xyz = bump; + + // tangent space normals for refraction + TangentNormal = (bump.xy/3.0)*0.5+0.5; } #endif - gl_FragData[2] = vec4(encodeVec2(TangentNormal), encodeVec2(COLORTEST.rg), encodeVec2(COLORTEST.ba), UnchangedAlpha); + normal = applyBump(tbnMatrix, NormalTex.xyz, 1.0); - vec3 WS_normal = viewToWorld(normal); - //////////////////////////////// - //////////////////////////////// DIFFUSE LIGHTING - //////////////////////////////// + gl_FragData[2] = vec4(encodeVec2(TangentNormal), encodeVec2(GLASS_TINT_COLORS.rg), encodeVec2(GLASS_TINT_COLORS.ba), 1.0); + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////// DIFFUSE LIGHTING ////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// vec2 lightmap = lmtexcoord.zw; + + // lightmap.y = 1.0; #ifndef OVERWORLD_SHADER lightmap.y = 1.0; @@ -451,127 +545,62 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) vec3 Indirect_lighting = vec3(0.0); vec3 MinimumLightColor = vec3(1.0); if(isEyeInWater == 1) MinimumLightColor = vec3(10.0); + vec3 Direct_lighting = vec3(0.0); #ifdef OVERWORLD_SHADER + vec3 DirectLightColor = lightCol.rgb/80.0; float NdotL = clamp(dot(normal, normalize(WsunVec*mat3(gbufferModelViewInverse))),0.0,1.0); NdotL = clamp((-15 + NdotL*255.0) / 240.0 ,0.0,1.0); - vec3 Shadows = vec3(0.0); - bool inShadowmapBounds = false; + float Shadows = 1.0; - vec3 feetPlayerPos_shadow = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; + float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+16),0.0)*5.0,1.0)); + float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / shadowDistance,0.0)*5.0,1.0)); - // mat4 Custom_ViewMatrix = BuildShadowViewMatrix(LightDir); - // vec3 projectedShadowPosition = mat3(Custom_ViewMatrix) * feetPlayerPos_shadow + Custom_ViewMatrix[3].xyz; - vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos_shadow + shadowModelView[3].xyz; - projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; + float LM_shadowMapFallback = min(max(lightmap.y-0.8, 0.0) * 25,1.0); - //apply distortion - #ifdef DISTORT_SHADOWMAP - float distortFactor = calcDistort(projectedShadowPosition.xy); - projectedShadowPosition.xy *= distortFactor; - #else - float distortFactor = 1.0; - #endif - - bool ShadowBounds = false; - if(shadowDistanceRenderMul > 0.0) ShadowBounds = length(feetPlayerPos_shadow) < max(shadowDistance - 20,0.0); - - 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; + vec3 shadowPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; - // sample shadows only if on shadow map - if(ShadowBounds){ - if (NdotL > 0.0){ - Shadows = vec3(0.0); - projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5); + Shadows = ComputeShadowMap(DirectLightColor, shadowPlayerPos, shadowMapFalloff, blueNoise()); - #ifndef HAND - #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; + Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2); - float rdMul = 4.0/shadowMapResolution; - float noise = blueNoise(); + Shadows *= pow(GetCloudShadow(feetPlayerPos),3); - int SampleCount = 7; - for(int i = 0; i < SampleCount; i++){ - vec2 offsetS = tapLocation_simple(i, 7, 9, noise) * 0.5; - float weight = 1.0+(i+noise)*rdMul/9.0*shadowMapResolution; - - #ifdef TRANSLUCENT_COLORED_SHADOWS - vec3 shadowProjOffsets = projectedShadowPosition + vec3(rdMul*offsetS, -diffthresh*weight); - - float opaqueShadow = shadow2D(shadowtex0, shadowProjOffsets).x; - Shadows += vec3(opaqueShadow/SampleCount); - - if(shadow2D(shadowtex1, shadowProjOffsets).x > shadowProjOffsets.z){ - vec4 translucentShadow = texture2D(shadowcolor0, shadowProjOffsets.xy); - if(translucentShadow.a < 0.9) Shadows += (normalize(translucentShadow.rgb+0.0001) * clamp(1.0-opaqueShadow,0.0,1.0)) / SampleCount; - } - - #else - Shadows += vec3(shadow2D(shadow, projectedShadowPosition + vec3(rdMul*offsetS, -diffthresh*weight)).x / SampleCount); - #endif - - } - #else - - #ifdef TRANSLUCENT_COLORED_SHADOWS - projectedShadowPosition -= vec3(0.0,0.0,0.0001); - Shadows = vec3(shadow2D(shadowtex0, projectedShadowPosition ).x); - - if(shadow2D(shadowtex1, projectedShadowPosition).x > projectedShadowPosition.z){ - vec4 shadowLightColor = texture2D(shadowcolor0, projectedShadowPosition.xy); - if(shadowLightColor.a < 0.9) Shadows += normalize(shadowLightColor.rgb+0.0001); - } - #else - Shadows = vec3(shadow2D(shadow, projectedShadowPosition - vec3(0.0,0.0,0.0001)).x); - #endif - - #endif - - - - - #else - Shadows = vec3(shadow2D(shadow, projectedShadowPosition - vec3(0.0,0.0,0.0005)).x); - #endif - } - inShadowmapBounds = true; - } - - if(!inShadowmapBounds) Shadows = vec3(1.0); - - Shadows *= GetCloudShadow(feetPlayerPos); - - Direct_lighting = (lightCol.rgb/80.0) * NdotL * Shadows; + Direct_lighting = DirectLightColor * NdotL * Shadows; vec3 AmbientLightColor = averageSkyCol_Clouds/30.0; - vec3 ambientcoefs = WS_normal / dot(abs(WS_normal), vec3(1)); + + + // vec3 ambientcoefs = slopednormal / dot(abs(slopednormal), vec3(1.0)); + + // float SkylightDir = ambientcoefs.y*1.5; + // if(isGrass) SkylightDir = 1.25; + + // float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.2 + (1.0-lightmap.y)*0.8) ; + + + vec3 ambientcoefs = worldSpaceNormal / dot(abs(worldSpaceNormal), vec3(1.0)); float SkylightDir = ambientcoefs.y*1.5; - float skylight = max(pow(viewToWorld(flatnormal).y*0.5+0.5,0.1) + SkylightDir, 0.25); + float skylight = max(pow(viewToWorld(flatnormal).y*0.5+0.5,0.1) + SkylightDir, 0.2); AmbientLightColor *= skylight; #endif #ifdef NETHER_SHADER - // vec3 AmbientLightColor = skyCloudsFromTexLOD2(WS_normal, colortex4, 6).rgb / 15.0; + // vec3 AmbientLightColor = skyCloudsFromTexLOD2(worldSpaceNormal, colortex4, 6).rgb / 15.0; // vec3 up = skyCloudsFromTexLOD2(vec3( 0, 1, 0), colortex4, 6).rgb/ 30.0; // vec3 down = skyCloudsFromTexLOD2(vec3( 0,-1, 0), colortex4, 6).rgb/ 30.0; - // up *= pow( max( WS_normal.y, 0), 2); - // down *= pow( max(-WS_normal.y, 0), 2); + // up *= pow( max( worldSpaceNormal.y, 0), 2); + // down *= pow( max(-worldSpaceNormal.y, 0), 2); // AmbientLightColor += up + down; vec3 AmbientLightColor = vec3(0.1); - #endif #ifdef END_SHADER - - float vortexBounds = clamp(vortexBoundRange - length(feetPlayerPos+cameraPosition), 0.0,1.0); vec3 lightPos = LightSourcePosition(feetPlayerPos+cameraPosition, cameraPosition,vortexBounds); @@ -579,56 +608,91 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) float lightningflash = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0; vec3 lightColors = LightSourceColors(vortexBounds, lightningflash); - float NdotL = clamp(dot(WS_normal, normalize(-lightPos))*0.5+0.5,0.0,1.0); + float NdotL = clamp(dot(worldSpaceNormal, normalize(-lightPos))*0.5+0.5,0.0,1.0); + NdotL *= NdotL; Direct_lighting = lightColors * endFogPhase(lightPos) * NdotL; vec3 AmbientLightColor = vec3(0.5,0.75,1.0) * 0.9 + 0.1; - AmbientLightColor *= clamp(1.5 + dot(WS_normal, normalize(feetPlayerPos))*0.5,0,2); - - #endif - Indirect_lighting = DoAmbientLightColor(feetPlayerPos, AmbientLightColor, MinimumLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy); - - #ifdef ENTITIES - Albedo.rgb = mix(Albedo.rgb, entityColor.rgb, clamp(entityColor.a*1.5,0,1)); + AmbientLightColor *= clamp(1.5 + dot(worldSpaceNormal, normalize(feetPlayerPos))*0.5,0,2); #endif + #ifdef IS_LPV_ENABLED + vec3 lpvPos = GetLpvPosition(feetPlayerPos); + + #ifdef LPV_NORMAL_OFFSET + lpvPos += -0.5*worldSpaceNormal + viewToWorld(normal); + #else + lpvPos += 0.5*worldSpaceNormal; + #endif + #else + const vec3 lpvPos = vec3(0.0); + #endif + + Indirect_lighting = DoAmbientLightColor(lpvPos, AmbientLightColor, MinimumLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy, exposure); + vec3 FinalColor = (Indirect_lighting + Direct_lighting) * Albedo; - - // #ifdef Glass_Tint - // FinalColor *= min(pow(gl_FragData[0].a,2.0),1.0); - // #endif - //////////////////////////////// - //////////////////////////////// SPECULAR - //////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////// SPECULAR LIGHTING ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + #ifdef DAMAGE_BLOCK_EFFECT #undef WATER_REFLECTIONS #endif + // #ifdef ENTITIES + // #undef WATER_BACKGROUND_SPECULAR + // #endif + + #ifndef OVERWORLD_SHADER + #undef WATER_SUN_SPECULAR + #endif + #ifdef WATER_REFLECTIONS vec2 SpecularTex = texture2D(specular, lmtexcoord.xy, Texture_MipMap_Bias).rg; - SpecularTex = (iswater > 0.0 && iswater < 0.9) && SpecularTex.r > 0.0 && SpecularTex.g < 0.9 ? SpecularTex : vec2(1.0,0.02); - - float roughness = max(pow(1.0-SpecularTex.r,2.0),0.05); - float f0 = SpecularTex.g; + // if nothing is chosen, no smoothness and no reflectance + vec2 specularValues = vec2(1.0, 0.0); - // roughness = 0.1; - // f0 = 0.1; + // hardcode specular values for select blocks like glass, water, and slime + if(isReflective) specularValues = vec2(1.0, 0.02); + + // detect if the specular texture is used, if it is, overwrite hardcoded values + if(SpecularTex.r > 0.0 && SpecularTex.g <= 1.0) specularValues = SpecularTex; + + float roughness = pow(1.0-specularValues.r,2.0); + float f0 = isReflective ? max(specularValues.g, 0.02) : specularValues.g; + + + #ifdef HAND + f0 = max(specularValues.g, 0.02); + #endif + + // specularValues = SpecularTex; + // f0 = 0.9; + // roughness = 0.0; + + vec3 Metals = f0 > 229.5/255.0 ? normalize(Albedo+1e-7) * (dot(Albedo,vec3(0.21, 0.72, 0.07)) * 0.7 + 0.3) : vec3(1.0); + + // make sure zero alpha is not forced to be full alpha by fresnel on items with funny normal padding + if(UnchangedAlpha <= 0.0 && !isReflective) f0 = 0.0; + + + if (f0 > 0.0){ + + if(isReflective) f0 = max(f0, 0.02); - if (iswater > 0.0 && gl_FragData[0].a < 0.9999999){ vec3 Reflections_Final = vec3(0.0); vec4 Reflections = vec4(0.0); - vec3 SkyReflection = vec3(0.0); + vec3 BackgroundReflection = FinalColor; vec3 SunReflection = vec3(0.0); - - float indoors = clamp((lightmap.y-0.6)*5.0, 0.0,1.0); - - vec3 reflectedVector = reflect(normalize(viewPos), normal); + float indoors = pow(1.0-pow(1.0-min(max(lightmap.y-0.6,0.0)*3.0,1.0),0.5),2.0); + vec3 reflectedVector = reflect(normalize(viewPos), normal); float normalDotEye = dot(normal, normalize(viewPos)); + float fresnel = pow(clamp(1.0 + normalDotEye, 0.0, 1.0),5.0); #ifdef SNELLS_WINDOW @@ -638,90 +702,80 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) fresnel = mix(f0, 1.0, fresnel); - vec3 Metals = f0 > 229.5/255.0 ? normalize(Albedo+1e-7) * (dot(Albedo,vec3(0.21, 0.72, 0.07)) * 0.7 + 0.3) : vec3(1.0); - - // Sun, Sky, and screen-space reflections #ifdef OVERWORLD_SHADER #ifdef WATER_SUN_SPECULAR - SunReflection = Direct_lighting * GGX(normal, -normalize(viewPos), WsunVec*mat3(gbufferModelViewInverse), roughness, vec3(f0)) ; + SunReflection = Direct_lighting * GGX(normal, -normalize(viewPos), WsunVec*mat3(gbufferModelViewInverse), max(roughness,0.035), f0) * Metals; #endif #ifdef WATER_BACKGROUND_SPECULAR - if(isEyeInWater == 0) SkyReflection = skyCloudsFromTex(mat3(gbufferModelViewInverse) * reflectedVector, colortex4).rgb / 30.0 ; + if(isEyeInWater == 0 && !isReflectiveEntity) BackgroundReflection = skyCloudsFromTex(mat3(gbufferModelViewInverse) * reflectedVector, colortex4).rgb / 30.0 * Metals; #endif + + if(isEyeInWater == 1 && isWater) BackgroundReflection.rgb = exp(-8.0 * vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B)) * clamp(WsunVec.y*lightCol.a,0,1); #else #ifdef WATER_BACKGROUND_SPECULAR - if(isEyeInWater == 0) SkyReflection = skyCloudsFromTexLOD2(mat3(gbufferModelViewInverse) * reflectedVector, colortex4, 0).rgb / 30.0 ; + if(isEyeInWater == 0) BackgroundReflection = skyCloudsFromTexLOD2(mat3(gbufferModelViewInverse) * reflectedVector, colortex4, 0).rgb / 30.0 * Metals; #endif #endif #ifdef SCREENSPACE_REFLECTIONS - if(iswater > 0.0){ - vec3 rtPos = rayTrace(reflectedVector, viewPos.xyz, interleaved_gradientNoise(), fresnel, isEyeInWater == 1); - if (rtPos.z < 1.){ - vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rtPos) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition; - previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz; - previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5; - if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0) { - Reflections.a = 1.0; - Reflections.rgb = texture2D(colortex5,previousPosition.xy).rgb ; - } + vec3 rtPos = rayTrace(reflectedVector, viewPos.xyz, interleaved_gradientNoise_temporal(), fresnel, isEyeInWater == 1); + if (rtPos.z < 1.){ + vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rtPos) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition; + previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz; + previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5; + if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0) { + Reflections.a = 1.0; + Reflections.rgb = texture2D(colortex5,previousPosition.xy).rgb * Metals; } } #endif - #ifdef OVERWORLD_SHADER - if(isEyeInWater == 1 && iswater > 0.9){ - SkyReflection.rgb = exp(-8.0 * vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B)) * clamp(WsunVec.y*lightCol.a,0,1); - } - - // if(iswater > 0.9) SkyReflection.rgb = mix(vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B)*0.1, SkyReflection.rgb*indoors, clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0),0.0,1.0)); - #endif - float visibilityFactor = clamp(exp2((pow(roughness,3.0) / f0) * -4),0,1); - #ifdef ENTITIES - Reflections_Final = FinalColor; - #else - Reflections_Final = mix(SkyReflection*indoors, Reflections.rgb, Reflections.a); - Reflections_Final = mix(FinalColor, Reflections_Final * Metals, fresnel); - #endif - - Reflections_Final += SunReflection * Metals; + Reflections_Final = mix(mix(FinalColor, BackgroundReflection, indoors), Reflections.rgb, Reflections.a) * fresnel * visibilityFactor; + Reflections_Final += SunReflection; - // Reflections_Final += vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B)*0.1 * darkSpecularHighlight(feetPlayerPos, viewToWorld(normal), 0.9, 0.1); - - gl_FragData[0].rgb = Reflections_Final ; - - #ifndef ENTITIES - //correct alpha channel with fresnel - gl_FragData[0].a = mix(gl_FragData[0].a, 1.0, fresnel); - #endif + //correct alpha channel with fresnel + float alpha0 = gl_FragData[0].a; + + gl_FragData[0].a = -gl_FragData[0].a * fresnel + gl_FragData[0].a + fresnel; + + // prevent reflections from being darkened by buffer blending + gl_FragData[0].rgb = clamp(FinalColor / gl_FragData[0].a*alpha0*(1.0-fresnel) * 0.1 + Reflections_Final / gl_FragData[0].a * 0.1,0.0,65100.0); + + if (gl_FragData[0].r > 65000.) gl_FragData[0].rgba = vec4(0.0); - } else { - - gl_FragData[0].rgb = FinalColor; + gl_FragData[0].rgb = FinalColor*0.1; } #else - gl_FragData[0].rgb = FinalColor; + gl_FragData[0].rgb = FinalColor*0.1; #endif - // gl_FragData[0].rgb = vec3(1) * (texelFetch2D(depthtex0,ivec2(gl_FragCoord.xy),0).x - texelFetch2D(dhDepthTex1,ivec2(gl_FragCoord.xy),0).x); + #if defined DISTANT_HORIZONS && defined DH_OVERDRAW_PREVENTION && !defined HAND + bool WATER = texture2D(colortex7, gl_FragCoord.xy*texelSize).a > 0.0 && length(feetPlayerPos) > far-16*4 && texture2D(depthtex1, gl_FragCoord.xy*texelSize).x >= 1.0; - - #if defined DISTANT_HORIZONS && defined DH_OVERDRAW_PREVENTION - gl_FragData[0].a = mix(gl_FragData[0].a, 0.0, 1.0-min(max(1.0 - length(feetPlayerPos.xz)/max(far,0.0),0.0)*2.0,1.0) ); + if(WATER) gl_FragData[0].a = 0.0; #endif #ifndef HAND - gl_FragData[1] = vec4(Albedo, iswater); + gl_FragData[1] = vec4(Albedo, MATERIALS); #endif #if DEBUG_VIEW == debug_DH_WATER_BLENDING if(gl_FragCoord.x*texelSize.x < 0.47) gl_FragData[0] = vec4(0.0); #endif + #if DEBUG_VIEW == debug_NORMALS + gl_FragData[0].rgb = normal.xyz * 0.1 * vec3(0,0,1); + #endif + #if DEBUG_VIEW == debug_INDIRECT + gl_FragData[0].rgb = Indirect_lighting* 0.1; + #endif + #if DEBUG_VIEW == debug_DIRECT + gl_FragData[0].rgb = Direct_lighting * 0.1; + #endif - gl_FragData[3].a = lmtexcoord.w; + gl_FragData[3].a = encodeVec2(lightmap); } } \ No newline at end of file diff --git a/shaders/dimensions/all_translucent.vsh b/shaders/dimensions/all_translucent.vsh index 4fe26f0..ebc63ae 100644 --- a/shaders/dimensions/all_translucent.vsh +++ b/shaders/dimensions/all_translucent.vsh @@ -16,6 +16,9 @@ Read the terms of modification and sharing before changing something below pleas varying vec4 lmtexcoord; varying vec4 color; +uniform sampler2D colortex4; +flat varying float exposure; + #ifdef OVERWORLD_SHADER flat varying vec3 averageSkyCol_Clouds; flat varying vec4 lightCol; @@ -35,7 +38,6 @@ flat varying int glass; attribute vec4 at_tangent; attribute vec4 mc_Entity; -uniform sampler2D colortex4; uniform vec3 sunPosition; uniform float sunElevation; @@ -73,7 +75,6 @@ vec4 toClipSpace3(vec3 viewSpacePosition) { return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),-viewSpacePosition.z); } -varying vec4 pos; //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// @@ -82,14 +83,15 @@ varying vec4 pos; void main() { - lmtexcoord.xy = (gl_MultiTexCoord0).xy; - vec2 lmcoord = gl_MultiTexCoord1.xy / 240.0; // is this even correct? lol + // lmtexcoord.xy = (gl_MultiTexCoord0).xy; + lmtexcoord.xy = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy; + vec2 lmcoord = gl_MultiTexCoord1.xy / 240.0; lmtexcoord.zw = lmcoord; vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz; + gl_Position = toClipSpace3(position); - pos = vec4(position,1); HELD_ITEM_BRIGHTNESS = 0.0; @@ -97,21 +99,28 @@ void main() { if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_ITEM_BRIGHTNESS = 0.9; #endif + + + // 1.0 = water mask + // 0.9 = entity mask + // 0.8 = reflective entities + // 0.7 = reflective blocks float mat = 0.0; - + + // water mask if(mc_Entity.x == 8.0) { mat = 1.0; - gl_Position.z -= 1e-4; } - if (mc_Entity.x >= 200 && mc_Entity.x < 300) mat = 0.2; - if (mc_Entity.x == 72) mat = 0.5; - + // translucent entities #if defined ENTITIES || defined BLOCKENTITIES - mat = 0.1; + mat = 0.9; + if (entityId == 1403) mat = 0.8; #endif + // translucent blocks + if (mc_Entity.x >= 301 && mc_Entity.x <= 321) mat = 0.7; tangent = vec4(normalize(gl_NormalMatrix *at_tangent.rgb),at_tangent.w); @@ -132,6 +141,7 @@ void main() { color = vec4(gl_Color.rgb, 1.0); + exposure = texelFetch2D(colortex4,ivec2(10,37),0).r; #ifdef OVERWORLD_SHADER lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb; @@ -143,8 +153,6 @@ void main() { // WsunVec = normalize(LightDir); #endif - - #ifdef TAA_UPSCALING gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w; #endif diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index b97902f..40b037d 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -7,16 +7,6 @@ #include "/lib/res_params.glsl" -vec3 saturation(inout vec3 color, float saturation){ - - - float luminance = dot(color, vec3(0.21, 0.72, 0.07)); - - vec3 difference = color - luminance; - - return color = color + difference*saturation; -} - const bool colortex5MipmapEnabled = true; #ifdef OVERWORLD_SHADER @@ -41,7 +31,6 @@ const bool colortex5MipmapEnabled = true; #endif #ifdef NETHER_SHADER - uniform float nightVision; uniform sampler2D colortex4; const bool colortex4MipmapEnabled = true; @@ -64,10 +53,10 @@ uniform sampler2D depthtex0; uniform sampler2D depthtex1; uniform sampler2D depthtex2; -// #ifdef DISTANT_HORIZONS +#ifdef DISTANT_HORIZONS uniform sampler2D dhDepthTex; uniform sampler2D dhDepthTex1; -// #endif +#endif uniform sampler2D colortex0; //clouds uniform sampler2D colortex1; //albedo(rgb),material(alpha) RGBA16 @@ -131,7 +120,8 @@ uniform ivec2 eyeBrightnessSmooth; uniform vec3 sunVec; flat varying vec3 WsunVec; -// flat varying vec3 unsigned_WsunVec; +flat varying vec3 unsigned_WsunVec; +flat varying float exposure; #define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z) #define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz) @@ -183,6 +173,20 @@ float ld(float dist) { return (2.0 * near) / (far + near - dist * (far - near)); } +vec3 decode (vec2 encn){ + vec3 n = vec3(0.0); + encn = encn * 2.0 - 1.0; + n.xy = abs(encn); + n.z = 1.0 - n.x - n.y; + n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn; + return clamp(normalize(n.xyz),-1.0,1.0); +} +vec2 decodeVec2(float a){ + const vec2 constant1 = 65535. / vec2( 256., 65536.); + const float constant2 = 256. / 255.; + return fract( a * constant1 ) * constant2 ; +} + #include "/lib/end_fog.glsl" #include "/lib/specular.glsl" @@ -233,20 +237,6 @@ float facos(float sx){ float x = clamp(abs( sx ),0.,1.); return sqrt( 1. - x ) * ( -0.16882 * x + 1.56734 ); } -vec3 decode (vec2 encn){ - vec3 n = vec3(0.0); - encn = encn * 2.0 - 1.0; - n.xy = abs(encn); - n.z = 1.0 - n.x - n.y; - n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn; - return clamp(normalize(n.xyz),-1.0,1.0); -} -vec2 decodeVec2(float a){ - const vec2 constant1 = 65535. / vec2( 256., 65536.); - const float constant2 = 256. / 255.; - return fract( a * constant1 ) * constant2 ; -} - vec2 tapLocation(int sampleNumber,int nb, float nbRot,float jitter,float distort) { @@ -475,6 +465,9 @@ vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, boo float Stepmult = depthCheck ? (isSSS ? 0.5 : 6.0) : (isSSS ? 1.0 : 3.0); + // Stepmult = depthCheck ? 0.5 : 1.0; + + vec3 rayDir = direction * Stepmult * vec3(RENDER_SCALE,1.0); vec3 screenPos = clipPosition * vec3(RENDER_SCALE,1.0) + rayDir*noise; @@ -483,7 +476,8 @@ vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, boo for (int i = 0; i < int(steps); i++) { screenPos += rayDir; - + + float samplePos = convertHandDepth_2(texture2D(depthtex1, screenPos.xy).x, hand); #ifdef DISTANT_HORIZONS @@ -507,118 +501,20 @@ vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, boo return vec2(Shadow, SSS); } -float CustomPhase(float LightPos){ - - float PhaseCurve = 1.0 - LightPos; - float Final = exp2(sqrt(PhaseCurve) * -25.0); - Final += exp(PhaseCurve * -10.0)*0.5; - - return Final; -} - -vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos){ - - float labcurve = pow(Density, LabSSS_Curve); - - float density = 15.0 - labcurve*10.0; - - vec3 absorbed = max(1.0 - albedo,0.0); - - vec3 scatter = exp(Scattering * absorbed * -5.0) * exp(Scattering * -density); - - scatter *= labcurve; - - scatter *= 1.0 + CustomPhase(lightPos)*6.0; // ~10x brighter at the peak - - return scatter; -} - -vec3 SubsurfaceScattering_sky(vec3 albedo, float Scattering, float Density){ - - vec3 absorbColor = max(1.0 - albedo,0.0); - - vec3 scatter = vec3(1)*exp(-3.0 * (Scattering*Scattering)); - - scatter *= clamp(1.0 - exp(Density * -10.0),0.0,1.0); - - return scatter; -} void Emission( inout vec3 Lighting, vec3 Albedo, - float Emission + float Emission, + float exposure ){ - // if( Emission < 235.0/255.0 ) Lighting = mix(Lighting, Albedo * Emissive_Brightness, pow(Emission, Emissive_Curve)); // old method.... idk why - if( Emission < 255.0/255.0 ) Lighting += (Albedo * Emissive_Brightness) * pow(Emission, Emissive_Curve); + float autoBrightnessAdjust = mix(5.0, 100.0, clamp(exp(-10.0*exposure),0.0,1.0)); + if( Emission < 254.5/255.0) Lighting = mix(Lighting, Albedo * Emissive_Brightness * autoBrightnessAdjust, pow(Emission, Emissive_Curve)); // old method.... idk why + // if( Emission < 254.5/255.0 ) Lighting += (Albedo * Emissive_Brightness) * pow(Emission, Emissive_Curve); } #include "/lib/indirect_lighting_effects.glsl" #include "/lib/PhotonGTAO.glsl" -// vec4 renderInfiniteWaterPlane( -// vec3 FragPosition, inout vec3 oceanNormals -// ){ - -// float planeHeight = 20 + 0.50; -// float total_extinction = 1.0; -// vec3 color = vec3(0.0); - -// //project pixel position into projected shadowmap space -// vec4 viewPos = normalize(gbufferModelViewInverse * vec4(FragPosition,1.0) ); -// vec3 dV_view = normalize(viewPos.xyz); dV_view *= 1.0/abs(dV_view.y); - -// float mult = length(dV_view); - -// float startFlip = mix(max(cameraPosition.y - planeHeight,0.0), max(planeHeight - cameraPosition.y,0), clamp(dV_view.y,0,1)); -// float signFlip = mix(-1.0, 1.0, clamp(cameraPosition.y - planeHeight,0.0,1.0)); -// if(max(signFlip * normalize(dV_view).y,0.0) > 0.0) return vec4(0,0,0,1); - -// vec3 progress_view = vec3(0,cameraPosition.y,0) + dV_view/abs(dV_view.y) * startFlip; - -// oceanNormals = normalize(getWaveHeight((progress_view+cameraPosition).xz,1)); - -// vec3 Lighting = vec3(1); -// float object = 1; - -// color += max(Lighting - Lighting*exp(-mult*object),0.0) * total_extinction; -// total_extinction *= max(exp(-mult*object),0.0); - -// return vec4(color, total_extinction); -// } - - -// uniform float viewWidth; -// uniform float viewHeight; - -// uniform sampler2D depthtex0; -// uniform sampler2D dhDepthTex; - -// uniform mat4 gbufferProjectionInverse; -// uniform mat4 dhProjectionInverse; - -// vec3 getViewPos() { -// ivec2 uv = ivec2(gl_FragCoord.xy); -// vec2 viewSize = vec2(viewWidth, viewHeight); -// vec2 texcoord = gl_FragCoord.xy / viewSize; - -// vec4 viewPos = vec4(0.0); - -// float depth = texelFetch(depthtex0, uv, 0).r; - -// if (depth < 1.0) { -// vec4 ndcPos = vec4(texcoord, depth, 1.0) * 2.0 - 1.0; -// viewPos = gbufferProjectionInverse * ndcPos; -// viewPos.xyz /= viewPos.w; -// } else { -// depth = texelFetch(dhDepthTex, ivec2(gl_FragCoord.xy), 0).r; - -// vec4 ndcPos = vec4(texcoord, depth, 1.0) * 2.0 - 1.0; -// viewPos = dhProjectionInverse * ndcPos; -// viewPos.xyz /= viewPos.w; -// } - -// return viewPos.xyz; -// } vec4 BilateralUpscale(sampler2D tex, sampler2D depth, vec2 coord, float referenceDepth){ @@ -699,7 +595,7 @@ vec4 BilateralUpscale_DH(sampler2D tex, sampler2D depth, vec2 coord, float refer } -void BilateralUpscale_REUSE_Z(sampler2D tex1, sampler2D tex2, sampler2D depth, vec2 coord, float referenceDepth, inout vec2 ambientEffects, inout vec3 filteredShadow){ +void BilateralUpscale_REUSE_Z(sampler2D tex1, sampler2D tex2, sampler2D depth, vec2 coord, float referenceDepth, inout vec2 ambientEffects, inout vec3 filteredShadow, bool hand){ ivec2 scaling = ivec2(1.0); ivec2 posDepth = ivec2(coord) * scaling; ivec2 posColor = ivec2(coord); @@ -751,32 +647,117 @@ void BilateralUpscale_REUSE_Z(sampler2D tex1, sampler2D tex2, sampler2D depth, v ambientEffects = ssao_RESULT/SUM; #endif } -vec3 ColorBoost(vec3 COLOR, float saturation){ - float luminance = luma(COLOR); +#ifdef OVERWORLD_SHADER +float ComputeShadowMap(in vec3 projectedShadowPosition, float distortFactor, float noise, float shadowBlockerDepth, float NdotL, float maxDistFade, inout vec3 directLightColor, inout float FUNNYSHADOW, bool isSSS){ - COLOR = normalize(COLOR+0.0001); + if(maxDistFade <= 0.0) return 1.0; + float backface = NdotL <= 0.0 ? 1.0 : 0.0; - vec3 difference = COLOR - luminance; + float shadowmap = 0.0; + vec3 translucentTint = vec3(0.0); - return COLOR + difference*(-luminance + saturation); + #ifdef BASIC_SHADOW_FILTER + int samples = SHADOW_FILTER_SAMPLE_COUNT; + float rdMul = shadowBlockerDepth*distortFactor*d0*k/shadowMapResolution; + + for(int i = 0; i < samples; i++){ + vec2 offsetS = tapLocation_simple(i, 7, 9, noise) * 0.5; + projectedShadowPosition.xy += rdMul*offsetS; + #else + int samples = 1; + #endif + #ifdef TRANSLUCENT_COLORED_SHADOWS + // determine when opaque shadows are overlapping translucent shadows by getting the difference of opaque depth and translucent depth + float shadowDepthDiff = pow(clamp((shadow2D(shadowtex1, projectedShadowPosition).x - projectedShadowPosition.z*0.6)*2.0,0.0,1.0),2.0); + + // get opaque shadow data to get opaque data from translucent shadows. + float opaqueShadow = shadow2D(shadowtex0, projectedShadowPosition).x; + shadowmap += max(opaqueShadow, shadowDepthDiff); + + // get translucent shadow data + vec4 translucentShadow = texture2D(shadowcolor0, projectedShadowPosition.xy); + + // this curve simply looked the nicest. it has no other meaning. + float shadowAlpha = pow(1.0 - pow(translucentShadow.a,5.0),0.2); + + FUNNYSHADOW = shadowAlpha; + + // normalize the color to remove luminance, and keep the hue. remove all opaque color. + // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * max(shadowAlpha, backface * (1.0 - shadowDepthDiff)); + + float translucentMask = 1 - max(shadowDepthDiff-opaqueShadow, 0); + // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 + translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); + #else + shadowmap += shadow2D(shadow, projectedShadowPosition).x; + #endif + #ifdef BASIC_SHADOW_FILTER + } + #endif + + #ifdef TRANSLUCENT_COLORED_SHADOWS + // tint the lightsource color with the translucent shadow color + directLightColor *= mix(vec3(1.0), translucentTint.rgb / samples, maxDistFade); + #endif + + // return maxDistFade; + + return mix(1.0, shadowmap / samples, maxDistFade); + +} +#endif + +float CustomPhase(float LightPos){ + + float PhaseCurve = 1.0 - LightPos; + float Final = exp2(sqrt(PhaseCurve) * -25.0); + Final += exp(PhaseCurve * -10.0)*0.5; + + return Final; } -float darkSpecularHighlight(vec3 playerPos, vec3 normal, float roughness, float f0){ +vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos, float shadows){ + + Scattering *= sss_density_multiplier; - roughness = max(pow(1.0 - roughness, 2.0),0.002); + float density = 0.0001 + Density*1.5; - float distanceFalloff = clamp( exp(-7.0 * (length(playerPos) / 16.0)) ,0.0,1.0); + density = 1.0; + float scatterDepth = max(1.0 - Scattering/density,0.0); + scatterDepth = exp((1.0-scatterDepth) * -7.0); - float NdotP = clamp(1.0 + dot(normal, normalize(playerPos)),0.0,1.0); + // this is for SSS when there is no shadow blocker depth + #if defined BASIC_SHADOW_FILTER && defined Variable_Penumbra_Shadows + scatterDepth = max(scatterDepth, shadows * min(2.0-sss_density_multiplier,1.0)); + #else + scatterDepth = exp(-7.0 * pow(1.0-shadows,3.0))*min(2.0-sss_density_multiplier,1.0); + #endif - float specularHighlight = exp( -(1.0 / roughness) * NdotP ) * f0; - return specularHighlight * distanceFalloff; + // PBR at its finest :clueless: + vec3 absorbColor = exp(max(luma(albedo) - albedo, 0.0) * -(20.0 - 19*scatterDepth) * sss_absorbance_multiplier); + + vec3 scatter = scatterDepth * absorbColor * pow(Density, LabSSS_Curve); + + scatter *= 1.0 + CustomPhase(lightPos)*6.0; // ~10x brighter at the peak + + return scatter; } +vec3 SubsurfaceScattering_sky(vec3 albedo, float Scattering, float Density){ + + float labcurve = clamp(1.0 - exp(Density * -10.0),0.0,1.0); + float density = sqrt(Density) * 4.0 + 1.0; + float scatterDepth = exp(pow(Scattering, 5) * -5.0); + vec3 absorbColor = exp(max(luma(albedo)-albedo, 0.0) * -(20.0 - 19.0*scatterDepth) * sss_absorbance_multiplier); + vec3 scatter = scatterDepth * absorbColor * labcurve; + + return scatter; +} void main() { @@ -833,7 +814,8 @@ void main() { vec3 albedo = toLinear(vec3(dataUnpacked0.xz,dataUnpacked1.x)); vec3 normal = decode(dataUnpacked0.yw); - vec2 lightmap = dataUnpacked1.yz; + vec2 lightmap = dataUnpacked1.yz;//min(max(dataUnpacked1.yz - 0.05,0.0)*1.06,1.0);// small offset to hide flickering from precision error in the encoding/decoding on values close to 1.0 or 0.0 + #if defined END_SHADER || defined NETHER_SHADER lightmap.y = 1.0; @@ -850,13 +832,6 @@ void main() { vec3 FlatNormals = normalAndAO.rgb * 2.0 - 1.0; vec3 slopednormal = normal; - #ifdef POM - #ifdef Horrible_slope_normals - vec3 ApproximatedFlatNormal = normalize(cross(dFdx(feetPlayerPos), dFdy(feetPlayerPos))); // it uses depth that has POM written to it. - slopednormal = normalize(clamp(normal, ApproximatedFlatNormal*2.0 - 1.0, ApproximatedFlatNormal*2.0 + 1.0) ); - #endif - #endif - float vanilla_AO = z < 1.0 ? clamp(normalAndAO.a,0,1) : 0.0; normalAndAO.a = clamp(pow(normalAndAO.a*5,4),0,1); @@ -867,23 +842,37 @@ void main() { ////// --------------- MASKS/BOOLEANS --------------- ////// + // 1.0-0.8 ??? + // 0.75 = hand mask + // 0.60 = grass mask + // 0.55 = leaf mask (for ssao-sss) + // 0.50 = lightning bolt mask + // 0.45 = entity mask + float opaqueMasks = dataUnpacked1.w; + // 1.0 = water mask + // 0.9 = entity mask + // 0.8 = reflective entities + // 0.7 = reflective blocks + float translucentMasks = texture2D(colortex7, texcoord).a; - float translucent_alpha = texture2D(colortex7,texcoord).a; - bool iswater = translucent_alpha > 0.99; - bool lightningBolt = abs(dataUnpacked1.w-0.5) <0.01; - bool isLeaf = abs(dataUnpacked1.w-0.55) <0.01; - bool entities = abs(dataUnpacked1.w-0.45) < 0.01; - // bool isBoss = abs(dataUnpacked1.w-0.60) < 0.01; - bool isGrass = abs(dataUnpacked1.w-0.60) < 0.01; - bool hand = abs(dataUnpacked1.w-0.75) < 0.01 && z < 1.0; - // bool blocklights = abs(dataUnpacked1.w-0.8) <0.01; + bool isWater = translucentMasks > 0.99; + // bool isReflectiveEntity = abs(translucentMasks - 0.8) < 0.01; + // bool isReflective = abs(translucentMasks - 0.7) < 0.01 || isWater || isReflectiveEntity; + // bool isEntity = abs(translucentMasks - 0.9) < 0.01 || isReflectiveEntity; + + bool lightningBolt = abs(opaqueMasks-0.5) <0.01; + bool isLeaf = abs(opaqueMasks-0.55) <0.01; + bool entities = abs(opaqueMasks-0.45) < 0.01; + bool isGrass = abs(opaqueMasks-0.60) < 0.01; + bool hand = abs(opaqueMasks-0.75) < 0.01 && z < 1.0; + // bool blocklights = abs(opaqueMasks-0.8) <0.01; if(hand){ convertHandDepth(z); convertHandDepth(z0); } - + #ifdef DISTANT_HORIZONS vec3 viewPos = toScreenSpace_DH(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5, z, DH_depth1); #else @@ -893,6 +882,12 @@ void main() { vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos; vec3 feetPlayerPos_normalized = normVec(feetPlayerPos); + #ifdef POM + #ifdef Horrible_slope_normals + vec3 ApproximatedFlatNormal = normalize(cross(dFdx(feetPlayerPos), dFdy(feetPlayerPos))); // it uses depth that has POM written to it. + slopednormal = normalize(clamp(normal, ApproximatedFlatNormal*2.0 - 1.0, ApproximatedFlatNormal*2.0 + 1.0) ); + #endif + #endif ////// --------------- COLORS --------------- ////// float dirtAmount = Dirt_Amount + 0.01; @@ -903,7 +898,7 @@ void main() { #ifdef BIOME_TINT_WATER // yoink the biome tint written in this buffer for water only. - if(iswater){ + if(isWater){ vec2 translucentdata = texture2D(colortex11,texcoord).gb; vec3 wateralbedo = vec3(decodeVec2(translucentdata.x),decodeVec2(translucentdata.y).x); scatterCoef = dirtAmount * wateralbedo / 3.14; @@ -919,21 +914,18 @@ void main() { vec3 Direct_lighting = vec3(0.0); vec3 Direct_SSS = vec3(0.0); float cloudShadow = 1.0; - vec3 Shadows = vec3(1.0); + float Shadows = 1.0; float NdotL = 1.0; + float lightLeakFix = clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0); + // #ifdef DISTANT_HORIZONS_SHADOWMAP + // float shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance, dhFarPlane),0.0)*5.0,1.0),2.0),2.0); + // #else + // float shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / shadowDistance,0.0)*5.0,1.0),2.0),2.0); + // #endif + // float shadowMapFalloff2 = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance,far),0.0)*5.0,1.0),2.0),2.0); - vec3 shadowMap = vec3(1.0); - #ifdef DISTANT_HORIZONS_SHADOWMAP - float shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance, dhFarPlane),0.0)*5.0,1.0),2.0),2.0); - #else - float shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / shadowDistance,0.0)*5.0,1.0),2.0),2.0); - #endif - float shadowMapFalloff2 = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance,far),0.0)*5.0,1.0),2.0),2.0); - // shadowMapFalloff = 0; - // shadowMapFalloff2 = 0; - float LM_shadowMapFallback = min(max(lightmap.y-0.8, 0.0) * 25,1.0); #ifdef OVERWORLD_SHADER DirectLightColor = lightCol.rgb / 80.0; @@ -965,14 +957,19 @@ void main() { vec2 SSAO_SSS = vec2(1.0); #ifdef DISTANT_HORIZONS - BilateralUpscale_REUSE_Z(colortex3, colortex14, colortex12, gl_FragCoord.xy, DH_mixedLinearZ, SSAO_SSS, filteredShadow); + BilateralUpscale_REUSE_Z(colortex3, colortex14, colortex12, gl_FragCoord.xy, DH_mixedLinearZ, SSAO_SSS, filteredShadow, hand); #else - BilateralUpscale_REUSE_Z(colortex3, colortex14, depthtex0, gl_FragCoord.xy, ld(z0), SSAO_SSS, filteredShadow); + BilateralUpscale_REUSE_Z(colortex3, colortex14, depthtex0, gl_FragCoord.xy, ld(z0), SSAO_SSS, filteredShadow, hand); #endif + // SSAO_SSS = texture2D(colortex14,texcoord).xy; + // filteredShadow = texture2D(colortex3,texcoord).xyz; + // filteredShadow.rgb = vec3(filteredShadow.x, temporallyReprojectedData.gb); + // SSAO_SSS.x = temporallyReprojectedData.a; + float ShadowBlockerDepth = filteredShadow.y; - Shadows = vec3(clamp(1.0 - filteredShadow.b,0.0,1.0)); - shadowMap = vec3(Shadows); + // Shadows = vec3(clamp(1.0-filteredShadow.b,0.0,1.0)); + // shadowMap = vec3(Shadows); //////////////////////////////////////////////////////////////////////////////////////////// @@ -981,11 +978,18 @@ void main() { if (swappedDepth >= 1.0) { #ifdef OVERWORLD_SHADER vec3 Background = vec3(0.0); - #if RESOURCEPACK_SKY == 1 || RESOURCEPACK_SKY == 0 - vec3 orbitstar = vec3(feetPlayerPos_normalized.x,abs(feetPlayerPos_normalized.y),feetPlayerPos_normalized.z); orbitstar.x -= WsunVec.x*0.2; - Background += stars(orbitstar) * 10.0; + // vec3 orbitstar = vec3(feetPlayerPos_normalized.x,abs(feetPlayerPos_normalized.y),feetPlayerPos_normalized.z); orbitstar.x -= WsunVec.x*0.2; + + vec3 orbitstar = normalize(mat3(gbufferModelViewInverse) * toScreenSpace(vec3(texcoord,1.0))); + float radiance = 2.39996 - (worldTime + worldDay*24000.0) / 24000.0; + // float radiance = 2.39996 + frameTimeCounter; + mat2 rotationMatrix = mat2(vec2(cos(radiance), -sin(radiance)), vec2(sin(radiance), cos(radiance))); + + orbitstar.xy *= rotationMatrix; + + Background += stars(orbitstar) * 10.0 * clamp(-unsigned_WsunVec.y*2.0,0.0,1.0); #endif #if RESOURCEPACK_SKY == 2 @@ -1030,23 +1034,39 @@ void main() { //////////////////////////////////////////////////////////////////////////////////// #ifdef OVERWORLD_SHADER + float LM_shadowMapFallback = min(max(lightmap.y-0.8, 0.0) * 25,1.0); + float LightningPhase = 0.0; vec3 LightningFlashLighting = Iris_Lightningflash(feetPlayerPos, lightningBoltPosition.xyz, slopednormal, LightningPhase) * pow(lightmap.y,10); - #endif - - #ifdef OVERWORLD_SHADER NdotL = clamp((-15 + dot(slopednormal, WsunVec)*255.0) / 240.0 ,0.0,1.0); - - vec3 shadowPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; + // NdotL = 1; + float flatNormNdotL = clamp((-15 + dot(viewToWorld(FlatNormals), WsunVec)*255.0) / 240.0 ,0.0,1.0); - // if(!entities) if(!hand) + // setup shadow projection + vec3 shadowPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; if(!hand) GriAndEminShadowFix(shadowPlayerPos, viewToWorld(FlatNormals), vanilla_AO, lightmap.y); - + vec3 projectedShadowPosition = mat3(shadowModelView) * shadowPlayerPos + shadowModelView[3].xyz; projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; - //apply distortion + #if OPTIMIZED_SHADOW_DISTANCE > 0.0 + float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+16),0.0)*5.0,1.0)); + float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / shadowDistance,0.0)*5.0,1.0)); + #else + vec3 shadowEdgePos = projectedShadowPosition * vec3(0.4,0.4,0.5/6.0) + vec3(0.5,0.5,0.12); + float fadeLength = max((shadowDistance/256)*30,10.0); + + vec3 cubicRadius = clamp( min((1.0-shadowEdgePos)*fadeLength, shadowEdgePos*fadeLength),0.0,1.0); + float shadowmapFade = cubicRadius.x*cubicRadius.y*cubicRadius.z; + + shadowmapFade = 1.0 - pow(1.0-pow(shadowmapFade,1.5),3.0); // make it nice and soft :) + + float shadowMapFalloff = shadowmapFade; + float shadowMapFalloff2 = shadowmapFade; + #endif + + // un-distort #ifdef DISTORT_SHADOWMAP float distortFactor = calcDistort(projectedShadowPosition.xy); projectedShadowPosition.xy *= distortFactor; @@ -1054,83 +1074,22 @@ void main() { float distortFactor = 1.0; #endif - if(shadowDistanceRenderMul < 0.0) shadowMapFalloff = abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.z) < 6.0 ? 1.0 : 0.0; + projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5) ; - if(shadowMapFalloff > 0.0){ - shadowMap = vec3(0.0); - vec3 ShadowColor = vec3(0.0); + float ShadowAlpha = 0.0; // this is for subsurface scattering later. + Shadows = ComputeShadowMap(projectedShadowPosition, distortFactor, noise_2, filteredShadow.x, flatNormNdotL, shadowMapFalloff, DirectLightColor, ShadowAlpha, LabSSS > 0.0); - projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5); - - float biasOffset = 0.0; - - #ifdef BASIC_SHADOW_FILTER - float rdMul = filteredShadow.x*distortFactor*d0*k/shadowMapResolution; - - for(int i = 0; i < SHADOW_FILTER_SAMPLE_COUNT; i++){ - vec2 offsetS = tapLocation_simple(i, 7, 9, noise_2) * 0.5; - - projectedShadowPosition += vec3(rdMul*offsetS, biasOffset); - - #ifdef TRANSLUCENT_COLORED_SHADOWS - float opaqueShadow = shadow2D(shadowtex0, projectedShadowPosition).x; - shadowMap += opaqueShadow / SHADOW_FILTER_SAMPLE_COUNT; - - vec4 translucentShadow = texture2D(shadowcolor0, projectedShadowPosition.xy); - float shadowAlpha = clamp(1.0 - pow(translucentShadow.a,5.0),0.0,1.0); - - #if SSS_TYPE != 0 - if(LabSSS > 0.0) ShadowColor += (DirectLightColor * clamp(pow(1.0-shadowAlpha,5.0),0.0,1.0) + DirectLightColor * translucentShadow.rgb * shadowAlpha * (1.0 - opaqueShadow)) / SHADOW_FILTER_SAMPLE_COUNT; - else ShadowColor = DirectLightColor; - #endif - - if(shadow2D(shadowtex1, projectedShadowPosition).x > projectedShadowPosition.z) shadowMap += (translucentShadow.rgb * shadowAlpha * (1.0 - opaqueShadow)) / SHADOW_FILTER_SAMPLE_COUNT; - - #else - shadowMap += vec3(shadow2D(shadow, projectedShadowPosition).x / SHADOW_FILTER_SAMPLE_COUNT); - #endif - } - - #else - - #ifdef TRANSLUCENT_COLORED_SHADOWS - float opaqueShadow = shadow2D(shadowtex0, projectedShadowPosition).x; - shadowMap += opaqueShadow; - - vec4 translucentShadow = texture2D(shadowcolor0, projectedShadowPosition.xy); - translucentShadow.rgb = normalize(translucentShadow.rgb + 0.0001); - float shadowAlpha = clamp(1.0 - pow(translucentShadow.a,5.0),0.0,1.0); - - #if SSS_TYPE != 0 - if(LabSSS > 0.0) ShadowColor += DirectLightColor * (1.0 - shadowAlpha) + DirectLightColor * translucentShadow.rgb * shadowAlpha * (1.0 - opaqueShadow); - else ShadowColor = DirectLightColor; - #endif - - if(shadow2D(shadowtex1, projectedShadowPosition).x > projectedShadowPosition.z) shadowMap += translucentShadow.rgb * shadowAlpha * (1.0 - opaqueShadow); - - #else - shadowMap += shadow2D(shadow, projectedShadowPosition).x; - #endif - #endif - - #ifdef TRANSLUCENT_COLORED_SHADOWS - DirectLightColor = ShadowColor; - #endif - - Shadows = shadowMap; - } - - if(!iswater) Shadows = mix(vec3(LM_shadowMapFallback), Shadows, shadowMapFalloff2); + if(!isWater) Shadows *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2); #ifdef OLD_LIGHTLEAK_FIX - if (isEyeInWater == 0) Shadows *= clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0); // light leak fix + if (isEyeInWater == 0) Shadows *= lightLeakFix; // light leak fix #endif - + #endif //////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////// UNDER WATER SHADING //////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////// - if ((isEyeInWater == 0 && iswater) || (isEyeInWater == 1 && !iswater)){ + /////////////////////////////////////////////////////////////////////////////////////////////// + if ((isEyeInWater == 0 && isWater) || (isEyeInWater == 1 && !isWater)){ #ifdef DISTANT_HORIZONS vec3 viewPos0 = toScreenSpace_DH(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5, z0, DH_depth0); #else @@ -1152,63 +1111,12 @@ void main() { float estimatedSunDepth = Vdiff; //assuming water plane Absorbtion = mix(exp(-2.0 * totEpsilon * estimatedDepth), exp(-8.0 * totEpsilon), depthfalloff); - DirectLightColor *= Absorbtion; + // DirectLightColor *= Absorbtion; // apply caustics to the lighting, and make sure they dont look weird DirectLightColor *= mix(1.0, waterCaustics(feetPlayerPos + cameraPosition, WsunVec)*WATER_CAUSTICS_BRIGHTNESS + 0.25, clamp(estimatedDepth,0,1)); } - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////// SUN SSS //////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - - #if SSS_TYPE != 0 - - - #ifdef DISTANT_HORIZONS - shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance, max(far-32,0.0)),0.0)*5.0,1.0),2.0),2.0); - #endif - - #if defined DISTANT_HORIZONS_SHADOWMAP && defined Variable_Penumbra_Shadows - ShadowBlockerDepth = mix(pow(1.0 - Shadows.x,2.0), ShadowBlockerDepth, shadowMapFalloff); - #endif - - #if !defined Variable_Penumbra_Shadows - ShadowBlockerDepth = pow(1.0 - clamp(Shadows.x,0,1),2.0); - #endif - - - float sunSSS_density = LabSSS; - - #ifndef RENDER_ENTITY_SHADOWS - if(entities) sunSSS_density = 0.0; - #endif - - // if (!hand){ - #ifdef SCREENSPACE_CONTACT_SHADOWS - - vec2 SS_directLight = SSRT_Shadows(toScreenSpace_DH(texcoord/RENDER_SCALE, z, DH_depth1), isDHrange, normalize(WsunVec*mat3(gbufferModelViewInverse)), interleaved_gradientNoise(), sunSSS_density > 0.0, hand); - - Shadows = min(Shadows, SS_directLight.r); - ShadowBlockerDepth = mix(SS_directLight.g, ShadowBlockerDepth, shadowMapFalloff); - - #else - ShadowBlockerDepth = mix(1.0, ShadowBlockerDepth, shadowMapFalloff); - #endif - - Direct_SSS = SubsurfaceScattering_sun(albedo, ShadowBlockerDepth, sunSSS_density, clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0)); - - Direct_SSS *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff); - if (isEyeInWater == 0) Direct_SSS *= clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0); // light leak fix - // } - #endif - - #ifdef CLOUDS_SHADOWS - cloudShadow = GetCloudShadow(feetPlayerPos); - Shadows *= cloudShadow; - Direct_SSS *= cloudShadow; - #endif - #endif #ifdef END_SHADER float vortexBounds = clamp(vortexBoundRange - length(feetPlayerPos+cameraPosition), 0.0,1.0); @@ -1225,8 +1133,6 @@ void main() { Direct_lighting += lightColors * endPhase * end_NdotL * fogShadow; AmbientLightColor += lightColors * (endPhase*endPhase) * (1.0-exp(vec3(0.6,2.0,2) * -(endPhase*0.1))) ; - - Direct_lighting *= Absorbtion; #endif ///////////////////////////////////////////////////////////////////////////////// @@ -1234,20 +1140,19 @@ void main() { ///////////////////////////////////////////////////////////////////////////////// #if defined OVERWORLD_SHADER && (indirect_effect == 0 || indirect_effect == 1) - - vec3 ambientcoefs = slopednormal / dot(abs(slopednormal), vec3(1)); - + float allDirections = dot(abs(slopednormal),vec3(1.0)); + vec3 ambientcoefs = slopednormal / allDirections; float SkylightDir = ambientcoefs.y*1.5; + if(isGrass) SkylightDir = 1.25; - float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.2 + (1.0-lightmap.y)*0.8) ; - + float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.2 + (1-lightmap.y)*0.8) ; + #if indirect_effect == 1 - skylight = min(skylight, (SSAO_SSS.x*SSAO_SSS.x*SSAO_SSS.x) * 2.5); + skylight = min(skylight, mix(0.95, 2.5, pow(1-pow(1-SSAO_SSS.x, 0.5),2.0) )); #endif Indirect_lighting = AmbientLightColor * skylight; - #endif #ifdef NETHER_SHADER @@ -1260,15 +1165,13 @@ void main() { // down *= pow( max(-slopednormal.y, 0), 2); // Indirect_lighting += up + down; - Indirect_lighting = vec3(0.1); - + Indirect_lighting = vec3(0.05); #endif #ifdef END_SHADER Indirect_lighting += (vec3(0.5,0.75,1.0) * 0.9 + 0.1) * 0.1; Indirect_lighting *= clamp(1.5 + dot(normal, feetPlayerPos_normalized)*0.5,0,2); - #endif #ifdef IS_LPV_ENABLED @@ -1283,9 +1186,8 @@ void main() { const vec3 lpvPos = vec3(0.0); #endif - Indirect_lighting = DoAmbientLightColor(lpvPos, Indirect_lighting, MinimumLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy); + Indirect_lighting = DoAmbientLightColor(lpvPos, Indirect_lighting, MinimumLightColor, vec3(TORCH_R,TORCH_G,TORCH_B) , lightmap.xy, exposure); - Indirect_lighting *= Absorbtion; #ifdef OVERWORLD_SHADER Indirect_lighting += LightningFlashLighting; #endif @@ -1293,7 +1195,7 @@ void main() { #ifdef SSS_view Indirect_lighting = vec3(3.0); #endif - + ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// EFFECTS FOR INDIRECT ///////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// @@ -1301,78 +1203,117 @@ void main() { float SkySSS = 1.0; vec3 AO = vec3(1.0); - #if indirect_effect == 0 - AO = vec3( exp( (vanilla_AO*vanilla_AO) * -5) ) ; + AO = pow(1.0 - vanilla_AO*vanilla_AO,5.0) * vec3(1.0); Indirect_lighting *= AO; #endif #if indirect_effect == 1 - AO = vec3( exp( (vanilla_AO*vanilla_AO) * -3) ); - - AO *= SSAO_SSS.x*SSAO_SSS.x*SSAO_SSS.x; - // AO *= exp((1-SSAO_SSS.x) * -5); - SkySSS = SSAO_SSS.y; + float vanillaAO_curve = pow(1.0 - vanilla_AO*vanilla_AO,5.0); + float SSAO_curve = pow(SSAO_SSS.x,6); + + // use the min of vanilla ao so they dont overdarken eachother + AO = vec3( min(vanillaAO_curve, SSAO_curve) ); + Indirect_lighting *= AO; #endif // GTAO #if indirect_effect == 2 - vec2 r2 = fract(R2_samples((frameCounter%40000) + frameCounter*2) + bnoise); - if(!hand){ - Indirect_lighting = AmbientLightColor/2.5; - AO = ambient_occlusion(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z), viewPos, worldToView(slopednormal), r2) * vec3(1.0); - } + Indirect_lighting = AmbientLightColor/2.5; + + AO = ambient_occlusion(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z), viewPos, worldToView(slopednormal), r2) * vec3(1.0); + Indirect_lighting *= AO; #endif // RTAO and/or SSGI #if indirect_effect == 3 || indirect_effect == 4 - if(!hand){ - Indirect_lighting = AmbientLightColor; - ApplySSRT(Indirect_lighting, viewPos, normal, vec3(bnoise, noise_2), lightmap.xy, AmbientLightColor*2.5, vec3(TORCH_R,TORCH_G,TORCH_B), isGrass, hand); - } + Indirect_lighting = AmbientLightColor; + ApplySSRT(Indirect_lighting, viewPos, normal, vec3(bnoise, noise_2), lightmap.xy, AmbientLightColor*2.5, vec3(TORCH_R,TORCH_G,TORCH_B), isGrass, hand); #endif #if defined END_SHADER Direct_lighting *= AO; #endif - + //////////////////////////////////////////////////////////////////////////////// + ///////////////////////// SUB SURFACE SCATTERING //////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ///////////////////////////// SKY SSS ///////////////////////////// - #if defined Ambient_SSS && defined OVERWORLD_SHADER && indirect_effect == 1 if (!hand){ - vec3 ambientColor = AmbientLightColor * 2.5 * ambient_brightness; // x2.5 to match the brightness of upfacing skylight - float skylightmap = pow(lightmap.y, 3.0); + vec3 ambientColor = (AmbientLightColor*2.5) * ambient_brightness * 0.7; // x2.5 to match the brightness of upfacing skylight Indirect_SSS = SubsurfaceScattering_sky(albedo, SkySSS, LabSSS); - Indirect_SSS *= ambientColor; - Indirect_SSS *= skylightmap; + Indirect_SSS *= lightmap.y*lightmap.y*lightmap.y; Indirect_SSS *= AO; // apply to ambient light. - Indirect_lighting = max(Indirect_lighting, Indirect_SSS * ambientsss_brightness ); + // if(texcoord.x>0.5) + Indirect_lighting = max(Indirect_lighting, ambientColor * Indirect_SSS * ambientsss_brightness); - #ifdef OVERWORLD_SHADER - if(LabSSS > 0.0) Indirect_lighting += (1.0-SkySSS) * LightningPhase * lightningEffect * pow(lightmap.y,10); - #endif + // #ifdef OVERWORLD_SHADER + // if(LabSSS > 0.0) Indirect_lighting += (1.0-SkySSS) * LightningPhase * lightningEffect * pow(lightmap.y,10); + // #endif } #endif + //////////////////////////////// SUN SSS //////////////////////////////// + #if SSS_TYPE != 0 && defined OVERWORLD_SHADER + + float sunSSS_density = LabSSS; + float SSS_shadow = ShadowAlpha * Shadows; + // #ifdef DISTANT_HORIZONS_SHADOWMAP + // shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance,far),0.0)*5.0,1.0)); + // #endif + + #ifndef RENDER_ENTITY_SHADOWS + if(entities) sunSSS_density = 0.0; + #endif + + + #ifdef SCREENSPACE_CONTACT_SHADOWS + vec2 SS_directLight = SSRT_Shadows(toScreenSpace_DH(texcoord/RENDER_SCALE, z, DH_depth1), isDHrange, normalize(WsunVec*mat3(gbufferModelViewInverse)), interleaved_gradientNoise(), sunSSS_density > 0.0 && shadowMapFalloff2 < 1.0, hand); + + // combine shadowmap with a minumum shadow determined by the screenspace shadows. + Shadows = min(Shadows, SS_directLight.r); + + // combine shadowmap blocker depth with a minumum determined by the screenspace shadows, starting after the shadowmap ends + ShadowBlockerDepth = mix(SS_directLight.g, ShadowBlockerDepth, shadowMapFalloff2); + #endif + + Direct_SSS = SubsurfaceScattering_sun(albedo, ShadowBlockerDepth, sunSSS_density, clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), SSS_shadow); + // Direct_SSS *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2); + if (isEyeInWater == 0) Direct_SSS *= lightLeakFix; + + #ifndef SCREENSPACE_CONTACT_SHADOWS + Direct_SSS = mix(vec3(0.0), Direct_SSS, shadowMapFalloff2); + #endif + + #ifdef CLOUDS_SHADOWS + cloudShadow = GetCloudShadow(feetPlayerPos); + Shadows *= cloudShadow; + Direct_SSS *= cloudShadow; + #endif + + #endif ///////////////////////////////////////////////////////////////////////// ///////////////////////////// FINALIZE ///////////////////////////// ///////////////////////////////////////////////////////////////////////// + + #ifdef SSS_view albedo = vec3(1); + NdotL = 0; #endif #ifdef OVERWORLD_SHADER - // do these here so it gets underwater absorbtion. Direct_lighting = max(DirectLightColor * NdotL * Shadows, DirectLightColor * Direct_SSS); #endif @@ -1383,17 +1324,15 @@ void main() { DoSpecularReflections(gl_FragData[0].rgb, viewPos, feetPlayerPos_normalized, WsunVec, specularNoises, normal, SpecularTex.r, SpecularTex.g, albedo, DirectLightColor*Shadows*NdotL, lightmap.y, hand); #endif - // gl_FragData[0].rgb += vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B)*0.1 * darkSpecularHighlight(feetPlayerPos, normal, SpecularTex.r, SpecularTex.g); - - Emission(gl_FragData[0].rgb, albedo, SpecularTex.a); + Emission(gl_FragData[0].rgb, albedo, SpecularTex.a, exposure); if(lightningBolt) gl_FragData[0].rgb = vec3(77.0, 153.0, 255.0); + gl_FragData[0].rgb *= Absorbtion; } - - if(translucent_alpha > 0.0 ){ + if(translucentMasks > 0.0){ #ifdef DISTANT_HORIZONS vec4 vlBehingTranslucents = BilateralUpscale_DH(colortex13, colortex12, gl_FragCoord.xy, sqrt(texture2D(colortex12,texcoord).a/65000.0)); #else @@ -1403,22 +1342,28 @@ void main() { gl_FragData[0].rgb = gl_FragData[0].rgb * vlBehingTranslucents.a + vlBehingTranslucents.rgb; } + // gl_FragData[0].rgb = vec3(1.0) * clamp(1.0 - filteredShadow.y/1,0,1); + // if(hideGUI > 0) gl_FragData[0].rgb = vec3(1.0) * Shadows; ////// DEBUG VIEW STUFF - #if DEBUG_VIEW == debug_SHADOWMAP - vec3 OutsideShadowMap_and_DH_shadow = (shadowMapFalloff > 0.0 && z >= 1.0) ? vec3(0.25,1.0,0.25) : vec3(1.0,0.25,0.25); - vec3 Normal_Shadowmap = z < 1.0 ? vec3(1.0,1.0,1.0) : OutsideShadowMap_and_DH_shadow; - gl_FragData[0].rgb = mix(vec3(0.1) * (normal.y * 0.1 +0.9), Normal_Shadowmap, shadowMap) * 30.0; - #endif + // #if DEBUG_VIEW == debug_SHADOWMAP + // vec3 OutsideShadowMap_and_DH_shadow = (shadowMapFalloff > 0.0 && z >= 1.0) ? vec3(0.25,1.0,0.25) : vec3(1.0,0.25,0.25); + // vec3 Normal_Shadowmap = z < 1.0 ? vec3(1.0,1.0,1.0) : OutsideShadowMap_and_DH_shadow; + // gl_FragData[0].rgb = mix(vec3(0.1) * (normal.y * 0.1 +0.9), Normal_Shadowmap, shadowMap) * 30.0; + // #endif #if DEBUG_VIEW == debug_NORMALS - gl_FragData[0].rgb = FlatNormals; + if(swappedDepth >= 1.0) Direct_lighting = vec3(1.0); + gl_FragData[0].rgb = worldToView(normal); #endif #if DEBUG_VIEW == debug_SPECULAR + if(swappedDepth >= 1.0) Direct_lighting = vec3(1.0); gl_FragData[0].rgb = SpecularTex.rgb; #endif #if DEBUG_VIEW == debug_INDIRECT + if(swappedDepth >= 1.0) Direct_lighting = vec3(5.0); gl_FragData[0].rgb = Indirect_lighting; #endif #if DEBUG_VIEW == debug_DIRECT + if(swappedDepth >= 1.0) Direct_lighting = vec3(15.0); gl_FragData[0].rgb = Direct_lighting; #endif #if DEBUG_VIEW == debug_VIEW_POSITION @@ -1426,14 +1371,34 @@ void main() { #endif #if DEBUG_VIEW == debug_FILTERED_STUFF vec3 FilteredDebug = vec3(15.0) * exp(-7.0 * vec3(1.0,0.5,1.0) * filteredShadow.y); - // FilteredDebug += vec3(15.0) * exp(-7.0 * vec3(1.0,1.0,0.5) * pow(SSAO_SSS.x,2)); - // FilteredDebug += vec3(15.0) * exp(-7.0 * vec3(0.5,1.0,1.0) * pow(SSAO_SSS.y,2)); + FilteredDebug += vec3(15.0) * exp(-7.0 * vec3(1.0,1.0,0.5) * pow(SSAO_SSS.x,2)); + FilteredDebug += vec3(15.0) * exp(-7.0 * vec3(0.5,1.0,1.0) * pow(SSAO_SSS.y,2)); gl_FragData[0].rgb = FilteredDebug; #endif + #if DEBUG_VIEW == debug_TEMPORAL_REPROJECTION + vec3 color = vec3(1.0); + // vec4 reprojectedBuffer0 = texture2D(colortex12, texcoord); + vec4 reprojectedBuffer = texture2D(colortex14, texcoord); + + vec3 Indirect = vec3(1.0) * pow(reprojectedBuffer.x,6.0) + vec3(0,25,0) * ( 1.0 - reprojectedBuffer.y ); + // vec3 Direct = vec3(15.0) * exp(-3*reprojectedBuffer1.y); + color += Indirect; + // color += Direct; + // color *= albedo; + + // color *= dot(vec3(reprojectedBuffer.a)*2-1, worldToView(normal)); + + color *= reprojectedBuffer.a; + if(swappedDepth >= 1.0) color = vec3(1.0); + gl_FragData[0].rgb = color; + #endif + + // float shadew = clamp(1.0 - filteredShadow.y/1,0.0,1.0); + // gl_FragData[0].rgb = vec3(1) * exp( (1-shadew) * -7); #ifdef CLOUDS_INFRONT_OF_WORLD gl_FragData[1] = texture2D(colortex2, texcoord); diff --git a/shaders/entity.properties b/shaders/entity.properties index 0b7aab5..79d75b1 100644 --- a/shaders/entity.properties +++ b/shaders/entity.properties @@ -9,12 +9,18 @@ entity.1301= item_frame item_display entity.1302= spectral_arrow bigglobe:torch_arrow entity.1303= tnt firework_rocket -###### -###### all the different strengths of subsurface scattering and what entities to put them on. -###### +################################################ +###### SUB-SURFACE SCATTERING +################################################ ## medium sss (same as strong sss for blocks) -entity.1401= slime giant ghast elder_guardian +entity.1401 = giant ghast elder_guardian ## weak sss (same as weak sss for blocks) -entity.1402= 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 trader_llama +entity.1402 = furnace_minecart player sheep frog chicken iron_golem 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 trader_llama + +################################################ +###### REFLECTIVE TRANSLUCENTS +################################################ + +entity.1403 = slime \ No newline at end of file diff --git a/shaders/item.properties b/shaders/item.properties index eaabf29..76c1378 100644 --- a/shaders/item.properties +++ b/shaders/item.properties @@ -1 +1 @@ -item.1000= glow_berries soul_lantern soul_torch conduit beacon sea_pickle sea_lantern glowstone torch redstone_torch jack_o_lantern magma_block lantern shroomlight end_rod lava_bucket conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:conquest:iron_candelabrum_1 conquest:conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light +item.1000 = glow_berries soul_lantern soul_torch conduit beacon sea_pickle sea_lantern glowstone torch redstone_torch jack_o_lantern magma_block lantern shroomlight end_rod lava_bucket conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:conquest:iron_candelabrum_1 conquest:conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index b4a37b3..bc98f7d 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -26,10 +26,13 @@ screen.Waving_Stuff = Waving Stuff screen.Direct_Light = Direct Light screen.Shadows = Shadows - option.SCREENSPACE_CONTACT_SHADOWS = Contact Shadows + option.TRANSLUCENT_COLORED_SHADOWS = Colored Shadows + option.SCREENSPACE_CONTACT_SHADOWS = Screen-space Shadows option.RENDER_ENTITY_SHADOWS = Shadows for Entities option.shadowMapResolution = Shadow Resolution option.shadowDistance = Shadow Distance + value.shadowDistance.32.0 = 2 Chunks + value.shadowDistance.48.0 = 3 Chunks value.shadowDistance.64.0 = 4 Chunks value.shadowDistance.80.0 = 5 Chunks value.shadowDistance.96.0 = 6 Chunks @@ -51,18 +54,34 @@ screen.Direct_Light = Direct Light value.shadowDistance.352.0 = 22 Chunks value.shadowDistance.368.0 = 23 Chunks value.shadowDistance.384.0 = 24 Chunks - value.shadowDistance.400.0 = 25 Chunks - value.shadowDistance.416.0 = 26 Chunks - value.shadowDistance.432.0 = 27 Chunks - value.shadowDistance.448.0 = 28 Chunks - value.shadowDistance.464.0 = 29 Chunks - value.shadowDistance.480.0 = 30 Chunks - value.shadowDistance.496.0 = 31 Chunks value.shadowDistance.512.0 = 32 Chunks - option.shadowDistanceRenderMul = Max Shadow Bounds - value.shadowDistanceRenderMul.-1.0 = Un-Optimized - value.shadowDistanceRenderMul.1.0 = Optimized + value.shadowDistance.768.0 = 48 Chunks + value.shadowDistance.1024.0 = 64 Chunks + value.shadowDistance.1536.0 = 96 Chunks + value.shadowDistance.2048.0 = 128 Chunks + value.shadowDistance.4096.0 = 256 Chunks + value.shadowDistance.8192.0 = 512 Chunks + + option.OPTIMIZED_SHADOW_DISTANCE = Max Shadow Bounds + value.OPTIMIZED_SHADOW_DISTANCE.-1.0 = Un-Optimized + value.OPTIMIZED_SHADOW_DISTANCE.1.0 = Optimized option.entityShadowDistanceMul = Entity Shadow Distance + value.entityShadowDistanceMul.0.01 = 1% of Shadow Distance + value.entityShadowDistanceMul.0.02 = 2% of Shadow Distance + value.entityShadowDistanceMul.0.03 = 3% of Shadow Distance + value.entityShadowDistanceMul.0.04 = 4% of Shadow Distance + value.entityShadowDistanceMul.0.05 = 5% of Shadow Distance + value.entityShadowDistanceMul.0.10 = 10% of Shadow Distance + value.entityShadowDistanceMul.0.15 = 15% of Shadow Distance + value.entityShadowDistanceMul.0.20 = 20% of Shadow Distance + value.entityShadowDistanceMul.0.25 = 25% of Shadow Distance + value.entityShadowDistanceMul.0.30 = 30% of Shadow Distance + value.entityShadowDistanceMul.0.35 = 35% of Shadow Distance + value.entityShadowDistanceMul.0.40 = 40% of Shadow Distance + value.entityShadowDistanceMul.0.45 = 45% of Shadow Distance + value.entityShadowDistanceMul.0.50 = 50% of Shadow Distance + value.entityShadowDistanceMul.0.75 = 75% of Shadow Distance + value.entityShadowDistanceMul.1.00 = 100% of Shadow Distance screen.Filtering = Shadow Filtering Settings option.SHADOW_FILTER_SAMPLE_COUNT = Basic Shadow Filter Samples @@ -71,7 +90,7 @@ screen.Direct_Light = Direct Light option.VPS_Search_Samples = VPS Filter Samples option.Max_Shadow_Filter_Radius = Maximum Shadow Filter Radius option.Max_Filter_Depth = Sun Size Factor - + screen.LPV = FloodFill option.LPV_ENABLED = Enabled option.LPV_SIZE = Size @@ -83,7 +102,6 @@ screen.Direct_Light = Direct Light option.LPV_REDSTONE_LIGHTS = Redstone Lights option.LPV_COLORED_CANDLES = Colored Candles - screen.Subsurface_Scattering = Sub-Surface Scattering option.LabSSS_Curve = LabSSS Curve option.MISC_BLOCK_SSS = SSS for random blocks @@ -490,11 +508,11 @@ option.moon_illuminance.comment = Configure the brightness of the moon screen.Direct_Light.comment = Configure settings related to the sun and shadows. screen.Shadows.comment = Configure the shadows from the sun to your liking. - option.SCREENSPACE_CONTACT_SHADOWS.comment = Screen-space contact shadows. §bWhat is this?§r These are small shadows for things that are far away, and on small details nearby. §aPERFORMANCE COST:§r low to medium; it is more expensive at higher resolutions. + option.SCREENSPACE_CONTACT_SHADOWS.comment = §bWhat is this?§r These are shadows for things that are far away, and on small details nearby. §aPERFORMANCE COST:§r low to medium; it is more expensive at higher resolutions. option.RENDER_ENTITY_SHADOWS.comment = §bWhat is this?§r Shadows on all types of entities, like mobs, chests, banners, or signs. §aPERFORMANCE COST:§r low to high; it is very expensive when there are many entities nearby. option.shadowMapResolution.comment = The quality of shadows from the sun casted by things in the world. §aPERFORMANCE COST:§r medium to very high; Shadows must render the 3D world a second time from the perspective of the sun, this is why it cuts performance in half. option.shadowDistance.comment = The maximum distance the shadowmap can render. The distance is not measured linearly in chunks when set to un-optimized. §aPERFORMANCE COST:§r medium to very high; If the chunk render distance is high, the shadows will become more expensive. - option.shadowDistanceRenderMul.comment = Render the shadows only in a sphere around you, limited to a max distance in chunks. Un-optimized does not render the shadows in a sphere and is not locked to chunks; it can cover alot more area with the same distance settings. The distance is not measured in chunks when set to un-optimized. §aPERFORMANCE COST:§r low to medium. Optimized is faster, and unoptimized is slower. + option.OPTIMIZED_SHADOW_DISTANCE.comment = Render the shadows only in a sphere around you, limited to a max distance in chunks. Un-optimized does not render the shadows in a sphere and is not locked to chunks; it can cover alot more area with the same distance settings. The distance is not measured in chunks when set to un-optimized. §aPERFORMANCE COST:§r low to medium. Optimized is faster, and unoptimized is slower. screen.Filtering.comment = Configure the filtering effects applied to the shadows. option.SHADOW_FILTER_SAMPLE_COUNT.comment = The quality of the basic shadow filter. This filter just softens the shadows. §aPERFORMANCE COST:§r low to medium; Increasing this should reduce some noise at the edge of shadows. option.Min_Shadow_Filter_Radius.comment = The maximum softness of the basic shadow filter. @@ -674,4 +692,6 @@ value.DH_KNOWN_ISSUES.1 = §a GTAO, RTAO, and SSGI break on LODs - DH support un option.DISTANT_HORIZONS_SHADOWMAP = §c(DO NOT USE IF YOU DO NOT KNOW WHAT THIS IS)§r DH shadowmap support option.DISTANT_HORIZONS_SHADOWMAP.comment = §cTHIS SETTING WILL DESTROY PERFORMANCE THIS WILL MAKE SHADOWS LOOK BLOCKY, FLICKERY, AND LOW DETAIL§r. set shadow distance to 32 chunks (or more). set shadow resolution to 4096 (or more) option.TOGGLE_VL_FOG = Toggle Volumetric Fog -option.TOGGLE_VL_FOG.comment = one big button to just turn all the fog off. \ No newline at end of file +option.TOGGLE_VL_FOG.comment = one big button to just turn all the fog off. + +option.TRANSLUCENT_COLORED_SHADOWS.comment = §bWhat is this?§r This effect allows translucent things like stained glass to color the sunlight as it passes through the it. §aPERFORMANCE COST:§r medium \ No newline at end of file diff --git a/shaders/lib/diffuse_lighting.glsl b/shaders/lib/diffuse_lighting.glsl index fd033ab..c5904a1 100644 --- a/shaders/lib/diffuse_lighting.glsl +++ b/shaders/lib/diffuse_lighting.glsl @@ -3,32 +3,41 @@ vec3 DoAmbientLightColor( vec3 SkyColor, vec3 MinimumColor, vec3 TorchColor, - vec2 Lightmap + vec2 Lightmap, + float Exposure ){ + // Lightmap = vec2(0.0,1.0); + float LightLevelZero = clamp(pow(eyeBrightnessSmooth.y/240. + Lightmap.y,2.0) ,0.0,1.0); // do sky lighting. float skyLM = (pow(Lightmap.y,15.0)*2.0 + pow(Lightmap.y,2.5))*0.5; vec3 MinimumLight = MinimumColor * (MIN_LIGHT_AMOUNT*0.01 + nightVision); - vec3 IndirectLight = max(SkyColor * ambient_brightness * skyLM, MinimumLight); - - // do torch lighting. - // float TorchLM = 10.0 - ( 1.0 / (pow(exp(-0.5*inversesqrt(Lightmap.x)),5.0)+0.1)); - // TorchLM = pow(TorchLM/4,10) + pow(Lightmap.x,1.5)*0.5; - - float TorchLM = pow(Lightmap.x,10.0)*5.0 + pow(Lightmap.x,1.5); - vec3 TorchLight = TorchColor * TORCH_AMOUNT * TorchLM * (1.0 + LightLevelZero*dot(SkyColor * ambient_brightness,vec3(0.3333))); - + vec3 IndirectLight = max(SkyColor * ambient_brightness * skyLM * 0.7, MinimumLight); + + // do torch lighting + float TorchLM = pow(1.0-sqrt(1.0-clamp(Lightmap.x,0.0,1.0)),2.0) * 2.0; + float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*Exposure),0.0,1.0)) ; + vec3 TorchLight = TorchColor * TorchLM * TORCH_AMOUNT ; + #if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store vec4 lpvSample = SampleLpvLinear(lpvPos); vec3 LpvTorchLight = GetLpvBlockLight(lpvSample); // TODO: needs work, just binary transition for now - float LpvFadeF = clamp(lpvPos, vec3(0.0), LpvSize3 - 1.0) == lpvPos ? 1.0 : 0.0; - TorchLight = mix(TorchLight, LpvTorchLight, LpvFadeF); + // float LpvFadeF = clamp(lpvPos, vec3(0.0), LpvSize3 - 1.0) == lpvPos ? 1.0 : 0.0; + + // i gotchu + float fadeLength = 10.0; // in blocks + vec3 cubicRadius = clamp( min(((LpvSize3-1.0) - lpvPos)/fadeLength, lpvPos/fadeLength) ,0.0,1.0); + float LpvFadeF = cubicRadius.x*cubicRadius.y*cubicRadius.z; + + LpvFadeF = 1.0 - pow(1.0-pow(LpvFadeF,1.5),3.0); // make it nice and soft :) + + TorchLight = mix(TorchLight,LpvTorchLight/5.0, LpvFadeF) ; #endif - return IndirectLight + TorchLight; + return IndirectLight + TorchLight * TorchBrightness_autoAdjust; } vec4 RT_AmbientLight( diff --git a/shaders/shaders.properties b/shaders/shaders.properties index f4e0399..7a852c1 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -27,22 +27,24 @@ iris.features.optional = ENTITY_TRANSLUCENT REVERSED_CULLING COMPUTE_SHADERS CUS #ifndef RENDER_ENTITY_SHADOWS shadowBlockEntities = false shadowEntities = false + shadowPlayer = true #endif -#if defined TRANSLUCENT_ENTITIES && defined IS_IRIS - separateEntityDraws = true - program.gbuffers_entities_translucent.enabled = true - program.gbuffers_block_translucent.enabled = true - - blend.gbuffers_entities_translucent = off - blend.gbuffers_block_translucent = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE +#ifdef TRANSLUCENT_ENTITIES + separateEntityDraws = true #else - separateEntityDraws = false - program.gbuffers_entities_translucent.enabled = IS_IRIS - program.gbuffers_block_translucent.enabled = IS_IRIS + separateEntityDraws = true #endif +program.world0/gbuffers_entities_translucent.enabled = TRANSLUCENT_ENTITIES +program.world0/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES +program.world-1/gbuffers_entities_translucent.enabled = TRANSLUCENT_ENTITIES +program.world-1/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES +program.world1/gbuffers_entities_translucent.enabled = TRANSLUCENT_ENTITIES +program.world1/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES + + #if defined DISTANT_HORIZONS && defined IS_IRIS #if defined DISTANT_HORIZONS_SHADOWMAP @@ -51,15 +53,15 @@ iris.features.optional = ENTITY_TRANSLUCENT REVERSED_CULLING COMPUTE_SHADERS CUS dhShadow.enabled = false #endif - program.dh_terrain.enabled = true - program.dh_water.enabled = true + program.world0/dh_terrain.enabled = true + program.world0/dh_water.enabled = true blend.dh_terrain = off blend.dh_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE #else dhShadow.enabled = false - program.dh_terrain.enabled = false - program.dh_water.enabled = false + program.world0/dh_terrain.enabled = false + program.world0/dh_water.enabled = false #endif program.composite5.enabled = TAA_UPSCALING @@ -69,42 +71,46 @@ program.composite5.enabled = TAA_UPSCALING #Get the correct alpha value : S_A*(1-DST_A)+DST_A # terrible blending for shadows on purpose -blend.shadow = SRC_COLOR ZERO ONE ZERO blend.gbuffers_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE +blend.gbuffers_armor_glint = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.gbuffers_hand_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.gbuffers_textured = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.gbuffers_textured_lit = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE -blend.gbuffers_spidereyes = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.gbuffers_basic = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.gbuffers_weather = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE -blend.gbuffers_armor_glint = ONE ONE ONE ZERO +blend.gbuffers_block_translucent = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE +blend.gbuffers_beaconbeam = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE +blend.gbuffers_entities_translucent = SRC_ALPHA ZERO ONE ZERO +blend.gbuffers_spidereyes = ONE ONE ONE ONE blend.gbuffers_skytextured = ONE ONE ONE ZERO -blend.gbuffers_damagedblock = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE +blend.shadow = SRC_COLOR ZERO ONE ZERO # Disable blending blend.gbuffers_terrain = off blend.gbuffers_hand = off blend.gbuffers_block = off blend.gbuffers_entities = off -blend.gbuffers_beaconbeam = off +blend.gbuffers_damagedblock = off + +# this is important for refraction and glass tint to work correctly blend.gbuffers_water.colortex11 = off +blend.gbuffers_hand_water.colortex11 = off +blend.gbuffers_entities_translucent.colortex11 = off + blend.composite.colortex12 = off blend.composite.colortex13 = off - +blend.composite.colortex14 = off # Alpha test -alphaTest.shadow = GREATER 0.1 -alphaTest.gbuffers_entities = GREATER 0.1 +alphaTest.gbuffers_terrain = GREATER 0.1 alphaTest.gbuffers_hand = GREATER 0.1 - -alphaTest.gbuffers_armor_glint=false -alphaTest.gbuffers_weather=false -alphaTest.gbuffers_water=false -alphaTest.gbuffers_skybasic=false -alphaTest.gbuffers_skytextured=false +alphaTest.gbuffers_weather = false +alphaTest.gbuffers_water = false +alphaTest.gbuffers_skybasic = false +alphaTest.gbuffers_skytextured = false -sliders = MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS DAY3_l0_coverage DAY3_l0_density DAY3_l1_coverage DAY3_l1_density DAY3_l2_coverage DAY3_l2_density DAY3_ufog_density DAY3_cfog_density DAY0_l0_coverage DAY0_l1_coverage DAY0_l2_coverage DAY0_ufog_density DAY0_l0_density DAY0_l1_density DAY0_l2_density DAY0_cfog_density DAY1_l0_coverage DAY1_l1_coverage DAY1_l2_coverage DAY1_ufog_density DAY1_l0_density DAY1_l1_density DAY1_l2_density DAY1_cfog_density DAY2_l0_coverage DAY2_l1_coverage DAY2_l2_coverage DAY2_ufog_density DAY2_l0_density DAY2_l1_density DAY2_l2_density DAY2_cfog_density DEBUG_VIEW entityShadowDistanceMul HANDHELD_LIGHT_RANGE CLOUD_SHADOW_STRENGTH CloudLayer0_coverage CloudLayer0_density CloudLayer0_height CloudLayer1_coverage CloudLayer1_density CloudLayer1_height CloudLayer2_coverage CloudLayer2_density CloudLayer2_height PLANET_GROUND_BRIGHTNESS FOG_START_HEIGHT WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B NETHER_PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR ambientsss_brightness SSS_TYPE Cloud_Speed ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R SHADOWS_GRADE_G MIDS_GRADE_G HIGHLIGHTS_GRADE_G SHADOWS_GRADE_B MIDS_GRADE_B HIGHLIGHTS_GRADE_B SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL +sliders = sss_density_multiplier sss_absorbance_multiplier MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS DAY3_l0_coverage DAY3_l0_density DAY3_l1_coverage DAY3_l1_density DAY3_l2_coverage DAY3_l2_density DAY3_ufog_density DAY3_cfog_density DAY0_l0_coverage DAY0_l1_coverage DAY0_l2_coverage DAY0_ufog_density DAY0_l0_density DAY0_l1_density DAY0_l2_density DAY0_cfog_density DAY1_l0_coverage DAY1_l1_coverage DAY1_l2_coverage DAY1_ufog_density DAY1_l0_density DAY1_l1_density DAY1_l2_density DAY1_cfog_density DAY2_l0_coverage DAY2_l1_coverage DAY2_l2_coverage DAY2_ufog_density DAY2_l0_density DAY2_l1_density DAY2_l2_density DAY2_cfog_density DEBUG_VIEW entityShadowDistanceMul HANDHELD_LIGHT_RANGE CLOUD_SHADOW_STRENGTH CloudLayer0_coverage CloudLayer0_density CloudLayer0_height CloudLayer1_coverage CloudLayer1_density CloudLayer1_height CloudLayer2_coverage CloudLayer2_density CloudLayer2_height PLANET_GROUND_BRIGHTNESS FOG_START_HEIGHT WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B NETHER_PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR ambientsss_brightness SSS_TYPE Cloud_Speed ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R SHADOWS_GRADE_G MIDS_GRADE_G HIGHLIGHTS_GRADE_G SHADOWS_GRADE_B MIDS_GRADE_B HIGHLIGHTS_GRADE_B SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL screen.columns=2 screen = \ @@ -126,13 +132,13 @@ BLISS_SHADERS \ ######## LIGHTING ### DIRECT LIGHT screen.Direct_Light.columns=1 - screen.Direct_Light = TRANSLUCENT_COLORED_SHADOWS [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] OLD_LIGHTLEAK_FIX sunPathRotation sun_illuminance MOONPHASE_BASED_MOONLIGHT moon_illuminance [LPV] + screen.Direct_Light = [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] OLD_LIGHTLEAK_FIX sunPathRotation sun_illuminance MOONPHASE_BASED_MOONLIGHT moon_illuminance screen.Shadows.columns=1 - screen.Shadows = SCREENSPACE_CONTACT_SHADOWS RENDER_ENTITY_SHADOWS entityShadowDistanceMul [Filtering] shadowMapResolution shadowDistance shadowDistanceRenderMul + screen.Shadows = TRANSLUCENT_COLORED_SHADOWS SCREENSPACE_CONTACT_SHADOWS RENDER_ENTITY_SHADOWS entityShadowDistanceMul [Filtering] shadowMapResolution shadowDistance OPTIMIZED_SHADOW_DISTANCE screen.Subsurface_Scattering.columns=1 - screen.Subsurface_Scattering = SSS_TYPE LabSSS_Curve MISC_BLOCK_SSS MOB_SSS Ambient_SSS ambientsss_brightness + screen.Subsurface_Scattering = SSS_TYPE sss_density_multiplier sss_absorbance_multiplier LabSSS_Curve MISC_BLOCK_SSS MOB_SSS Ambient_SSS ambientsss_brightness screen.Filtering.columns=1 screen.Filtering = BASIC_SHADOW_FILTER SHADOW_FILTER_SAMPLE_COUNT Min_Shadow_Filter_Radius Variable_Penumbra_Shadows VPS_Search_Samples Max_Shadow_Filter_Radius Max_Filter_Depth @@ -142,7 +148,7 @@ BLISS_SHADERS \ ### AMBIENT LIGHT screen.Ambient_light.columns=1 - screen.Ambient_light = [Torch_Colors] [Ambient_Colors] \ + screen.Ambient_light = [LPV] [Torch_Colors] [Ambient_Colors] \ MIN_LIGHT_AMOUNT indirect_effect \ \ AO_Strength GI_Strength \ @@ -169,7 +175,6 @@ BLISS_SHADERS \ ### FloodFill screen.LPV.columns = 1 screen.LPV = LPV_ENABLED LPV_SIZE LPV_NORMAL_OFFSET LPV_ENTITY_LIGHTS LPV_REDSTONE_LIGHTS LPV_COLORED_CANDLES - ######## WORLD screen.World.columns=1 screen.World = [Water] [Waving_Stuff] [LabPBR] SKY_GROUND RESOURCEPACK_SKY AEROCHROME_MODE AEROCHROME_PINKNESS AEROCHROME_WOOL_ENABLED @@ -315,7 +320,7 @@ BLISS_SHADERS \ ######## MISC SETTINGS - screen.Misc_Settings = DEBUG_VIEW [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only LIGHTNING_FLASH LIT_PARTICLE_BRIGHTNESS PLANET_GROUND_BRIGHTNESS BLOOMY_PARTICLES ORIGINAL_CHOCAPIC_SKY BIOME_TINT_WATER CLOUDS_INFRONT_OF_WORLD SELECT_BOX DENOISE_SSS_AND_SSAO WATER_CAUSTICS_BRIGHTNESS HYPER_DETAILED_WAVES + screen.Misc_Settings = DEBUG_VIEW [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only LIGHTNING_FLASH LIT_PARTICLE_BRIGHTNESS PLANET_GROUND_BRIGHTNESS BLOOMY_PARTICLES ORIGINAL_CHOCAPIC_SKY BIOME_TINT_WATER CLOUDS_INFRONT_OF_WORLD SELECT_BOX DENOISE_SSS_AND_SSAO WATER_CAUSTICS_BRIGHTNESS HYPER_DETAILED_WAVES OLD_BLOOM screen.the_orb.columns = 1 screen.the_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B @@ -358,36 +363,19 @@ BLISS_SHADERS \ ######## weather profiles. -variable.int.maxDays = 2 -variable.int.DayCounter = worldDay - maxDays * floor(worldDay / maxDays) - # in seconds... variable.int.WeatherTransitionTime = 1 -variable.float.LAYER0_coverage = smooth(if( \ - DayCounter == 0, 0.5, \ - 1.3 ), WeatherTransitionTime, WeatherTransitionTime) - -variable.float.LAYER0_denisty = smooth(if( \ - DayCounter == 0, 0.5, \ - 0.5 ), WeatherTransitionTime, WeatherTransitionTime) - - -uniform.vec2.LAYER0_params = vec2(LAYER0_coverage, LAYER0_denisty) - -uniform.float.EXAMPLE = smooth(if(DayCounter == 0, 5.0, 0.0 ), 5, 5) - - uniform.float.Cumulus_Cov = smooth(if( \ - DayCounter == 0, 5.0, \ - DayCounter == 1, 0.0, \ - DayCounter == 2, 0.0, \ - DayCounter == 3, 0.0, \ - DayCounter == 4, 0.0, \ - DayCounter == 5, 0.0, \ - DayCounter == 6, 0.0, \ - DayCounter == 7, 0.0, \ - DayCounter == 9, 0.0, \ + moonPhase == 0, 5.0, \ + moonPhase == 1, 0.0, \ + moonPhase == 2, 0.0, \ + moonPhase == 3, 0.0, \ + moonPhase == 4, 0.0, \ + moonPhase == 5, 0.0, \ + moonPhase == 6, 0.0, \ + moonPhase == 7, 0.0, \ + moonPhase == 9, 0.0, \ 0.0 ), WeatherTransitionTime, WeatherTransitionTime) uniform.float.Alto_Cov = smooth(if( \ @@ -410,45 +398,6 @@ uniform.float.Alto_Den = smooth(if( \ moonPhase == 6, 0.05, \ 0.0 ), WeatherTransitionTime, WeatherTransitionTime) - - - - - - - - -# uniform.float.Cumulus_Cov = smooth(if( \ -# moonPhase == 0, 0.7, \ -# moonPhase == 1, 0.9, \ -# moonPhase == 2, 0.0, \ -# moonPhase == 3, 0.8, \ -# moonPhase == 4, 0.0, \ -# moonPhase == 5, 1.2, \ -# moonPhase == 6, 0.6, \ -# 0.0 ), WeatherTransitionTime, WeatherTransitionTime) - -# uniform.float.Alto_Cov = smooth(if( \ -# moonPhase == 0, 0.1, \ -# moonPhase == 1, 1.0, \ -# moonPhase == 2, 1.0, \ -# moonPhase == 3, 0.3, \ -# moonPhase == 4, 0.3, \ -# moonPhase == 5, 0.0, \ -# moonPhase == 6, 1.5, \ -# 0.0 ), WeatherTransitionTime, WeatherTransitionTime) - -# uniform.float.Alto_Den = smooth(if( \ -# moonPhase == 0, 0.1, \ -# moonPhase == 1, 0.25, \ -# moonPhase == 2, 0.1, \ -# moonPhase == 3, 0.7, \ -# moonPhase == 4, 0.7, \ -# moonPhase == 5, 0.0, \ -# moonPhase == 6, 0.05, \ -# 0.0 ), WeatherTransitionTime, WeatherTransitionTime) - - uniform.float.Uniform_Den = smooth(if( \ moonPhase == 0, 0, \ moonPhase == 1, 0, \ @@ -469,10 +418,6 @@ uniform.float.Cloudy_Den = smooth(if( \ moonPhase == 6, 50, \ 0 ), WeatherTransitionTime, WeatherTransitionTime) -# uniform.float.ifEndBoss = smooth(if(bossBattle == 2, 1, 0 ), 1, 1) -# uniform.float.EndSequence1 = smooth(if(hideGUI == 1, 1.0, 0.0), 30, 0) -# uniform.float.EndSequence2 = smooth(if(EndSequence1 > 0.95, 1.0, 0.0), 1.25, 0) - # thank you sixthsurge! #ifdef LIGHTNING_FLASH #ifdef IS_IRIS @@ -486,8 +431,6 @@ uniform.float.Cloudy_Den = smooth(if( \ uniform.vec3.lightningEffect = vec3(77.0 * lightningFlash, 153.0 * lightningFlash, 255.0 * lightningFlash) - - ################################### ####### BIOME RELATED STUFF ####### ################################### @@ -533,14 +476,6 @@ uniform.float.noPuddleAreas = smooth(if(in(biome, 3, 4, 16, 37, 39, 48, 49, 31, ####### RANDOM STUFF ####### ############################ - - # float Currenthealth = currentPlayerHealth * maxPlayerHealth; - # bool isDead = Currenthealth < 1 && currentPlayerHealth > -1; - # bool oneHeart = Currenthealth <= 2 && currentPlayerHealth > -1; - # bool threeHeart = Currenthealth <= 6 && currentPlayerHealth > -1; - - - #if defined LOW_HEALTH_EFFECT || defined DAMAGE_TAKEN_EFFECT #ifdef IS_IRIS variable.float.Currenthealth = currentPlayerHealth * maxPlayerHealth @@ -553,8 +488,6 @@ uniform.float.noPuddleAreas = smooth(if(in(biome, 3, 4, 16, 37, 39, 48, 49, 31, uniform.float.hurt = smooth(if(is_hurt,1,0),0.0,0.5) #endif -# uniform.vec3.CamPos = vec3(cameraPosition.x,cameraPosition.y,cameraPosition.z) - # photon stuff uniform.vec2.view_res = vec2(viewWidth, viewHeight) uniform.vec2.view_pixel_size = vec2(1.0 / viewWidth, 1.0 / viewHeight) @@ -646,4 +579,4 @@ uniform.float.shadowMaxProj = 150.0/abs(sunPosY) program.world1/shadowcomp.enabled = false program.world0/shadowcomp.enabled = false program.world-1/shadowcomp.enabled = false -#endif +#endif \ No newline at end of file diff --git a/shaders/template/block.properties b/shaders/template/block.properties deleted file mode 100644 index 5347087..0000000 --- a/shaders/template/block.properties +++ /dev/null @@ -1,690 +0,0 @@ -layer.translucent = minecraft:glass minecraft:glass_pane - -#= BLOCK_WATER -block.8= minecraft:water minecraft:flowing_water - -#= BLOCK_BAMBOO -block.11= bamboo bamboo_sapling - -#= BLOCK_GRASS_SHORT -block.*= minecraft:short_grass minecraft:grass - -#= BLOCK_GRASS_TALL_LOWER -block.*= minecraft:tall_grass:half=lower - -#= BLOCK_GRASS_TALL_UPPER -block.*= minecraft:tall_grass:half=upper - -#= BLOCK_SAPLING -block.*= minecraft:oak_sapling minecraft:spruce_sapling minecraft:birch_sapling minecraft:jungle_sapling minecraft:acacia_sapling minecraft:dark_oak_sapling - -#= BLOCK_VINE -block.*= vine - - -####### ----- waving blocks with SSS ----- ####### - - ## ground waving - ## add a newline to organize for modded blocks - #= BLOCK_GROUND_WAVING - block.60= minecraft:sunflower:half=upper minecraft:beetroots minecraft:potatoes minecraft:carrots minecraft:wheat minecraft:nether_wart minecraft:kelp minecraft:large_fern:half=upper minecraft:peony:half=upper minecraft:rose_bush:half=upper minecraft:lilac:half=upper minecraft:crimson_roots minecraft:nether_sprouts minecraft:warped_roots minecraft:seagrass minecraft:tall_seagrass:half=upper minecraft:wither_rose minecraft:lily_of_the_valley minecraft:cornflower minecraft:sweet_berry_bush minecraft:oxeye_daisy minecraft:pink_tulip minecraft:white_tulip minecraft:orange_tulip minecraft:red_tulip minecraft:azure_bluet minecraft:allium minecraft:blue_orchid minecraft:poppy minecraft:dandelion minecraft:dead_bush - # removed: sapling(s) - - ## ground waving vertical models. this exists to brighten up the sides of grass and stuff in shaded places they blend in better with the world. - #= BLOCK_GROUND_WAVING_VERTICAL - block.*= minecraft:fern conquest:acacia_sapling conquest:alder_tree_sapling conquest:apple_tree_sapling conquest:aspen_tree_sapling conquest:birch_sapling conquest:cherry_tree_sapling conquest:dark_oak_sapling conquest:downy_willow_tree_sapling conquest:gorse_tree_sapling conquest:grape_vine_sapling conquest:horse_chestnut_tree_sapling conquest:jungle_sapling conquest:larch_tree_sapling conquest:mallorn_tree_sapling conquest:oak_sapling conquest:orange_tree_sapling conquest:pear_tree_sapling conquest:pine_tree_sapling conquest:plum_tree_sapling conquest:rowan_tree_sapling conquest:spruce_sapling conquest:willow_tree_sapling conquest:angelica conquest:black_knapweed conquest:buttercups conquest:cornflower conquest:dandelion conquest:elanor conquest:goldenrod conquest:harebell conquest:lily_of_the_valley conquest:lobelia_flowers conquest:marsh_ragwort conquest:meadow_saffron conquest:mediterranean_wild_tulip conquest:moorland_spotted_orchid conquest:niphredil conquest:orange_tulip conquest:orpine conquest:oxeye_daisy conquest:pasque_flower conquest:pink_tulip conquest:poppy conquest:red_tulip conquest:rock_rose conquest:sea_lavender conquest:simbelmyne conquest:white_clematis conquest:white_tulip conquest:wild_dagga conquest:allium conquest:barley conquest:bean_pole conquest:beetroots conquest:cabbage conquest:carrots conquest:common_beans conquest:corn conquest:flax conquest:heirloom_wheat_crops conquest:hemp conquest:lavender conquest:peas conquest:potatoes conquest:rice conquest:thyme conquest:tobacco conquest:turnips conquest:water_mint conquest:wheat conquest:wild_basil conquest:wild_parsley conquest:wild_wheat conquest:common_meadow_grass conquest:cotton_grass conquest:dead_grass conquest:deergrass conquest:grass conquest:kentucky_bluegrass conquest:lush_grass conquest:purple_moor_grass conquest:sea_arrowgrass conquest:seagrass conquest:sweet_grass conquest:timothy_grass conquest:wavy_hair_grass conquest:pine_cones conquest:spruce_cones conquest:beautyberry_bush conquest:bilberry_bush conquest:blackberry_bush conquest:bog_blueberry_bush conquest:broom_bush conquest:dead_bush conquest:hawthorn_bush conquest:lingonberry_bush conquest:raspberry_bush conquest:alpine_sow_thristle conquest:athelas conquest:autumnal_dwarf_birch conquest:birdsfoot_trefoil conquest:bog_asphodel conquest:bottle_sedge conquest:cattails conquest:common_cow_wheat conquest:cow_parsley conquest:cross leaved heath conquest:dead_reeds conquest:dead_shrubs conquest:desert_shrub conquest:dogs_mercury conquest:dooryard_dock conquest:dry_reeds conquest:greater_fen_sedge conquest:greater_wood_rush conquest:green_meadow_fescue conquest:green_spurge conquest:heather conquest:meadow_fescue conquest:melancholy_thristle conquest:nettles conquest:nightshade conquest:papyrus conquest:purple_wolfs_bane conquest:red_common_cow_wheat conquest:rosebay_willowherb conquest:rushes conquest:wild_shrub conquest:sedge conquest:small_fescue conquest:small_scabious conquest:sweet_woodruff conquest:wild_overgrown_nettles conquest:wild_shrub conquest:wood_horsetail conquest:woodland_sedge conquest:wormwood conquest:yellow_wolfs_bane conquest:autumnal_bracken conquest:bracken conquest:dark_autumnal_bracken conquest:dead_bracken conquest:fern conquest:fern_1 conquest:fern_2 conquest:harts_tongue_fern conquest:large_fern_1 conquest:large_fern_2 conquest:large_fern_3 conquest:thick_fern conquest:tall_grass conquest:large_fern conquest:sunflower conquest:tall_lilac conquest:peony conquest:rose_bush conquest:tall_seagrass conquest:cypress conquest:young_tree conquest:young_frozen_tree conquest:cross_leaved_heath conquest:jungle_ground_cover conquest:alpine_sow_thistle conquest:duckweed conquest:red_mushroom conquest:brown_mushroom - - ## air waving - ## add a newline to organize for modded blocks - #= BLOCK_AIR_WAVING - block.*= minecraft:azalea_leaves minecraft:flowering_azalea_leaves minecraft:cherry_leaves minecraft:mangrove_leaves minecraft:vine minecraft:oak_leaves minecraft:spruce_leaves minecraft:birch_leaves minecraft:jungle_leaves minecraft:acacia_leaves minecraft:dark_oak_leaves westerosblocks:vine_jasmine westerosblocks:apple_fruit_leaves westerosblocks:apricot_fruit_leaves westerosblocks:cherry_fruit_leaves westerosblocks:purple_grape_fruit_leaves westerosblocks:lemon_fruit_leaves westerosblocks:lime_fruit_leaves westerosblocks:orange_fruit_leaves westerosblocks:peach_fruit_leaves westerosblocks:plum_fruit_leaves westerosblocks:pomegranate_fruit_leaves westerosblocks:weirwood_leaves westerosblocks:hop_fruit_leaves westerosblocks:olive_fruit_leaves westerosblocks:palm_leaves westerosblocks:white_grape_fruit_leaves conquest:apple_tree_leaves conquest:ash_tree_leaves conquest:aspen_leaves conquest:autumnal_aspen_leaves conquest:dark_deciduous_leaves conquest:autumnal_beech_tree_leaves conquest:autumnal_birch_leaves conquest:autumnal_horse_chestnut_leaves conquest:autumnal_maple_leaves conquest:autumnal_oak_leaves conquest:autumnal_weeping_willow_leaves conquest:banana_tree_leaves conquest:beech_tree_leaves conquest:bright_autumnal_beech_tree_leaves conquest:bright_autumnal_weeping_willow_leaves conquest:bushy_joshua_tree_leaves conquest:caribbean_royal_palm_leaves conquest:caribbean_royal_palm_leaves_corner conquest:cherry_tree_leaves conquest:dark_beech_tree_leaves conquest:date_palm_leaves conquest:diseased_horse_chestnut_leaves conquest:downy_willow_leaves conquest:downy_willow_leaves_tip conquest:faded_autumnal_beech_tree_leaves conquest:dead_norway_spruce_needles conquest:orange_larch_leaf_top conquest:yellow_larch_leaf_top conquest:larch_leaf_top conquest:larch_spruce_leaf_top conquest:larch_leaf_slab conquest:larch_leaf_long_branch conquest:larch_leaf_branch conquest:larch_spruce_leaf_top conquest:yellow_larch_spruce_leaf_top conquest:yellow_larch_leaf_slab conquest:yellow_larch_leaf_long_branch conquest:yellow_larch_leaf_branch conquest:orange_larch_spruce_leaf_top conquest:orange_larch_leaf_slab conquest:oranch_larch_leaf_long_branch conquest:orange_larch_leaf_branch conquest:dead_spruce_leaf_top conquest:dead_spruce_leaf_slab conquest:dead_spruce_leaf_long_branch conquest:dead_spruce_leaf_branch conquest:light_spruce_leaf_top conquest:light_spruce_leaf_slab conquest:light_spruce_leaf_long_branch conquest:light_spruce_leaf_branch conquest:goat_willow_leaves conquest:gorse_leaves conquest:grape_vine_leaves conquest:holly_leaves conquest:horse_chestnut_leaves conquest:joshua_tree_leaves conquest:lemon_tree_leaves conquest:old_caribbean_royal_palm_leaves conquest:old_caribbean_royal_palm_leaves_corner conquest:olive_tree_leaves conquest:orange_tree_leaves conquest:pear_tree_leaves conquest:plum_tree_leaves conquest:rowan_leaves conquest:weeping_willow_leaves conquest:wisteria_leaves conquest:yellow_autumnal_weeping_willow_leaves conquest:dark_spruce_needles conquest:dead_pine_needles conquest:dead_spruce_needles conquest:larch_needles conquest:light_spruce_needles conquest:orange_autumnal_larch_needles conquest:pine_needles conquest:yellow_autumnal_larch_needles conquest:dead_deciduous_branches conquest:mistletoe_garland conquest:lilac conquest:pink_cherry_blossoms conquest:purple_cherry_blossoms conquest:red_cherry_blossoms conquest:white_cherry_blossoms conquest:wisteria_blossoms conquest:hanging_moss conquest:lianas conquest:moss_vines conquest:spruce_leaf_top conquest:spruce_leaf_branch conquest:spruce_leaf_slab conquest:spruce_leaf_long_branch conquest:thick_hanging_ivy conquest:thick_ivy conquest:hanging_roots conquest:acacia_branch_tip conquest:acacia_branch_tip_45 conquest:acacia_branch_tip_2 conquest:acacia_branch_tip_2_45 conquest:beech_branch_tip conquest:beech_branch_tip_45 conquest:beech_branch_tip_2 conquest:beech _branch_tip_2_45 conquest:birch_branch_tip conquest:birch_branch_tip_45 conquest:birch_branch_tip_2 conquest:birch_branch_tip_2_45 conquest:oak_branch_tip conquest:oak_branch_tip_45 conquest:oak_branch_tip_2 conquest:oak_branch_tip_2_45 conquest:spruce_branch_tip conquest:spruce_branch_tip_45 conquest:spruce_branch_tip_2 conquest:spruce_branch_tip_2_45 conquest:orange_pine_branch_tip conquest:orange_pine_branch_tip_45 conquest:orange_pine_branch_tip_2 conquest:orange_pine_branch_tip_2_45 - - -####### ----- blocks with SSS ----- ####### - - ## strong sss - #= BLOCK_SSS_STRONG - block.80= minecraft:flowering_azalea minecraft:tall_seagrass minecraft:seagrass minecraft:kelp minecraft:large_fern:half=lower minecraft:tall_seagrass minecraft:kelp_plant minecraft:peony minecraft:rose_bush minecraft:lilac minecraft:sunflower:half=lower minecraft:packed_ice minecraft:blue_ice minecraft:melon_stem minecraft:pumpkin_stem minecraft:attached_melon_stem minecraft:attached_pumpkin_stem minecraft:lily_pad westerosblocks:blackberry_bush westerosblocks:blueberry_bush westerosblocks:raspberry_bush westerosblocks:juniper_bush westerosblocks:red_rose_bush westerosblocks:pink_rose_bush westerosblocks:white_rose_bush westerosblocks:yellow_rose_bush westerosblocks:yellow_wildflowers westerosblocks:green_spiny_herb westerosblocks:green_leafy_herb westerosblocks:orange_marigolds westerosblocks:orange_trollius westerosblocks:blue_forgetmenots westerosblocks:pink_wildflowers westerosblocks:yellow_tansy westerosblocks:blue_flax westerosblocks:white_daisies westerosblocks:yellow_daisies westerosblocks:green_scrub_grass westerosblocks:dead_scrub_grass westerosblocks:yellow_bedstraw westerosblocks:orange_bells westerosblocks:blue_bells westerosblocks:blue_swamp_bells westerosblocks:yellow_buttercups westerosblocks:orange_bog_asphodel westerosblocks:yellow_lupine westerosblocks:blue_hyacinth westerosblocks:pink_thistle westerosblocks:yellow_dandelions westerosblocks:yellow_daffodils westerosblocks:yellow_roses westerosblocks:strawberry_bush westerosblocks:white_lilyofthevalley westerosblocks:yellow_bells westerosblocks:yellow_sunflower westerosblocks:white_roses westerosblocks:red_dark_roses westerosblocks:yellow_hellebore westerosblocks:meadow_fescue westerosblocks:red_poppies westerosblocks:red_roses westerosblocks:purple_pansies westerosblocks:purple_roses westerosblocks:orange_sun_star westerosblocks:pink_primrose westerosblocks:red_aster westerosblocks:blue_chicory westerosblocks:red_flowering_spiny_herb westerosblocks:purple_foxglove westerosblocks:pink_allium westerosblocks:purple_violets westerosblocks:white_chamomile westerosblocks:red_tulips westerosblocks:white_peony westerosblocks:purple_alpine_sowthistle westerosblocks:red_carnations westerosblocks:magenta_roses westerosblocks:red_chrysanthemum westerosblocks:blue_orchid westerosblocks:yellow_rudbeckia westerosblocks:pink_tulips westerosblocks:cranberry_bush westerosblocks:purple_lavender westerosblocks:red_sourleaf_bush westerosblocks:pink_sweet_peas westerosblocks:red_sorrel westerosblocks:pink_roses westerosblocks:unshaded_grass westerosblocks:cow_parsely westerosblocks:bracken westerosblocks:lady_fern westerosblocks:nettle westerosblocks:dead_bracken westerosblocks:fireweed westerosblocks:heather westerosblocks:red_fern westerosblocks:dock_leaf westerosblocks:jasmine_vines westerosblocks:dappled_moss westerosblocks:cushion_moss_wall westerosblocks:hemp_short westerosblocks:hemp_tall westerosblocks:hemp_dense westerosblocks:crop_carrots westerosblocks:crop_wheat westerosblocks:crop_turnips westerosblocks:crop_peas westerosblocks:cattails westerosblocks:jungle_tall_fern westerosblocks:jungle_tall_grass westerosblocks:savanna_tall_grass - - ## weak sss - #= BLOCK_SSS_WEAK - block.*= minecraft:amethyst_block minecraft:budding_amethyst minecraft:small_amethyst_bud minecraft:pitcher_plant minecraft:small_dripleaf minecraft:grass_block:snowy=true minecraft:snow_block minecraft:snow powder_snow cobweb red_mushroom_block brown_mushroom_block weeping_vines weeping_vines_plant twisting_vines twisting_vines_plant tube_coral tube_coral_block tube_coral_fan tube_coral_wall_fan horn_coral horn_coral_block horn_coral_fan horn_coral_wall_fan fire_coral fire_coral_block fire_coral_fan fire_coral_wall_fan dead_brain_coral dead_brain_coral_block dead_brain_coral_fan dead_brain_coral_wall_fan dead_bubble_coral dead_bubble_coral_block dead_bubble_coral_fan dead_bubble_coral_wall_fan dead_bush dead_fire_coral dead_fire_coral_block dead_fire_coral_fan dead_fire_coral_wall_fan dead_horn_coral dead_horn_coral_block dead_horn_coral_fan dead_horn_coral_wall_fan dead_tube_coral dead_tube_coral_block dead_tube_coral_fan dead_tube_coral_wall_fan bubble_coral bubble_coral_block bubble_coral_fan bubble_coral_wall_fan brain_coral brain_coral_block brain_coral_fan brain_coral_wall_fan minecraft:spore_blossom minecraft:cave_vines:berries=false minecraft:cave_vines_plant:berries=false minecraft:glow_lichen minecraft:melon minecraft:pumpkin minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:cactus minecraft:hay_block minecraft:brown_mushroom minecraft:mushroom_stem minecraft:sugar_cane minecraft:crimson_fungus minecraft:warped_fungus minecraft:sea_pickle:waterlogged=false minecraft:honeycomb_block - - ## weak sss - #= BLOCK_SSS_WEAK_2 - block.*= minecraft:white_wool minecraft:orange_wool minecraft:magenta_wool minecraft:light_blue_wool minecraft:yellow_wool minecraft:lime_wool minecraft:pink_wool minecraft:gray_wool minecraft:light_gray_wool minecraft:cyan_wool minecraft:purple_wool minecraft:blue_wool minecraft:brown_wool minecraft:green_wool minecraft:red_wool minecraft:black_wool minecraft:orange_carpet minecraft:magenta_carpet minecraft:light_blue_carpet minecraft:yellow_carpet minecraft:lime_carpet minecraft:pink_carpet minecraft:gray_carpet minecraft:light_gray_carpet minecraft:cyan_carpet minecraft:purple_carpet minecraft:blue_carpet minecraft:brown_carpet minecraft:green_carpet minecraft:red_carpet minecraft:black_carpet westerosblocks:clothesline westerosblocks:smoke westerosblocks:brown_mushroom_1 westerosblocks:brown_mushroom_2 westerosblocks:brown_mushroom_3 westerosblocks:brown_mushroom_4 westerosblocks:brown_mushroom_5 westerosblocks:brown_mushroom_6 westerosblocks:brown_mushroom_7 westerosblocks:brown_mushroom_8 westerosblocks:brown_mushroom_9 westerosblocks:brown_mushroom_10 westerosblocks:brown_mushroom_11 westerosblocks:brown_mushroom_12 westerosblocks:brown_mushroom_13 westerosblocks:red_mushroom_1 westerosblocks:red_mushroom_2 westerosblocks:red_mushroom_3 westerosblocks:red_mushroom_4 westerosblocks:red_mushroom_5 westerosblocks:red_mushroom_6 westerosblocks:red_mushroom_7 westerosblocks:red_mushroom_8 westerosblocks:red_mushroom_9 westerosblocks:white_wool_slab westerosblocks:orange_wool_slab westerosblocks:light_brown_wool_slab westerosblocks:light_blue_wool_slab westerosblocks:yellow_wool_slab westerosblocks:dirty_white_wool_slab westerosblocks:pink_wool_slab westerosblocks:grey_wool_slab westerosblocks:light_grey_wool_slab westerosblocks:cyan_wool_slab westerosblocks:purple_wool_slab westerosblocks:blue_wool_slab westerosblocks:brown_wool_slab westerosblocks:green_wool_slab westerosblocks:red_wool_slab westerosblocks:black_wool_slab westerosblocks:white_wool_carpet westerosblocks:orange_wool_carpet westerosblocks:light_brown_wool_carpet westerosblocks:light_blue_wool_carpet westerosblocks:yellow_wool_carpet westerosblocks:dirty_white_wool_carpet westerosblocks:pink_wool_carpet westerosblocks:grey_wool_carpet westerosblocks:light_grey_wool_carpet westerosblocks:cyan_wool_carpet westerosblocks:purple_wool_carpet westerosblocks:blue_wool_carpet westerosblocks:brown_wool_carpet westerosblocks:green_wool_carpet westerosblocks:red_wool_carpet westerosblocks:black_wool_carpet westerosblocks:thatch_light_fur_carpet westerosblocks:thatch_dark_fur_carpet - - ## weak sss - #= BLOCK_SSS_WEAK_3 - block.*= minecraft:white_wall_banner minecraft:orange_wall_banner minecraft:magenta_wall_banner minecraft:light_blue_wall_banner minecraft:yellow_wall_banner minecraft:lime_wall_banner minecraft:pink_wall_banner minecraft:gray_wall_banner minecraft:light_gray_wall_banner minecraft:cyan_wall_banner minecraft:purple_wall_banner minecraft:blue_wall_banner minecraft:brown_wall_banner minecraft:green_wall_banner minecraft:red_wall_banner minecraft:black_wall_banner minecraft:white_banner minecraft:orange_banner minecraft:magenta_banner minecraft:light_blue_banner minecraft:yellow_banner minecraft:lime_banner minecraft:pink_banner minecraft:gray_banner minecraft:light_gray_banner minecraft:cyan_banner minecraft:purple_banner minecraft:blue_banner minecraft:brown_banner minecraft:green_banner minecraft:red_banner minecraft:black_banner westerosblocks:renly_banner westerosblocks:redwyne_banner westerosblocks:grafton_banner westerosblocks:grey_banner westerosblocks:red_banner westerosblocks:black_banner westerosblocks:the_faith_of_the_seven_banner westerosblocks:cream_banner westerosblocks:blue_banner westerosblocks:brown_banner westerosblocks:cyan_banner westerosblocks:green_banner westerosblocks:orange_banner westerosblocks:pink_banner westerosblocks:purple_banner westerosblocks:lord_of_light_rhllor_banner westerosblocks:yellow_banner westerosblocks:arryn_banner westerosblocks:baratheon_banner westerosblocks:bolton_banner westerosblocks:dayne_banner westerosblocks:frey_banner westerosblocks:greyjoy_banner westerosblocks:hightower_banner westerosblocks:lannister_banner westerosblocks:manderly_banner westerosblocks:martell_banner westerosblocks:stannis_banner westerosblocks:stark_banner westerosblocks:targaryen_banner westerosblocks:tarly_banner westerosblocks:tully_banner westerosblocks:tyrell_banner - - ## weird blocks - #= BLOCK_SSS_WEIRD - block.*= minecraft:sand minecraft:red_sand - - ## grass uwu - #= BLOCK_GRASS - block.*= minecraft:grass_block:snowy=false - - -####### ----- lightsources ----- ####### - - #= BLOCK_AMETHYST_BUD_LARGE - block.101= large_amethyst_bud - - #= BLOCK_AMETHYST_BUD_MEDIUM - block.*= medium_amethyst_bud - - #= BLOCK_AMETHYST_CLUSTER - block.*= amethyst_cluster - - #= BLOCK_BEACON - block.*= beacon - - #= BLOCK_BREWING_STAND - block.*= brewing_stand - - group.candle= candle black_candle blue_candle brown_candle cyan_candle gray_candle \ - green_candle light_blue_candle light_gray_candle lime_candle magenta_candle \ - orange_candle pink_candle purple_candle red_candle white_candle yellow_candle - - #ifdef LPV_COLORED_CANDLES - #= BLOCK_CANDLES_PLAIN_LIT_1 - block.*= candle:candles=1:lit=true - - #= BLOCK_CANDLES_PLAIN_LIT_2 - block.*= candle:candles=2:lit=true - - #= BLOCK_CANDLES_PLAIN_LIT_3 - block.*= candle:candles=3:lit=true - - #= BLOCK_CANDLES_PLAIN_LIT_4 - block.*= candle:candles=4:lit=true - - #= BLOCK_CANDLES_BLACK_LIT_1 - block.*= black_candle:candles=1:lit=true - - #= BLOCK_CANDLES_BLACK_LIT_2 - block.*= black_candle:candles=2:lit=true - - #= BLOCK_CANDLES_BLACK_LIT_3 - block.*= black_candle:candles=3:lit=true - - #= BLOCK_CANDLES_BLACK_LIT_4 - block.*= black_candle:candles=4:lit=true - - #= BLOCK_CANDLES_BLUE_LIT_1 - block.*= blue_candle:candles=1:lit=true - - #= BLOCK_CANDLES_BLUE_LIT_2 - block.*= blue_candle:candles=2:lit=true - - #= BLOCK_CANDLES_BLUE_LIT_3 - block.*= blue_candle:candles=3:lit=true - - #= BLOCK_CANDLES_BLUE_LIT_4 - block.*= blue_candle:candles=4:lit=true - - #= BLOCK_CANDLES_BROWN_LIT_1 - block.*= brown_candle:candles=1:lit=true - - #= BLOCK_CANDLES_BROWN_LIT_2 - block.*= brown_candle:candles=2:lit=true - - #= BLOCK_CANDLES_BROWN_LIT_3 - block.*= brown_candle:candles=3:lit=true - - #= BLOCK_CANDLES_BROWN_LIT_4 - block.*= brown_candle:candles=4:lit=true - - #= BLOCK_CANDLES_CYAN_LIT_1 - block.*= cyan_candle:candles=1:lit=true - - #= BLOCK_CANDLES_CYAN_LIT_2 - block.*= cyan_candle:candles=2:lit=true - - #= BLOCK_CANDLES_CYAN_LIT_3 - block.*= cyan_candle:candles=3:lit=true - - #= BLOCK_CANDLES_CYAN_LIT_4 - block.*= cyan_candle:candles=4:lit=true - - #= BLOCK_CANDLES_GRAY_LIT_1 - block.*= gray_candle:candles=1:lit=true - - #= BLOCK_CANDLES_GRAY_LIT_2 - block.*= gray_candle:candles=2:lit=true - - #= BLOCK_CANDLES_GRAY_LIT_3 - block.*= gray_candle:candles=2:lit=true - - #= BLOCK_CANDLES_GRAY_LIT_4 - block.*= gray_candle:candles=4:lit=true - - #= BLOCK_CANDLES_GREEN_LIT_1 - block.*= green_candle:candles=1:lit=true - - #= BLOCK_CANDLES_GREEN_LIT_2 - block.*= green_candle:candles=2:lit=true - - #= BLOCK_CANDLES_GREEN_LIT_3 - block.*= green_candle:candles=3:lit=true - - #= BLOCK_CANDLES_GREEN_LIT_4 - block.*= green_candle:candles=4:lit=true - - #= BLOCK_CANDLES_LIGHT_BLUE_LIT_1 - block.*= light_blue_candle:candles=1:lit=true - - #= BLOCK_CANDLES_LIGHT_BLUE_LIT_2 - block.*= light_blue_candle:candles=2:lit=true - - #= BLOCK_CANDLES_LIGHT_BLUE_LIT_3 - block.*= light_blue_candle:candles=3:lit=true - - #= BLOCK_CANDLES_LIGHT_BLUE_LIT_4 - block.*= light_blue_candle:candles=4:lit=true - - #= BLOCK_CANDLES_LIGHT_GRAY_LIT_1 - block.*= light_gray_candle:candles=1:lit=true - - #= BLOCK_CANDLES_LIGHT_GRAY_LIT_2 - block.*= light_gray_candle:candles=2:lit=true - - #= BLOCK_CANDLES_LIGHT_GRAY_LIT_3 - block.*= light_gray_candle:candles=3:lit=true - - #= BLOCK_CANDLES_LIGHT_GRAY_LIT_4 - block.*= light_gray_candle:candles=4:lit=true - - #= BLOCK_CANDLES_LIME_LIT_1 - block.*= lime_candle:candles=1:lit=true - - #= BLOCK_CANDLES_LIME_LIT_2 - block.*= lime_candle:candles=2:lit=true - - #= BLOCK_CANDLES_LIME_LIT_3 - block.*= lime_candle:candles=3:lit=true - - #= BLOCK_CANDLES_LIME_LIT_4 - block.*= lime_candle:candles=4:lit=true - - #= BLOCK_CANDLES_MAGENTA_LIT_1 - block.*= magenta_candle:candles=1:lit=true - - #= BLOCK_CANDLES_MAGENTA_LIT_2 - block.*= magenta_candle:candles=2:lit=true - - #= BLOCK_CANDLES_MAGENTA_LIT_3 - block.*= magenta_candle:candles=3:lit=true - - #= BLOCK_CANDLES_MAGENTA_LIT_4 - block.*= magenta_candle:candles=4:lit=true - - #= BLOCK_CANDLES_ORANGE_LIT_1 - block.*= orange_candle:candles=1:lit=true - - #= BLOCK_CANDLES_ORANGE_LIT_2 - block.*= orange_candle:candles=2:lit=true - - #= BLOCK_CANDLES_ORANGE_LIT_3 - block.*= orange_candle:candles=3:lit=true - - #= BLOCK_CANDLES_ORANGE_LIT_4 - block.*= orange_candle:candles=4:lit=true - - #= BLOCK_CANDLES_PINK_LIT_1 - block.*= pink_candle:candles=1:lit=true - - #= BLOCK_CANDLES_PINK_LIT_2 - block.*= pink_candle:candles=2:lit=true - - #= BLOCK_CANDLES_PINK_LIT_3 - block.*= pink_candle:candles=3:lit=true - - #= BLOCK_CANDLES_PINK_LIT_4 - block.*= pink_candle:candles=4:lit=true - - #= BLOCK_CANDLES_PURPLE_LIT_1 - block.*= purple_candle:candles=1:lit=true - - #= BLOCK_CANDLES_PURPLE_LIT_2 - block.*= purple_candle:candles=2:lit=true - - #= BLOCK_CANDLES_PURPLE_LIT_3 - block.*= purple_candle:candles=3:lit=true - - #= BLOCK_CANDLES_PURPLE_LIT_4 - block.*= purple_candle:candles=4:lit=true - - #= BLOCK_CANDLES_RED_LIT_1 - block.*= red_candle:candles=1:lit=true - - #= BLOCK_CANDLES_RED_LIT_2 - block.*= red_candle:candles=2:lit=true - - #= BLOCK_CANDLES_RED_LIT_3 - block.*= red_candle:candles=3:lit=true - - #= BLOCK_CANDLES_RED_LIT_4 - block.*= red_candle:candles=4:lit=true - - #= BLOCK_CANDLES_WHITE_LIT_1 - block.*= white_candle:candles=1:lit=true - - #= BLOCK_CANDLES_WHITE_LIT_2 - block.*= white_candle:candles=2:lit=true - - #= BLOCK_CANDLES_WHITE_LIT_3 - block.*= white_candle:candles=3:lit=true - - #= BLOCK_CANDLES_WHITE_LIT_4 - block.*= white_candle:candles=4:lit=true - - #= BLOCK_CANDLES_YELLOW_LIT_1 - block.*= yellow_candle:candles=1:lit=true - - #= BLOCK_CANDLES_YELLOW_LIT_2 - block.*= yellow_candle:candles=2:lit=true - - #= BLOCK_CANDLES_YELLOW_LIT_3 - block.*= yellow_candle:candles=3:lit=true - - #= BLOCK_CANDLES_YELLOW_LIT_4 - block.*= yellow_candle:candles=4:lit=true - #else - #= BLOCK_CANDLES_LIT_1 - block.*= [candle]:candles=1:lit=true - - #= BLOCK_CANDLES_LIT_2 - block.*= [candle]:candles=2:lit=true - - #= BLOCK_CANDLES_LIT_3 - block.*= [candle]:candles=3:lit=true - - #= BLOCK_CANDLES_LIT_4 - block.*= [candle]:candles=4:lit=true - #endif - - #= BLOCK_CAVE_VINE_BERRIES - block.*= cave_vines_plant:berries=true cave_vines:berries=true - - #= BLOCK_COMPARATOR_LIT - block.*= comparator:powered=true - - #= BLOCK_COPPER_BULB_LIT - block.*= copper_bulb:lit=true waxed_copper_bulb:lit=true - - #= BLOCK_COPPER_BULB_EXPOSED_LIT - block.*= exposed_copper_bulb:lit=true waxed_exposed_copper_bulb:lit=true - - #= BLOCK_COPPER_BULB_OXIDIZED_LIT - block.*= oxidized_copper_bulb:lit=true waxed_oxidized_copper_bulb:lit=true - - #= BLOCK_COPPER_BULB_WEATHERED_LIT - block.*= weathered_copper_bulb:lit=true waxed_weathered_copper_bulb:lit=true - - #= BLOCK_CONDUIT - block.*= conduit - - #= BLOCK_CRYING_OBSIDIAN - block.*= crying_obsidian - - #= BLOCK_END_GATEWAY - block.*= end_gateway - - #= BLOCK_END_ROD - block.*= end_rod - - #= BLOCK_FIRE - block.*= fire campfire:lit=true - - #= BLOCK_FROGLIGHT_OCHRE - block.*= ochre_froglight - - #= BLOCK_FROGLIGHT_PEARLESCENT - block.*= pearlescent_froglight - - #= BLOCK_FROGLIGHT_VERDANT - block.*= verdant_froglight - - #= BLOCK_GLOW_LICHEN - block.*= glow_lichen - - #= BLOCK_GLOWSTONE - block.*= glowstone - - #= BLOCK_JACK_O_LANTERN - block.*= jack_o_lantern - - #= BLOCK_LANTERN - block.*= lantern - - #= BLOCK_LAVA - block.*= lava - - #= BLOCK_LIGHT_1 - block.*= light:level=1 - - #= BLOCK_LIGHT_2 - block.*= light:level=2 - - #= BLOCK_LIGHT_3 - block.*= light:level=3 - - #= BLOCK_LIGHT_4 - block.*= light:level=4 - - #= BLOCK_LIGHT_5 - block.*= light:level=5 - - #= BLOCK_LIGHT_6 - block.*= light:level=6 - - #= BLOCK_LIGHT_7 - block.*= light:level=7 - - #= BLOCK_LIGHT_8 - block.*= light:level=8 - - #= BLOCK_LIGHT_9 - block.*= light:level=9 - - #= BLOCK_LIGHT_10 - block.*= light:level=10 - - #= BLOCK_LIGHT_11 - block.*= light:level=11 - - #= BLOCK_LIGHT_12 - block.*= light:level=12 - - #= BLOCK_LIGHT_13 - block.*= light:level=13 - - #= BLOCK_LIGHT_14 - block.*= light:level=14 - - #= BLOCK_LIGHT_15 - block.*= light:level=15 - - #= BLOCK_MAGMA - block.*= magma_block - - #= BLOCK_REDSTONE_LAMP_LIT - block.*= redstone_lamp:lit=true - - #= BLOCK_REDSTONE_TORCH_LIT - block.*= redstone_torch:lit=true redstone_wall_torch:lit=true - - #= BLOCK_REDSTONE_WIRE_1 - block.*= redstone_wire:power=1 - - #= BLOCK_REDSTONE_WIRE_2 - block.*= redstone_wire:power=2 - - #= BLOCK_REDSTONE_WIRE_3 - block.*= redstone_wire:power=3 - - #= BLOCK_REDSTONE_WIRE_4 - block.*= redstone_wire:power=4 - - #= BLOCK_REDSTONE_WIRE_5 - block.*= redstone_wire:power=5 - - #= BLOCK_REDSTONE_WIRE_6 - block.*= redstone_wire:power=6 - - #= BLOCK_REDSTONE_WIRE_7 - block.*= redstone_wire:power=7 - - #= BLOCK_REDSTONE_WIRE_8 - block.*= redstone_wire:power=8 - - #= BLOCK_REDSTONE_WIRE_9 - block.*= redstone_wire:power=9 - - #= BLOCK_REDSTONE_WIRE_10 - block.*= redstone_wire:power=10 - - #= BLOCK_REDSTONE_WIRE_11 - block.*= redstone_wire:power=11 - - #= BLOCK_REDSTONE_WIRE_12 - block.*= redstone_wire:power=12 - - #= BLOCK_REDSTONE_WIRE_13 - block.*= redstone_wire:power=13 - - #= BLOCK_REDSTONE_WIRE_14 - block.*= redstone_wire:power=14 - - #= BLOCK_REDSTONE_WIRE_15 - block.*= redstone_wire:power=15 - - #= BLOCK_REPEATER_LIT - block.*= repeater:powered=true - - #= BLOCK_RESPAWN_ANCHOR_4 - block.*= respawn_anchor:charges=4 - - #= BLOCK_SCULK_SENSOR_ACTIVE - block.*= sculk_sensor:sculk_sensor_phase=active - - #= BLOCK_SEA_PICKLE_WET_1 - block.*= sea_pickle:waterlogged=true:pickles=1 - - #= BLOCK_SEA_PICKLE_WET_2 - block.*= sea_pickle:waterlogged=true:pickles=2 - - #= BLOCK_SEA_PICKLE_WET_3 - block.*= sea_pickle:waterlogged=true:pickles=3 - - #= BLOCK_SEA_PICKLE_WET_4 - block.*= sea_pickle:waterlogged=true:pickles=4 - - #= BLOCK_SEA_LANTERN - block.*= sea_lantern - - #= BLOCK_SHROOMLIGHT - block.*= shroomlight - - #= BLOCK_SMOKER_LIT - block.*= smoker:lit=true - - #= BLOCK_SOUL_FIRE - block.*= soul_fire soul_campfire:lit=true - - #= BLOCK_SOUL_LANTERN - block.*= soul_lantern - - #= BLOCK_SOUL_TORCH - block.*= soul_torch soul_wall_torch - - #= BLOCK_TORCH - block.*= torch wall_torch - - block.* = westerosblocks:safe_fire - block.* = conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:iron_candelabrum_1 conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light - - -####### ----- reflective translucents / glass ----- ####### - - #= BLOCK_GLASS - block.301= glass glass_pane - - #= BLOCK_HONEY - block.*= honey_block - - #= BLOCK_ICE - block.*= ice frosted_ice - - #= BLOCK_NETHER_PORTAL - block.*= nether_portal - - #= BLOCK_SLIME - block.*= slime_block - - #= BLOCK_GLASS_BLACK - block.*= black_stained_glass black_stained_glass_pane - - #= BLOCK_GLASS_BLUE - block.*= blue_stained_glass blue_stained_glass_pane - - #= BLOCK_GLASS_BROWN - block.*= brown_stained_glass brown_stained_glass_pane - - #= BLOCK_GLASS_CYAN - block.*= cyan_stained_glass cyan_stained_glass_pane - - #= BLOCK_GLASS_GRAY - block.*= gray_stained_glass gray_stained_glass_pane - - #= BLOCK_GLASS_GREEN - block.*= green_stained_glass green_stained_glass_pane - - #= BLOCK_GLASS_LIGHT_BLUE - block.*= light_blue_stained_glass light_blue_stained_glass_pane - - #= BLOCK_GLASS_LIGHT_GRAY - block.*= light_gray_stained_glass light_gray_stained_glass_pane - - #= BLOCK_GLASS_LIME - block.*= lime_stained_glass lime_stained_glass_pane - - #= BLOCK_GLASS_MAGENTA - block.*= magenta_stained_glass magenta_stained_glass_pane - - #= BLOCK_GLASS_ORANGE - block.*= orange_stained_glass orange_stained_glass_pane - - #= BLOCK_GLASS_PINK - block.*= pink_stained_glass pink_stained_glass_pane - - #= BLOCK_GLASS_PURPLE - block.*= purple_stained_glass purple_stained_glass_pane - - #= BLOCK_GLASS_RED - block.*= red_stained_glass red_stained_glass_pane - - #= BLOCK_GLASS_WHITE - block.*= white_stained_glass white_stained_glass_pane - - #= BLOCK_GLASS_YELLOW - block.*= yellow_stained_glass yellow_stained_glass_pane - - -####### ----- LPV shapes ----- ####### - - #= BLOCK_BUTTON - block.401= acacia_button bamboo_button birch_button cherry_button crimson_button dark_oak_button jungle_button mangrove_button oak_button polished_blackstone_button spruce_button stone_button warped_button - - #= BLOCK_CANDLE - block.*=[candle]:lit=false - - #= BLOCK_CARPET - block.*=black_carpet blue_carpet brown_carpet cyan_carpet gray_carpet green_carpet light_blue_carpet light_gray_carpet \ - lime_carpet magenta_carpet moss_carpet orange_carpet pink_carpet purple_carpet red_carpet white_carpet yellow_carpet - - #= BLOCK_CHAIN - block.*= chain - - group.door= acacia_door bamboo_door birch_door cherry_door crimson_door dark_oak_door \ - iron_door jungle_door mangrove_door oak_door spruce_door warped_door \ - copper_door exposed_copper_door weathered_copper_door oxidized_copper_door \ - waxed_copper_door waxed_exposed_copper_door waxed_weathered_copper_door waxed_oxidized_copper_door - - #= BLOCK_DOOR_N - block.*= [door]:facing=north:open=false [door]:facing=west:hinge=left:open=true [door]:facing=east:hinge=right:open=true - - #= BLOCK_DOOR_E - block.*= [door]:facing=east:open=false [door]:facing=north:hinge=left:open=true [door]:facing=south:hinge=right:open=true - - #= BLOCK_DOOR_S - block.*= [door]:facing=south:open=false [door]:facing=east:hinge=left:open=true [door]:facing=west:hinge=right:open=true - - #= BLOCK_DOOR_W - block.*= [door]:facing=west:open=false [door]:facing=south:hinge=left:open=true [door]:facing=north:hinge=right:open=true - - #= BLOCK_FENCE - block.*= acacia_fence bamboo_fence birch_fence cherry_fence crimson_fence dark_oak_fence jungle_fence mangrove_fence nether_brick_fence oak_fence spruce_fence warped_fence - - #= BLOCK_FENCE_GATE - block.*= acacia_fence_gate bamboo_fence_gate birch_fence_gate cherry_fence_gate crimson_fence_gate dark_oak_fence_gate jungle_fence_gate mangrove_fence_gate oak_fence_gate spruce_fence_gate warped_fence_gate - - #= BLOCK_FLOWER_POT - block.*= flower_pot potted_acacia_sapling potted_allium potted_azalea_bush potted_bamboo potted_azure_bluet potted_birch_sapling \ - potted_blue_orchid potted_brown_mushroom potted_cactus potted_cornflower potted_crimson_fungus potted_crimson_roots \ - potted_dandelion potted_dark_oak_sapling potted_dead_bush potted_fern potted_flowering_azalea_bush potted_jungle_sapling \ - potted_lily_of_the_valley potted_mangrove_propagule potted_oak_sapling potted_orange_tulip potted_oxeye_daisy \ - potted_pink_tulip potted_poppy potted_red_mushroom potted_red_tulip potted_spruce_sapling potted_torchflower \ - potted_warped_fungus potted_warped_roots potted_white_tulip potted_wither_rose - - #= BLOCK_IRON_BARS - block.*= iron_bars - - #= BLOCK_LADDER - block.*= ladder - - #= BLOCK_LEVER - block.*= lever - - #= BLOCK_PRESSURE_PLATE - block.*= acacia_pressure_plate bamboo_pressure_plate birch_pressure_plate cherry_pressure_plate crimson_pressure_plate \ - dark_oak_pressure_plate heavy_weighted_pressure_plate jungle_pressure_plate light_weighted_pressure_plate mangrove_pressure_plate \ - oak_pressure_plate polished_blackstone_pressure_plate spruce_pressure_plate stone_pressure_plate warped_pressure_plate - - group.slab= acacia_slab bamboo_slab bamboo_mosaic_slab birch_slab cherry_slab crimson_slab dark_oak_slab jungle_slab mangrove_slab \ - oak_slab spruce_slab warped_slab andesite_slab blackstone_slab brick_slab cobbled_deepslate_slab cobblestone_slab \ - cut_copper_slab cut_red_sandstone_slab cut_sandstone_slab dark_prismarine_slab deepslate_brick_slab deepslate_tile_slab \ - diorite_slab end_stone_brick_slab exposed_cut_copper_slab granite_slab mossy_cobblestone_slab mossy_stone_brick_slab \ - mud_brick_slab nether_brick_slab oxidized_cut_copper_slab petrified_oak_slab polished_andesite_slab \ - polished_blackstone_brick_slab polished_blackstone_slab polished_deepslate_slab polished_diorite_slab \ - polished_granite_slab prismarine_brick_slab prismarine_slab purpur_slab quartz_slab red_nether_brick_slab \ - red_sandstone_slab sandstone_slab smooth_quartz_slab smooth_red_sandstone_slab smooth_sandstone_slab smooth_stone_slab \ - stone_brick_slab stone_slab waxed_cut_copper_slab waxed_exposed_cut_copper_slab waxed_oxidized_cut_copper_slab \ - waxed_weathered_cut_copper_slab weathered_cut_copper_slab - - #= BLOCK_SLAB_TOP - block.*= [slab]:type=top - - #= BLOCK_SLAB_BOTTOM - block.*= [slab]:type=bottom daylight_detector - - group.trapdoor= acacia_trapdoor bamboo_trapdoor birch_trapdoor cherry_trapdoor crimson_trapdoor dark_oak_trapdoor \ - iron_trapdoor jungle_trapdoor mangrove_trapdoor oak_trapdoor spruce_trapdoor warped_trapdoor \ - copper_trapdoor exposed_copper_trapdoor weathered_copper_trapdoor oxidized_copper_trapdoor \ - waxed_copper_trapdoor waxed_exposed_copper_trapdoor waxed_weathered_copper_trapdoor waxed_oxidized_copper_trapdoor - - #= BLOCK_TRAPDOOR_BOTTOM - block.*= [trapdoor]:half=bottom:open=false - - #= BLOCK_TRAPDOOR_TOP - block.*= [trapdoor]:half=top:open=false - - #= BLOCK_TRAPDOOR_N - block.*= [trapdoor]:facing=north:open=true - - #= BLOCK_TRAPDOOR_E - block.*= [trapdoor]:facing=east:open=true - - #= BLOCK_TRAPDOOR_S - block.*= [trapdoor]:facing=south:open=true - - #= BLOCK_TRAPDOOR_W - block.*= [trapdoor]:facing=west:open=true - - -####### ----- misc ----- ####### - - ## stuff - #= BLOCK_END_PORTAL - block.500= minecraft:end_portal - - ## all blocks here get exluded from POM. - #= BLOCK_SIGN - block.*= minecraft:oak_sign minecraft:spruce_sign minecraft:birch_sign minecraft:jungle_sign minecraft:acacia_sign minecraft:dark_oak_sign minecraft:mangrove_sign minecraft:crimson_sign minecraft:warped_sign minecraft:oak_wall_sign minecraft:spruce_wall_sign minecraft:birch_wall_sign minecraft:jungle_wall_sign minecraft:acacia_wall_sign minecraft:dark_oak_wall_sign minecraft:mangrove_wall_sign minecraft:crimson_wall_sign minecraft:warped_wall_sign - - ## workaround mixed render stages - ##= BLOCK_REDSTONE_WIRE - ##block.*= minecraft:redstone_wire diff --git a/shaders/world0/shadow.vsh b/shaders/world0/shadow.vsh index 1eb483a..fb171c0 100644 --- a/shaders/world0/shadow.vsh +++ b/shaders/world0/shadow.vsh @@ -144,7 +144,7 @@ void main() { // position = gl_Vertex.xyz; - // if((renderStage == 10 || renderStage == 12) && mc_Entity.x != BLOCK_REDSTONE_WIRE) { + // if((renderStage == 10 || renderStage == 12) && mc_Entity.x != 3000) { // position = (shadowModelViewInverse * vec4(gl_Vertex.xyz,1.0)).xyz; // } @@ -204,7 +204,7 @@ void main() { SetVoxelBlock(originPos, voxelId); } - + #ifdef LPV_ENTITY_LIGHTS if ( (currentRenderedItemId > 0 || entityId > 0) && @@ -252,30 +252,15 @@ void main() { #endif #ifdef DISTORT_SHADOWMAP + if(entityId == 1100) position.xyz = position.xyz - normalize(gl_NormalMatrix * gl_Normal) * 0.25; + gl_Position = BiasShadowProjection(toClipSpace3(position)); #else gl_Position = toClipSpace3(position); #endif - - + if (blockId == BLOCK_WATER) gl_Position.w = -1.0; - // color.a = 1.0; - // if((blockID < 300 || blockID >= 400)) color.a = 0.0; - - - // materials = 0.0; - // if(blockId == 8) materials = 1.0; - - /// this is to ease the shadow acne on big fat entities like ghasts. - float bias = 6.0; - if(entityId == ENTITY_SSS_MEDIUM){ - // increase bias on parts facing the sun - vec3 FlatNormals = normalize(gl_NormalMatrix * gl_Normal); - vec3 WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(shadowModelViewInverse) * sunPosition); - - bias = 6.0 + (1-clamp(dot(WsunVec,FlatNormals),0,1))*0.3; - } - gl_Position.z /= bias; -} + gl_Position.z /= 6.0; +} \ No newline at end of file