From 1168da157db171557d3097cb815cc086132a369d Mon Sep 17 00:00:00 2001 From: Xonk Date: Tue, 10 Oct 2023 23:02:00 -0400 Subject: [PATCH] Added resourecpack sky support. made use of iris dimensions.properties and added fallback shader. --- shaders/dimension.properties | 15 +++++ shaders/dimensions/all_particles.fsh | 6 +- shaders/dimensions/all_particles.vsh | 3 + shaders/dimensions/all_translucent.fsh | 5 ++ shaders/dimensions/all_translucent.vsh | 2 +- shaders/dimensions/composite.fsh | 6 +- shaders/dimensions/composite1.fsh | 57 ++++++++++++++----- shaders/dimensions/composite2.fsh | 12 ++-- shaders/dimensions/composite3.fsh | 8 +-- shaders/dimensions/composite5.fsh | 5 +- shaders/dimensions/deferred.fsh | 31 +++++----- shaders/dimensions/deferred.vsh | 2 +- shaders/lang/en_us.lang | 9 ++- shaders/lib/diffuse_lighting.glsl | 19 +++++++ shaders/lib/fallback_fog.glsl | 54 ++++++++++++++++++ shaders/lib/indirect_lighting_effects.glsl | 42 +++++++------- shaders/lib/settings.glsl | 11 +++- shaders/shaders.properties | 27 +++++---- .../unknown_dimension_fallback/composite1.fsh | 5 ++ .../unknown_dimension_fallback/composite1.vsh | 5 ++ .../composite10.fsh | 5 ++ .../composite10.vsh | 5 ++ .../composite11.fsh | 5 ++ .../composite11.vsh | 5 ++ .../unknown_dimension_fallback/composite2.fsh | 5 ++ .../unknown_dimension_fallback/composite2.vsh | 5 ++ .../unknown_dimension_fallback/composite3.fsh | 5 ++ .../unknown_dimension_fallback/composite3.vsh | 5 ++ .../unknown_dimension_fallback/composite4.fsh | 5 ++ .../unknown_dimension_fallback/composite4.vsh | 5 ++ .../unknown_dimension_fallback/composite5.fsh | 5 ++ .../unknown_dimension_fallback/composite5.vsh | 5 ++ .../unknown_dimension_fallback/composite6.fsh | 5 ++ .../unknown_dimension_fallback/composite6.vsh | 5 ++ .../unknown_dimension_fallback/composite7.fsh | 5 ++ .../unknown_dimension_fallback/composite7.vsh | 5 ++ .../unknown_dimension_fallback/composite8.fsh | 5 ++ .../unknown_dimension_fallback/composite8.vsh | 5 ++ .../unknown_dimension_fallback/composite9.fsh | 5 ++ .../unknown_dimension_fallback/composite9.vsh | 5 ++ .../unknown_dimension_fallback/deferred.fsh | 5 ++ .../unknown_dimension_fallback/deferred.vsh | 5 ++ .../unknown_dimension_fallback/deferred1.fsh | 5 ++ .../unknown_dimension_fallback/deferred1.vsh | 5 ++ shaders/unknown_dimension_fallback/final.fsh | 5 ++ shaders/unknown_dimension_fallback/final.vsh | 5 ++ .../gbuffers_armor_glint.fsh | 5 ++ .../gbuffers_armor_glint.vsh | 5 ++ .../gbuffers_basic.fsh | 9 +++ .../gbuffers_basic.vsh | 10 ++++ .../gbuffers_beaconbeam.fsh | 5 ++ .../gbuffers_beaconbeam.vsh | 5 ++ .../gbuffers_block.fsh | 8 +++ .../gbuffers_block.vsh | 8 +++ .../gbuffers_damagedblock.fsh | 6 ++ .../gbuffers_damagedblock.vsh | 6 ++ .../gbuffers_entities.fsh | 8 +++ .../gbuffers_entities.vsh | 9 +++ .../gbuffers_entities_glowing.fsh | 5 ++ .../gbuffers_entities_glowing.vsh | 5 ++ .../gbuffers_hand.fsh | 8 +++ .../gbuffers_hand.vsh | 8 +++ .../gbuffers_hand_water.fsh | 6 ++ .../gbuffers_hand_water.vsh | 6 ++ .../gbuffers_skybasic.fsh | 7 +++ .../gbuffers_skybasic.vsh | 5 ++ .../gbuffers_skytextured.fsh | 7 +++ .../gbuffers_skytextured.vsh | 5 ++ .../gbuffers_spidereyes.fsh | 5 ++ .../gbuffers_spidereyes.vsh | 5 ++ .../gbuffers_terrain.fsh | 7 +++ .../gbuffers_terrain.vsh | 7 +++ .../gbuffers_textured.fsh | 6 ++ .../gbuffers_textured.vsh | 6 ++ .../gbuffers_textured_lit.fsh | 5 ++ .../gbuffers_textured_lit.vsh | 8 +++ .../gbuffers_water.fsh | 5 ++ .../gbuffers_water.vsh | 5 ++ .../gbuffers_weather.fsh | 49 ++++++++++++++++ .../gbuffers_weather.vsh | 44 ++++++++++++++ shaders/world0/gbuffers_skytextured.fsh | 33 ++++++++++- shaders/world0/gbuffers_skytextured.vsh | 37 +++++++++++- 82 files changed, 738 insertions(+), 84 deletions(-) create mode 100644 shaders/dimension.properties create mode 100644 shaders/lib/fallback_fog.glsl create mode 100644 shaders/unknown_dimension_fallback/composite1.fsh create mode 100644 shaders/unknown_dimension_fallback/composite1.vsh create mode 100644 shaders/unknown_dimension_fallback/composite10.fsh create mode 100644 shaders/unknown_dimension_fallback/composite10.vsh create mode 100644 shaders/unknown_dimension_fallback/composite11.fsh create mode 100644 shaders/unknown_dimension_fallback/composite11.vsh create mode 100644 shaders/unknown_dimension_fallback/composite2.fsh create mode 100644 shaders/unknown_dimension_fallback/composite2.vsh create mode 100644 shaders/unknown_dimension_fallback/composite3.fsh create mode 100644 shaders/unknown_dimension_fallback/composite3.vsh create mode 100644 shaders/unknown_dimension_fallback/composite4.fsh create mode 100644 shaders/unknown_dimension_fallback/composite4.vsh create mode 100644 shaders/unknown_dimension_fallback/composite5.fsh create mode 100644 shaders/unknown_dimension_fallback/composite5.vsh create mode 100644 shaders/unknown_dimension_fallback/composite6.fsh create mode 100644 shaders/unknown_dimension_fallback/composite6.vsh create mode 100644 shaders/unknown_dimension_fallback/composite7.fsh create mode 100644 shaders/unknown_dimension_fallback/composite7.vsh create mode 100644 shaders/unknown_dimension_fallback/composite8.fsh create mode 100644 shaders/unknown_dimension_fallback/composite8.vsh create mode 100644 shaders/unknown_dimension_fallback/composite9.fsh create mode 100644 shaders/unknown_dimension_fallback/composite9.vsh create mode 100644 shaders/unknown_dimension_fallback/deferred.fsh create mode 100644 shaders/unknown_dimension_fallback/deferred.vsh create mode 100644 shaders/unknown_dimension_fallback/deferred1.fsh create mode 100644 shaders/unknown_dimension_fallback/deferred1.vsh create mode 100644 shaders/unknown_dimension_fallback/final.fsh create mode 100644 shaders/unknown_dimension_fallback/final.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_armor_glint.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_armor_glint.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_basic.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_basic.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_beaconbeam.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_beaconbeam.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_block.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_block.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_damagedblock.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_damagedblock.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_entities.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_entities.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_entities_glowing.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_entities_glowing.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_hand.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_hand.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_hand_water.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_hand_water.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_skybasic.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_skybasic.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_skytextured.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_skytextured.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_spidereyes.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_spidereyes.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_terrain.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_terrain.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_textured.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_textured.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_textured_lit.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_textured_lit.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_water.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_water.vsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_weather.fsh create mode 100644 shaders/unknown_dimension_fallback/gbuffers_weather.vsh diff --git a/shaders/dimension.properties b/shaders/dimension.properties new file mode 100644 index 0000000..3078402 --- /dev/null +++ b/shaders/dimension.properties @@ -0,0 +1,15 @@ +# USAGE +# dimension. = +# "shader to use" refers to shaderpacks/EXAMPLESHADER/shaders/..., like how optifine has world0, world1, but you can name these anything here. +# the dimension "ID's" to use are equivalent to the "ID's" from the /execute in command in-game. + +# EXAMPLE +# dimension.world0 = minecraft:overworld twilightforest:twilight_forest +# dimension.world-1 = minecraft:the_nether +# dimension.WHATEVER = somemod:whateverdimension + +dimension.world0 = minecraft:overworld +dimension.world-1 = minecraft:the_nether +dimension.world1 = minecraft:the_end + +dimension.unknown_dimension_fallback = * \ No newline at end of file diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index 0a453f6..1696e07 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -99,7 +99,6 @@ void main() { #ifndef OVERWORLD_SHADER lightmap.y = 1.0; #endif - #ifdef WEATHER gl_FragData[1].a = TEXTURE.a; // for bloomy rain and stuff #endif @@ -144,6 +143,7 @@ void main() { float cloudShadow = GetCloudShadow(feetPlayerPos); Direct_lighting = (lightCol.rgb/80.0) * Shadows * cloudShadow; + #ifndef LINES Direct_lighting *= phaseg(clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), 0.65)*2 + 0.5; @@ -168,6 +168,10 @@ void main() { Indirect_lighting = DoAmbientLighting_Nether(AmbientLightColor, Torch_Color, lightmap.x, nothing, nothing, nothing); #endif + #ifdef FALLBACK_SHADER + Indirect_lighting = DoAmbientLighting_Fallback(vec3(1.0), Torch_Color, lightmap.x, vec3(0.0), feetPlayerPos); + #endif + #ifndef LINES gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * Albedo; #else diff --git a/shaders/dimensions/all_particles.vsh b/shaders/dimensions/all_particles.vsh index cfeeec6..f551930 100644 --- a/shaders/dimensions/all_particles.vsh +++ b/shaders/dimensions/all_particles.vsh @@ -88,10 +88,13 @@ void main() { WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition); #endif + + #ifndef WEATHER #ifdef TAA_UPSCALING gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w; #endif #ifdef TAA gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize; #endif + #endif } diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index d96f680..21408de 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -15,6 +15,7 @@ varying vec4 color; flat varying vec4 lightCol; #endif + const bool colortex4MipmapEnabled = true; uniform sampler2D noisetex; uniform sampler2D depthtex1; @@ -452,6 +453,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) Indirect_lighting = DoAmbientLighting_End(gl_Fog.color.rgb, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, normal, feetPlayerPos ); #endif + #ifdef FALLBACK_SHADER + Indirect_lighting = DoAmbientLighting_Fallback(vec3(1.0), vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, WS_normal, feetPlayerPos); + #endif + vec3 FinalColor = (Indirect_lighting + Direct_lighting) * Albedo; #ifdef Glass_Tint diff --git a/shaders/dimensions/all_translucent.vsh b/shaders/dimensions/all_translucent.vsh index 051c005..e283131 100644 --- a/shaders/dimensions/all_translucent.vsh +++ b/shaders/dimensions/all_translucent.vsh @@ -80,7 +80,7 @@ void main() { vec2 lmcoord = gl_MultiTexCoord1.xy / 255.0; // is this even correct? lol lmtexcoord.zw = lmcoord; - vec3 position = mat3(gl_ModelViewMatrix) * vec3(Swtich_gl_vertex) + gl_ModelViewMatrix[3].xyz; + vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz; gl_Position = toClipSpace3(position); diff --git a/shaders/dimensions/composite.fsh b/shaders/dimensions/composite.fsh index a3c623c..cc6e6b3 100644 --- a/shaders/dimensions/composite.fsh +++ b/shaders/dimensions/composite.fsh @@ -201,11 +201,11 @@ void main() { if (LabSSS > 0.0 && !hand && NdotL < 0.001) minshadowfilt += 50; #endif - gl_FragData[0] = vec4(minshadowfilt, 0.1, 0.0, 0.0); - - gl_FragData[0].y = 0; if (z < 1.0 && !hand){ + gl_FragData[0] = vec4(minshadowfilt, 0.1, 0.0, 0.0); + gl_FragData[0].y = 0; + vec3 viewPos = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z)); #ifdef Variable_Penumbra_Shadows diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 6531832..b125f0f 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -38,6 +38,12 @@ const bool colortex5MipmapEnabled = true; // #define LIGHTSOURCE_REFLECTION #endif +#ifdef FALLBACK_SHADER + uniform sampler2D colortex4; + uniform float nightVision; + // #define LIGHTSOURCE_REFLECTION +#endif + uniform sampler2D noisetex; //noise uniform sampler2D depthtex1; //depth uniform sampler2D depthtex0; //depth @@ -51,7 +57,8 @@ uniform sampler2D colortex5; //TAA buffer/previous frame uniform sampler2D colortex6; //Noise uniform sampler2D colortex7; //water? uniform sampler2D colortex8; //Specular -// uniform sampler2D colortex10; +uniform sampler2D colortex9; //Specular +uniform sampler2D colortex10; uniform sampler2D colortex15; // flat normals(rgb), vanillaAO(alpha) @@ -615,6 +622,7 @@ void main() { ////// --------------- UNPACK OPAQUE GBUFFERS --------------- ////// vec4 data = texture2D(colortex1,texcoord); + vec4 dataUnpacked0 = vec4(decodeVec2(data.x),decodeVec2(data.y)); // albedo, masks vec4 dataUnpacked1 = vec4(decodeVec2(data.z),decodeVec2(data.w)); // normals, lightmaps // vec4 dataUnpacked2 = vec4(decodeVec2(data.z),decodeVec2(data.w)); @@ -702,30 +710,48 @@ void main() { #ifdef OVERWORLD_SHADER vec3 Background = vec3(0.0); - vec3 Sky = skyFromTex(feetPlayerPos_normalized, colortex4)/30.0; - vec4 Clouds = texture2D_bicubic(colortex0, texcoord*CLOUDS_QUALITY); vec3 orbitstar = vec3(feetPlayerPos_normalized.x,abs(feetPlayerPos_normalized.y),feetPlayerPos_normalized.z); orbitstar.x -= WsunVec.x*0.2; Background += stars(orbitstar) * 10.0; - #ifndef ambientLight_only - Background += drawSun(dot(lightCol.a * WsunVec, feetPlayerPos_normalized),0, DirectLightColor,vec3(0.0)); - Background += drawMoon(feetPlayerPos_normalized, lightCol.a * WsunVec, DirectLightColor*20, Background); + + #if RESOURCEPACK_SKY == 2 + Background += toLinear(texture2D(colortex10, texcoord).rgb * (255.0 * 2.0)); + #else + #if RESOURCEPACK_SKY == 1 + Background += toLinear(texture2D(colortex10, texcoord).rgb * (255.0 * 2.0)); + #endif + Background += drawSun(dot(lightCol.a * WsunVec, feetPlayerPos_normalized),0, DirectLightColor,vec3(0.0)); + Background += drawMoon(feetPlayerPos_normalized, lightCol.a * WsunVec, DirectLightColor*20, Background); #endif + Background *= clamp( (feetPlayerPos_normalized.y+ 0.02)*5.0 + (eyeAltitude - 319)/800000 ,0.0,1.0); + vec3 Sky = skyFromTex(feetPlayerPos_normalized, colortex4)/30.0; Background += Sky; - Background = Background * Clouds.a + Clouds.rgb; - + + #ifdef VOLUMETRIC_CLOUDS + vec4 Clouds = texture2D_bicubic(colortex0, texcoord*CLOUDS_QUALITY); + Background = Background * Clouds.a + Clouds.rgb; + #endif + gl_FragData[0].rgb = clamp(fp10Dither(Background, triangularize(noise)), 0.0, 65000.); #endif - #ifdef NETHER_SHADER + + #if defined NETHER_SHADER || defined END_SHADER gl_FragData[0].rgb = vec3(0); #endif - #ifdef END_SHADER - gl_FragData[0].rgb = vec3(0); + + #ifdef FALLBACK_SHADER + vec3 Background = vec3(0.5,0.3,1.0)*0.025; + Background += vec3(0.8,1.0,0.5) * 0.5 * pow(normalize(-feetPlayerPos_normalized).y*0.5+0.5,3.0); + + Background += stars(feetPlayerPos_normalized) * 100.0 * pow(normalize(feetPlayerPos_normalized).y*0.5+0.5,3.0); + gl_FragData[0].rgb = clamp(Background, 0.0, 65000.); + #endif + } else { feetPlayerPos += gbufferModelViewInverse[3].xyz; @@ -835,8 +861,7 @@ void main() { SSRT_Shadows(toScreenSpace(vec3(texcoord/RENDER_SCALE, z)), normalize(WsunVec*mat3(gbufferModelViewInverse)), interleaved_gradientNoise(), !inShadowmapBounds && LabSSS > 0.0, inShadowmapBounds, SS_shadow, SS_shadowSSS); Shadows = min(Shadows, SS_shadow); - - // if (!inShadowmapBounds) Direct_SSS *= exp(-5 * SS_shadowSSS) * lightmapAsShadows; + if (!inShadowmapBounds) ShadowBlockerDepth = max(ShadowBlockerDepth, SS_shadowSSS); #else @@ -931,6 +956,10 @@ void main() { Indirect_lighting = DoAmbientLighting_End(gl_Fog.color.rgb, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, normal, feetPlayerPos_normalized); #endif + #ifdef FALLBACK_SHADER + Indirect_lighting = DoAmbientLighting_Fallback(vec3(1.0), vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, normal, feetPlayerPos); + // if(hand) Indirect_lighting = vec3(TORCH_R,TORCH_G,TORCH_B) * 0.3; + #endif //////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////// UNDER WATER SHADING //////////////////////////////// @@ -1104,7 +1133,7 @@ void main() { float estimatedDepth = Vdiff * abs(VdotU) ; //assuming water plane vec3 ambientColVol = max(vec3(1.0,0.5,1.0) * 0.3, vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.01 + nightVision)); - + waterVolumetrics_notoverworld(gl_FragData[0].rgb, viewPos0, viewPos, estimatedDepth , estimatedDepth, Vdiff, noise, totEpsilon, scatterCoef, ambientColVol); } #endif diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index c2f3c84..52f76e7 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -55,6 +55,11 @@ uniform ivec2 eyeBrightnessSmooth; #include "/lib/end_fog.glsl" #endif +#ifdef FALLBACK_SHADER + uniform sampler2D colortex4; + #include "/lib/fallback_fog.glsl" +#endif + #define fsign(a) (clamp((a)*1e35,0.,1.)*2.-1.) float interleaved_gradientNoise(){ @@ -237,10 +242,8 @@ void main() { #ifdef OVERWORLD_SHADER vec4 VolumetricFog = GetVolumetricFog(viewPos, noise_1, lightCol.rgb/80.0, averageSkyCol/30.0); #endif - #ifdef NETHER_SHADER - vec4 VolumetricFog = GetVolumetricFog(viewPos, noise_1, noise_2); - #endif - #ifdef END_SHADER + + #if defined NETHER_SHADER || defined END_SHADER || defined FALLBACK_SHADER vec4 VolumetricFog = GetVolumetricFog(viewPos, noise_1, noise_2); #endif @@ -268,7 +271,6 @@ void main() { vec3 vl = vec3(0.0); waterVolumetrics(vl, vec3(0.0), viewPos, estEyeDepth, estEyeDepth, length(viewPos), noise_1, totEpsilon, scatterCoef, ambientColVol, lightColVol*(1.0-pow(1.0-sunElevation*lightCol.a,5.0)) , dot(normalize(viewPos), normalize(sunVec* lightCol.a ) )); gl_FragData[0] = clamp(vec4(vl,1.0),0.000001,65000.); - #else vec3 fragpos0 = toScreenSpace(vec3(texcoord - TAA_Offset*texelSize*0.5,z)); vec3 ambientColVol = max(vec3(1.0,0.5,1.0) * 0.6, vec3(0.2,0.4,1.0) * MIN_LIGHT_AMOUNT*0.01); diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index fd31e57..cd03ea7 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -235,7 +235,7 @@ void main() { float refractedalpha = decodeVec2(texture2D(colortex11,refractedCoord).b).g; float refractedalpha2 = texture2D(colortex7,refractedCoord).a; - if( refractedalpha <= 0.001 ||z < 0.56) refractedCoord = texcoord; // remove refracted coords on solids + if( refractedalpha <= 0.001 || z < 0.56) refractedCoord = texcoord; // remove refracted coords on solids #endif /// --- MAIN COLOR BUFFER --- /// @@ -245,11 +245,11 @@ void main() { float lightleakfix = clamp(pow(eyeBrightnessSmooth.y/240.,2) ,0.0,1.0); #if defined OVERWORLD_SHADER && defined BorderFog - vec3 sky = skyFromTex(np3,colortex4) / 150. * 5.0; + vec3 sky = skyFromTex(np3, colortex4).rgb / 30.0; float fog = 1.0 - clamp(exp(-pow(length(fragpos / far),10.)*4.0) ,0.0,1.0); float heightFalloff = clamp( pow(abs(np3.y-1.01),5) ,0,1) ; - if(z < 1.0 && isEyeInWater == 0) color.rgb = mix(color.rgb, sky, fog * heightFalloff * lightleakfix); + if(z < 1.0 && isEyeInWater == 0) color.rgb = mix(color.rgb, sky, fog); #endif vec4 vl = BilateralUpscale(colortex0, depthtex1, gl_FragCoord.xy, frDepth); @@ -263,7 +263,7 @@ void main() { color = color*(1.0-TranslucentShader.a) + TranslucentShader.rgb; #ifdef BorderFog - if(z < 1.0 && isEyeInWater == 0) color.rgb = mix(color.rgb, sky, fog * heightFalloff * lightleakfix); + if(z < 1.0 && isEyeInWater == 0) color.rgb = mix(color.rgb, sky, fog); #endif } diff --git a/shaders/dimensions/composite5.fsh b/shaders/dimensions/composite5.fsh index dd26dbd..f93eab8 100644 --- a/shaders/dimensions/composite5.fsh +++ b/shaders/dimensions/composite5.fsh @@ -9,8 +9,11 @@ const int colortex3Format = R11F_G11F_B10F; //frame buffer + bloom (deferred6- const int colortex4Format = RGBA16F; //light values and skyboxes (everything) const int colortex6Format = R11F_G11F_B10F; //additionnal buffer for bloom (composite3->final) const int colortex7Format = RGBA8; //Final output, transparencies id (gbuffer->composite4) +const int colortex8Format = RGBA8; // Specular Texture +const int colortex9Format = RGBA8; // rain in alpha + +const int colortex10Format = RGBA16; // resourcepack Skies -const int colortex9Format = RGBA8; // flat normals and vanilla AO const int colortex11Format = RGBA16; // unchanged translucents albedo, alpha and tangent normals const int colortex15Format = RGBA8; // flat normals and vanilla AO */ diff --git a/shaders/dimensions/deferred.fsh b/shaders/dimensions/deferred.fsh index 2f893b5..69cccc9 100644 --- a/shaders/dimensions/deferred.fsh +++ b/shaders/dimensions/deferred.fsh @@ -18,7 +18,6 @@ flat varying float rodExposure; flat varying float avgBrightness; flat varying float exposureF; -// uniform sampler2D colortex4; uniform sampler2D noisetex; uniform float frameTime; @@ -84,6 +83,10 @@ float blueNoise(){ #include "/lib/end_fog.glsl" #endif +#ifdef FALLBACK_SHADER + uniform sampler2D colortex4; + #include "/lib/fallback_fog.glsl" +#endif void main() { @@ -168,7 +171,7 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+ } #endif -#ifdef NETHER_SHADER +#if defined NETHER_SHADER || defined END_SHADER || defined FALLBACK_SHADER vec2 fogPos = vec2(256.0 - 256.0*0.12,1.0); //Sky gradient with clouds @@ -187,26 +190,26 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+ } #endif -#ifdef END_SHADER - /* ---------------------- FOG SHADER ---------------------- */ - vec2 fogPos = vec2(256.0 - 256.0*0.12,1.0); + // /* ---------------------- FOG SHADER ---------------------- */ + // vec2 fogPos = vec2(256.0 - 256.0*0.12,1.0); - //Sky gradient with clouds - if (gl_FragCoord.x > (fogPos.x - fogPos.x*0.22) && gl_FragCoord.y > 0.4 && gl_FragCoord.x < 535){ - vec2 p = clamp(floor(gl_FragCoord.xy-fogPos)/256.+tempOffsets/256.,-0.2,1.2); - vec3 viewVector = cartToSphere(p); + // //Sky gradient with clouds + // if (gl_FragCoord.x > (fogPos.x - fogPos.x*0.22) && gl_FragCoord.y > 0.4 && gl_FragCoord.x < 535){ + // vec2 p = clamp(floor(gl_FragCoord.xy-fogPos)/256.+tempOffsets/256.,-0.2,1.2); + // vec3 viewVector = cartToSphere(p); - vec3 BackgroundColor = vec3(0.0); + // vec3 BackgroundColor = vec3(0.0); - vec4 VL_Fog = GetVolumetricFog(mat3(gbufferModelView)*viewVector*256., fract(frameCounter/1.6180339887), fract(frameCounter/2.6180339887)); + // vec4 VL_Fog = GetVolumetricFog(mat3(gbufferModelView)*viewVector*256., fract(frameCounter/1.6180339887), fract(frameCounter/2.6180339887)); - BackgroundColor += VL_Fog.rgb/5.0; + // BackgroundColor += VL_Fog.rgb/5.0; - gl_FragData[0] = vec4(BackgroundColor, 1.0); + // gl_FragData[0] = vec4(BackgroundColor, 1.0); - } + // } +#ifdef END_SHADER /* ---------------------- TIMER ---------------------- */ float flash = 0.0; diff --git a/shaders/dimensions/deferred.vsh b/shaders/dimensions/deferred.vsh index 66b872c..91985d9 100644 --- a/shaders/dimensions/deferred.vsh +++ b/shaders/dimensions/deferred.vsh @@ -109,7 +109,7 @@ void main() { /// TOOO DAMN BLUE // // only need to sample one spot for this // averageSkyCol += 2.0*skyFromTex(normalize(vec3(0.0,1.0,0.0)),colortex4).rgb/150.; - vec3 minimimlight = vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.0005 + nightVision); + vec3 minimimlight = vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.003 + nightVision); averageSkyCol_Clouds = max(averageSkyCol_Clouds, minimimlight); averageSkyCol = max(averageSkyCol, minimimlight); diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index db15d16..857f9f8 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -13,6 +13,11 @@ option.sunPathRotation = Sun Angle option.sun_illuminance = Sun Illuminance option.moon_illuminance = Moon Illuminance +option.RESOURCEPACK_SKY = RP Sky + value.RESOURCEPACK_SKY.0 = Do not use + value.RESOURCEPACK_SKY.1 = Sky + Shader sun/moon + value.RESOURCEPACK_SKY.2 = Full sky + screen.Waving_Stuff = Waving Stuff option.WAVY_PLANTS = Waving Plants option.WAVY_STRENGTH = Waving Strength @@ -488,4 +493,6 @@ screen.Post_Processing.comment = Configure settings for all post processing effe option.TAA.comment = Toggle temporal anti-aliasing. This removes all jagged edges on things, softens the image, and helps remove noise for many effects. This will cause ghosting or trailing because it uses past frames for extra information on the world. §aPERFORMANCE COST:§r low option.BLEND_FACTOR.comment = Configure how much of frame history is used. high number means it relies less on frame history, so it may look flickery and noisy. low numbers rely more on frame history, so it may look smudged and cause trailing. option.TAA_UPSCALING.comment = Toggle temporal upscaling. This retains a good amount of quality from a lower resolution image when it upscales. so you can still have a high looking resolution compared to typical upsanpling and still have better performance. - option.SCALE_FACTOR.comment = Configure from what fraction of your resolution to upscale from. Below 0.5 is not recommended at all i only have it as an option because it's funny :P \ No newline at end of file + option.SCALE_FACTOR.comment = Configure from what fraction of your resolution to upscale from. Below 0.5 is not recommended at all i only have it as an option because it's funny :P + +option.RESOURCEPACK_SKY.comment = Toggle resourcepack sky support. Configure settings to use the whole resourcepack sky, or keep the shader's sun and moon. §aPERFORMANCE COST:§r very low \ No newline at end of file diff --git a/shaders/lib/diffuse_lighting.glsl b/shaders/lib/diffuse_lighting.glsl index 4f4b882..e357fb1 100644 --- a/shaders/lib/diffuse_lighting.glsl +++ b/shaders/lib/diffuse_lighting.glsl @@ -76,4 +76,23 @@ void DoRTAmbientLighting (vec3 TorchColor, vec2 Lightmap, inout float SkyLM, ino return TorchLight + AmbientLight;// + AmbientLight + FogTint; } +#endif + +#ifdef FALLBACK_SHADER + vec3 DoAmbientLighting_Fallback(vec3 Color, vec3 TorchColor, float Lightmap, vec3 Normal, vec3 p3){ + + float TorchLM = 10.0 - ( 1.0 / (pow(exp(-0.5*inversesqrt(Lightmap)),5.0)+0.1)); + TorchLM = pow(TorchLM/4,10) + pow(Lightmap,1.5)*0.5; + vec3 TorchLight = TorchColor * TorchLM * 0.75; + TorchLight *= TORCH_AMOUNT; + + float NdotL = clamp(-dot(Normal,normalize(p3)),0.0,1.0); + + float PlayerLight = exp( (1.0-clamp(1.0 - length(p3) / 32.0,0.0,1.0)) *-10.0); + // vec3 AmbientLight = TorchColor * PlayerLight * NdotL; + vec3 AmbientLight = vec3(0.5,0.3,1.0)*0.2 * (Normal.y*0.5+0.6); + + + return TorchLight + AmbientLight;// + AmbientLight + FogTint; + } #endif \ No newline at end of file diff --git a/shaders/lib/fallback_fog.glsl b/shaders/lib/fallback_fog.glsl new file mode 100644 index 0000000..732ebb2 --- /dev/null +++ b/shaders/lib/fallback_fog.glsl @@ -0,0 +1,54 @@ +vec4 GetVolumetricFog( + vec3 viewPos, + float dither, + float dither2 +){ + int SAMPLES = 16; + vec3 vL = vec3(0.0); + float absorbance = 1.0; + + //project pixel position into projected shadowmap space + vec3 wpos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz; + vec3 fragposition = mat3(shadowModelView) * wpos + shadowModelView[3].xyz; + fragposition = diagonal3(shadowProjection) * fragposition + shadowProjection[3].xyz; + + //project view origin into projected shadowmap space + vec3 start = toShadowSpaceProjected(vec3(0.)); + + //rayvector into projected shadow map space + //we can use a projected vector because its orthographic projection + //however we still have to send it to curved shadow map space every step + vec3 dV = fragposition-start; + vec3 dVWorld = (wpos-gbufferModelViewInverse[3].xyz); + + float maxLength = min(length(dVWorld),far)/length(dVWorld); + + dV *= maxLength; + dVWorld *= maxLength; + + float dL = length(dVWorld); + float expFactor = 11.0; + for (int i=0;i AEROCHROME_MODE AEROCHROME_PINKNESS AEROCHROME_WOOL_ENABLED + screen.World = [Water] [Waving_Stuff] [LabPBR] RESOURCEPACK_SKY AEROCHROME_MODE AEROCHROME_PINKNESS AEROCHROME_WOOL_ENABLED ### SPECULARS screen.Reflections.columns=2 screen.Reflections = Specular_Reflections Sun_specular_Strength Screen_Space_Reflections reflection_quality Rough_reflections Roughness_Threshold Sky_reflection Dynamic_SSR_quality @@ -222,7 +225,7 @@ PhysicsMod_support [LabPBR] ######## MISC SETTINGS screen.Misc_Settings.columns=1 - screen.Misc_Settings = [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only Glass_Tint LIGHTNING_FLASH HURT_AND_DEATH_EFFECT LIT_PARTICLE_BRIGHTNESS + screen.Misc_Settings = [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only Glass_Tint LIGHTNING_FLASH HURT_AND_DEATH_EFFECT LIT_PARTICLE_BRIGHTNESS screen.the_orb.columns = 1 screen.the_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B diff --git a/shaders/unknown_dimension_fallback/composite1.fsh b/shaders/unknown_dimension_fallback/composite1.fsh new file mode 100644 index 0000000..123ad4f --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite1.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite1.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite1.vsh b/shaders/unknown_dimension_fallback/composite1.vsh new file mode 100644 index 0000000..3d14adf --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite1.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite1.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite10.fsh b/shaders/unknown_dimension_fallback/composite10.fsh new file mode 100644 index 0000000..9b21c51 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite10.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite10.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite10.vsh b/shaders/unknown_dimension_fallback/composite10.vsh new file mode 100644 index 0000000..784ddc5 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite10.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite10.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite11.fsh b/shaders/unknown_dimension_fallback/composite11.fsh new file mode 100644 index 0000000..122b809 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite11.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite11.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite11.vsh b/shaders/unknown_dimension_fallback/composite11.vsh new file mode 100644 index 0000000..ac416fb --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite11.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite11.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite2.fsh b/shaders/unknown_dimension_fallback/composite2.fsh new file mode 100644 index 0000000..99f759f --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite2.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite2.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite2.vsh b/shaders/unknown_dimension_fallback/composite2.vsh new file mode 100644 index 0000000..3c8dbd0 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite2.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite2.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite3.fsh b/shaders/unknown_dimension_fallback/composite3.fsh new file mode 100644 index 0000000..e77e983 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite3.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite3.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite3.vsh b/shaders/unknown_dimension_fallback/composite3.vsh new file mode 100644 index 0000000..0d1a913 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite3.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite3.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite4.fsh b/shaders/unknown_dimension_fallback/composite4.fsh new file mode 100644 index 0000000..67b3aff --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite4.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite4.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite4.vsh b/shaders/unknown_dimension_fallback/composite4.vsh new file mode 100644 index 0000000..e20d49b --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite4.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite4.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite5.fsh b/shaders/unknown_dimension_fallback/composite5.fsh new file mode 100644 index 0000000..6ccd991 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite5.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite5.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite5.vsh b/shaders/unknown_dimension_fallback/composite5.vsh new file mode 100644 index 0000000..f4d4595 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite5.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite5.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite6.fsh b/shaders/unknown_dimension_fallback/composite6.fsh new file mode 100644 index 0000000..5cd8f50 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite6.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite6.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite6.vsh b/shaders/unknown_dimension_fallback/composite6.vsh new file mode 100644 index 0000000..485c580 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite6.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite6.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite7.fsh b/shaders/unknown_dimension_fallback/composite7.fsh new file mode 100644 index 0000000..391ce79 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite7.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite7.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite7.vsh b/shaders/unknown_dimension_fallback/composite7.vsh new file mode 100644 index 0000000..79e408a --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite7.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite7.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite8.fsh b/shaders/unknown_dimension_fallback/composite8.fsh new file mode 100644 index 0000000..0550c52 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite8.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite8.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite8.vsh b/shaders/unknown_dimension_fallback/composite8.vsh new file mode 100644 index 0000000..32e1f6b --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite8.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite8.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite9.fsh b/shaders/unknown_dimension_fallback/composite9.fsh new file mode 100644 index 0000000..66b4642 --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite9.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite9.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/composite9.vsh b/shaders/unknown_dimension_fallback/composite9.vsh new file mode 100644 index 0000000..eda2e6f --- /dev/null +++ b/shaders/unknown_dimension_fallback/composite9.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/composite9.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/deferred.fsh b/shaders/unknown_dimension_fallback/deferred.fsh new file mode 100644 index 0000000..fb7ece7 --- /dev/null +++ b/shaders/unknown_dimension_fallback/deferred.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/deferred.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/deferred.vsh b/shaders/unknown_dimension_fallback/deferred.vsh new file mode 100644 index 0000000..75ba542 --- /dev/null +++ b/shaders/unknown_dimension_fallback/deferred.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/deferred.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/deferred1.fsh b/shaders/unknown_dimension_fallback/deferred1.fsh new file mode 100644 index 0000000..4572957 --- /dev/null +++ b/shaders/unknown_dimension_fallback/deferred1.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/deferred1.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/deferred1.vsh b/shaders/unknown_dimension_fallback/deferred1.vsh new file mode 100644 index 0000000..7cf4357 --- /dev/null +++ b/shaders/unknown_dimension_fallback/deferred1.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/deferred1.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/final.fsh b/shaders/unknown_dimension_fallback/final.fsh new file mode 100644 index 0000000..de7edf7 --- /dev/null +++ b/shaders/unknown_dimension_fallback/final.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/final.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/final.vsh b/shaders/unknown_dimension_fallback/final.vsh new file mode 100644 index 0000000..3be04af --- /dev/null +++ b/shaders/unknown_dimension_fallback/final.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/final.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_armor_glint.fsh b/shaders/unknown_dimension_fallback/gbuffers_armor_glint.fsh new file mode 100644 index 0000000..5501d52 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_armor_glint.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define ENCHANT_GLINT + +#include "/dimensions/all_vanilla_emissives.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_armor_glint.vsh b/shaders/unknown_dimension_fallback/gbuffers_armor_glint.vsh new file mode 100644 index 0000000..87ad965 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_armor_glint.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define ENCHANT_GLINT + +#include "/dimensions/all_vanilla_emissives.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_basic.fsh b/shaders/unknown_dimension_fallback/gbuffers_basic.fsh new file mode 100644 index 0000000..13c7677 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_basic.fsh @@ -0,0 +1,9 @@ +#version 120 + +// #define ENTITIES +#define BLOCKENTITIES +#define WORLD + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_basic.vsh b/shaders/unknown_dimension_fallback/gbuffers_basic.vsh new file mode 100644 index 0000000..0d728b7 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_basic.vsh @@ -0,0 +1,10 @@ +#version 120 + +// #define ENTITIES +// #define LINE +#define BLOCKENTITIES +#define WORLD + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_beaconbeam.fsh b/shaders/unknown_dimension_fallback/gbuffers_beaconbeam.fsh new file mode 100644 index 0000000..3e666de --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_beaconbeam.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define BEACON_BEAM + +#include "/dimensions/all_vanilla_emissives.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_beaconbeam.vsh b/shaders/unknown_dimension_fallback/gbuffers_beaconbeam.vsh new file mode 100644 index 0000000..f285c00 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_beaconbeam.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define BEACON_BEAM + +#include "/dimensions/all_vanilla_emissives.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_block.fsh b/shaders/unknown_dimension_fallback/gbuffers_block.fsh new file mode 100644 index 0000000..be6bdeb --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_block.fsh @@ -0,0 +1,8 @@ +#version 120 + +#define WORLD +#define BLOCKENTITIES + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_block.vsh b/shaders/unknown_dimension_fallback/gbuffers_block.vsh new file mode 100644 index 0000000..083af2e --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_block.vsh @@ -0,0 +1,8 @@ +#version 120 + +#define WORLD +#define BLOCKENTITIES + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_damagedblock.fsh b/shaders/unknown_dimension_fallback/gbuffers_damagedblock.fsh new file mode 100644 index 0000000..de28554 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_damagedblock.fsh @@ -0,0 +1,6 @@ +#version 120 + +#define FALLBACK_SHADER +#define DAMAGE_BLOCK_EFFECT + +#include "/dimensions/all_translucent.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_damagedblock.vsh b/shaders/unknown_dimension_fallback/gbuffers_damagedblock.vsh new file mode 100644 index 0000000..6dca068 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_damagedblock.vsh @@ -0,0 +1,6 @@ +#version 120 + +#define FALLBACK_SHADER +#define DAMAGE_BLOCK_EFFECT + +#include "/dimensions/all_translucent.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_entities.fsh b/shaders/unknown_dimension_fallback/gbuffers_entities.fsh new file mode 100644 index 0000000..bfe616a --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_entities.fsh @@ -0,0 +1,8 @@ +#version 120 + +#define WORLD +#define ENTITIES + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_entities.vsh b/shaders/unknown_dimension_fallback/gbuffers_entities.vsh new file mode 100644 index 0000000..9551379 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_entities.vsh @@ -0,0 +1,9 @@ +#version 120 + + +// #define WORLD +#define ENTITIES + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_entities_glowing.fsh b/shaders/unknown_dimension_fallback/gbuffers_entities_glowing.fsh new file mode 100644 index 0000000..2f75507 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_entities_glowing.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define GLOWING + +#include "/dimensions/all_vanilla_emissives.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_entities_glowing.vsh b/shaders/unknown_dimension_fallback/gbuffers_entities_glowing.vsh new file mode 100644 index 0000000..a8a4292 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_entities_glowing.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define GLOWING + +#include "/dimensions/all_vanilla_emissives.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_hand.fsh b/shaders/unknown_dimension_fallback/gbuffers_hand.fsh new file mode 100644 index 0000000..cc8ef08 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_hand.fsh @@ -0,0 +1,8 @@ +#version 120 + +#define WORLD +#define HAND + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_hand.vsh b/shaders/unknown_dimension_fallback/gbuffers_hand.vsh new file mode 100644 index 0000000..d72528a --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_hand.vsh @@ -0,0 +1,8 @@ +#version 120 + +#define WORLD +#define HAND + +#define FALLBACK_SHADER + +#include "/dimensions/all_solid.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_hand_water.fsh b/shaders/unknown_dimension_fallback/gbuffers_hand_water.fsh new file mode 100644 index 0000000..4a34bba --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_hand_water.fsh @@ -0,0 +1,6 @@ +#version 120 + +#define HAND +#define FALLBACK_SHADER + +#include "/dimensions/all_translucent.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_hand_water.vsh b/shaders/unknown_dimension_fallback/gbuffers_hand_water.vsh new file mode 100644 index 0000000..1607313 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_hand_water.vsh @@ -0,0 +1,6 @@ +#version 120 + +#define HAND +#define FALLBACK_SHADER + +#include "/dimensions/all_translucent.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_skybasic.fsh b/shaders/unknown_dimension_fallback/gbuffers_skybasic.fsh new file mode 100644 index 0000000..21db346 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_skybasic.fsh @@ -0,0 +1,7 @@ +#version 120 + +/* RENDERTARGETS:0 */ + +void main() { + discard; +} diff --git a/shaders/unknown_dimension_fallback/gbuffers_skybasic.vsh b/shaders/unknown_dimension_fallback/gbuffers_skybasic.vsh new file mode 100644 index 0000000..0a2f94b --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_skybasic.vsh @@ -0,0 +1,5 @@ +#version 120 + +void main() { + gl_Position = ftransform(); +} diff --git a/shaders/unknown_dimension_fallback/gbuffers_skytextured.fsh b/shaders/unknown_dimension_fallback/gbuffers_skytextured.fsh new file mode 100644 index 0000000..21db346 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_skytextured.fsh @@ -0,0 +1,7 @@ +#version 120 + +/* RENDERTARGETS:0 */ + +void main() { + discard; +} diff --git a/shaders/unknown_dimension_fallback/gbuffers_skytextured.vsh b/shaders/unknown_dimension_fallback/gbuffers_skytextured.vsh new file mode 100644 index 0000000..0a2f94b --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_skytextured.vsh @@ -0,0 +1,5 @@ +#version 120 + +void main() { + gl_Position = ftransform(); +} diff --git a/shaders/unknown_dimension_fallback/gbuffers_spidereyes.fsh b/shaders/unknown_dimension_fallback/gbuffers_spidereyes.fsh new file mode 100644 index 0000000..538421d --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_spidereyes.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define SPIDER_EYES + +#include "/dimensions/all_vanilla_emissives.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_spidereyes.vsh b/shaders/unknown_dimension_fallback/gbuffers_spidereyes.vsh new file mode 100644 index 0000000..ad968cc --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_spidereyes.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define SPIDER_EYES + +#include "/dimensions/all_vanilla_emissives.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_terrain.fsh b/shaders/unknown_dimension_fallback/gbuffers_terrain.fsh new file mode 100644 index 0000000..67a223b --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_terrain.fsh @@ -0,0 +1,7 @@ +#version 120 + +#define FALLBACK_SHADER + +#define WORLD + +#include "/dimensions/all_solid.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_terrain.vsh b/shaders/unknown_dimension_fallback/gbuffers_terrain.vsh new file mode 100644 index 0000000..5b1ecef --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_terrain.vsh @@ -0,0 +1,7 @@ +#version 120 + +#define FALLBACK_SHADER + +#define WORLD + +#include "/dimensions/all_solid.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_textured.fsh b/shaders/unknown_dimension_fallback/gbuffers_textured.fsh new file mode 100644 index 0000000..9f98140 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_textured.fsh @@ -0,0 +1,6 @@ +#version 120 + + +#define FALLBACK_SHADER + +#include "/dimensions/all_particles.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_textured.vsh b/shaders/unknown_dimension_fallback/gbuffers_textured.vsh new file mode 100644 index 0000000..c1f0c91 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_textured.vsh @@ -0,0 +1,6 @@ +#version 120 + + +#define FALLBACK_SHADER + +#include "/dimensions/all_particles.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_textured_lit.fsh b/shaders/unknown_dimension_fallback/gbuffers_textured_lit.fsh new file mode 100644 index 0000000..24ea236 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_textured_lit.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/all_particles.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_textured_lit.vsh b/shaders/unknown_dimension_fallback/gbuffers_textured_lit.vsh new file mode 100644 index 0000000..bdb8c12 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_textured_lit.vsh @@ -0,0 +1,8 @@ +#version 120 + +// #define WEATHER +#define PARTICLES + +#define FALLBACK_SHADER + +#include "/dimensions/all_particles.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_water.fsh b/shaders/unknown_dimension_fallback/gbuffers_water.fsh new file mode 100644 index 0000000..7f6c880 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_water.fsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/all_translucent.fsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_water.vsh b/shaders/unknown_dimension_fallback/gbuffers_water.vsh new file mode 100644 index 0000000..faa9544 --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_water.vsh @@ -0,0 +1,5 @@ +#version 120 + +#define FALLBACK_SHADER + +#include "/dimensions/all_translucent.vsh" \ No newline at end of file diff --git a/shaders/unknown_dimension_fallback/gbuffers_weather.fsh b/shaders/unknown_dimension_fallback/gbuffers_weather.fsh new file mode 100644 index 0000000..f169e8b --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_weather.fsh @@ -0,0 +1,49 @@ +#version 120 + + +varying vec4 lmtexcoord; +varying vec4 color; + +uniform sampler2D texture; +uniform sampler2D gaux1; +uniform vec4 lightCol; +uniform vec3 sunVec; + +uniform vec2 texelSize; +uniform float skyIntensityNight; +uniform float skyIntensity; +uniform float rainStrength; + +uniform mat4 gbufferProjectionInverse; + +#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z) +#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz) +vec3 toLinear(vec3 sRGB){ + return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878); +} + + +vec3 toScreenSpaceVector(vec3 p) { + vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw); + vec3 p3 = p * 2. - 1.; + vec4 fragposition = iProjDiag * p3.xyzz + gbufferProjectionInverse[3]; + return normalize(fragposition.xyz); +} +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// + +void main() { +/* DRAWBUFFERS:2 */ + gl_FragData[0] = texture2D(texture, lmtexcoord.xy)*color; + gl_FragData[0].a = clamp(gl_FragData[0].a -0.1,0.0,1.0)*0.5; + vec3 albedo = toLinear(gl_FragData[0].rgb*color.rgb); + vec3 ambient = texture2D(gaux1,(lmtexcoord.zw*15.+0.5)*texelSize).rgb; + + gl_FragData[0].rgb = dot(albedo,vec3(1.0))*ambient*10./3.0/150.*0.1; + + + +} diff --git a/shaders/unknown_dimension_fallback/gbuffers_weather.vsh b/shaders/unknown_dimension_fallback/gbuffers_weather.vsh new file mode 100644 index 0000000..b7c44aa --- /dev/null +++ b/shaders/unknown_dimension_fallback/gbuffers_weather.vsh @@ -0,0 +1,44 @@ +#version 120 +#define TAA + +/* +!! DO NOT REMOVE !! +This code is from Chocapic13' shaders +Read the terms of modification and sharing before changing something below please ! +!! DO NOT REMOVE !! +*/ + +varying vec4 lmtexcoord; +varying vec4 color; + +uniform vec2 texelSize; +uniform int framemod8; + const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), + vec2(-1.,3.)/8., + vec2(5.0,1.)/8., + vec2(-3,-5.)/8., + vec2(-5.,5.)/8., + vec2(-7.,-1.)/8., + vec2(3,7.)/8., + vec2(7.,-7.)/8.); +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// +//////////////////////////////VOID MAIN////////////////////////////// + +void main() { + + lmtexcoord.xy = (gl_MultiTexCoord0).xy; + + vec2 lmcoord = gl_MultiTexCoord1.xy/255.; + lmtexcoord.zw = lmcoord*lmcoord; + + + gl_Position = ftransform(); + + color = gl_Color; + #ifdef TAA + gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize; + #endif +} \ No newline at end of file diff --git a/shaders/world0/gbuffers_skytextured.fsh b/shaders/world0/gbuffers_skytextured.fsh index 9bdb083..6dd945b 100644 --- a/shaders/world0/gbuffers_skytextured.fsh +++ b/shaders/world0/gbuffers_skytextured.fsh @@ -1,5 +1,36 @@ #version 120 +#include "/lib/settings.glsl" + +#if RESOURCEPACK_SKY != 0 + varying vec4 color; + varying vec2 texcoord; + uniform sampler2D texture; + + uniform int renderStage; + + float interleaved_gradientNoise(){ + // vec2 coord = gl_FragCoord.xy + (frameCounter%40000); + vec2 coord = gl_FragCoord.xy ; + // vec2 coord = gl_FragCoord.xy; + float noise = fract( 52.9829189 * fract( (coord.x * 0.06711056) + (coord.y * 0.00583715)) ); + return noise ; + } +#endif void main() { - discard; + + #if RESOURCEPACK_SKY != 0 + /* RENDERTARGETS:10 */ + + vec4 COLOR = texture2D(texture, texcoord.xy)*color; + + if(renderStage == 4) COLOR.rgb *= 5.0; + // if(renderStage == 5) COLOR.rgb *= 1.5; + + COLOR.rgb = max(COLOR.rgb * (0.9+0.1*interleaved_gradientNoise()), 0.0); + + gl_FragData[0] = vec4(COLOR.rgb/255.0, COLOR.a); + #else + discard; + #endif } diff --git a/shaders/world0/gbuffers_skytextured.vsh b/shaders/world0/gbuffers_skytextured.vsh index 0a2f94b..081e29e 100644 --- a/shaders/world0/gbuffers_skytextured.vsh +++ b/shaders/world0/gbuffers_skytextured.vsh @@ -1,5 +1,40 @@ #version 120 +#include "/lib/settings.glsl" + +#if RESOURCEPACK_SKY != 0 + #include "/lib/res_params.glsl" + /* + !! DO NOT REMOVE !! + This code is from Chocapic13' shaders + Read the terms of modification and sharing before changing something below please ! + !! DO NOT REMOVE !! + */ + varying vec4 color; + varying vec2 texcoord; + uniform vec2 texelSize; + uniform int framemod8; + const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), + vec2(-1.,3.)/8., + vec2(5.0,1.)/8., + vec2(-3,-5.)/8., + vec2(-5.,5.)/8., + vec2(-7.,-1.)/8., + vec2(3,7.)/8., + vec2(7.,-7.)/8.); + +#endif void main() { gl_Position = ftransform(); -} + + #if RESOURCEPACK_SKY != 0 + texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; + color = gl_Color; + #ifdef TAA_UPSCALING + gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w; + #endif + #ifdef TAA + gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize; + #endif + #endif +} \ No newline at end of file