Added resourecpack sky support. made use of iris dimensions.properties and added fallback shader.

This commit is contained in:
Xonk 2023-10-10 23:02:00 -04:00
parent 69e605b38b
commit 1168da157d
82 changed files with 738 additions and 84 deletions

View File

@ -0,0 +1,15 @@
# USAGE
# dimension.<Shader to use> = <dimension(s) that use this shader. use " * " for fallback>
# "shader to use" refers to shaderpacks/EXAMPLESHADER/shaders/<name "Shader to use" >..., 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 <dimension> 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 = *

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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
}

View File

@ -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
*/

View File

@ -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;

View File

@ -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);

View File

@ -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
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

View File

@ -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

View File

@ -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<SAMPLES;i++) {
float d = (pow(expFactor, float(i+dither)/float(SAMPLES))/expFactor - 1.0/expFactor)/(1-1.0/expFactor);
float dd = pow(expFactor, float(i+dither)/float(SAMPLES)) * log(expFactor) / float(SAMPLES)/(expFactor-1.0);
vec3 progress = start.xyz + d*dV;
vec3 progressW = gbufferModelViewInverse[3].xyz+cameraPosition + d*dVWorld;
// do main lighting
float Density = 0.05;
Density *= pow(normalize(-wpos).y*0.5+0.5,3.0);
// vec3 vL0 = vec3(0.8,0.5,1) * 0.05 * pow(normalize(wpos).y*0.5+0.5,2.0)*2.0;
vec3 vL0 = vec3(0.8,1.0,0.5) * 0.05 ;
vL += (vL0 - vL0*exp(-Density*dd*dL)) * absorbance;
absorbance *= exp(-(Density)*dd*dL);
if (absorbance < 1e-5) break;
}
return vec4(vL, absorbance);
}

View File

@ -4,37 +4,29 @@ vec2 R2_samples(int n){
}
////////////////////////////////////////////////////////////////
///////////////////////////// SSAO ////////////////////////
////////////////////////////////////////////////////////////////
const float PI = 3.141592653589793238462643383279502884197169;
vec2 tapLocation_alternate(
int sampleNumber, float spinAngle, int nb, float nbRot, float r0
int samples, int totalSamples, float rotation, float rng
){
float alpha = (float(sampleNumber*1.0f + r0) * (1.0 / (nb)));
float angle = alpha * (nbRot * 3.14) ;
float alpha = float(samples + rng) * (1.0 / float(totalSamples));
float angle = alpha * (rotation * PI);
float ssR = alpha + spinAngle*3.14;
float sin_v, cos_v;
float sin_v = sin(angle);
float cos_v = cos(angle);
sin_v = sin(angle);
cos_v = cos(angle);
return vec2(cos_v, sin_v)*ssR;
return vec2(cos_v, sin_v) * alpha;
}
vec2 SSAO(
vec3 viewPos, vec3 normal, bool hand, bool leaves
){
if(hand) return vec2(1,0);
// float radius[7] = float[](
// 0.15,
// 0.15,
// 0.15,
// 0.15,
// 0.15,
// 0.15,
// 0.15
// );
float dist = 1.0 + clamp(viewPos.z*viewPos.z/50.0,0,5); // shrink sample size as distance increases
float mulfov2 = gbufferProjection[1][1]/(3 * dist);
@ -49,16 +41,20 @@ vec2 SSAO(
vec2 acc = -(TAA_Offset*(texelSize/2))*RENDER_SCALE ;
int seed = (frameCounter%40000) * 2 + (1+frameCounter);
float samplePos = fract(R2_samples(seed).x + blueNoise(gl_FragCoord.xy).x) * 1.61803398874;
// int seed = (frameCounter%40000)*2 + (1+frameCounter);
// vec2 samplePos = fract(R2_samples(seed).xy + blueNoise(gl_FragCoord.xy).xy);
int samples = 7;
int seed = (frameCounter%40000) + frameCounter*2;
float samplePos = fract(R2_samples(seed).y + blueNoise(gl_FragCoord.xy).y);
float occlusion = 0.0; float sss = 0.0;
int n = 0;
for (int i = 0; i < samples; i++) {
vec2 sp = tapLocation_alternate(i, 0.0, samples, 20, samplePos)* 0.2;
vec2 sp = tapLocation_alternate(i, samples, 20, samplePos) * 0.2;
float rd = mulfov2 ;
vec2 sampleOffset = sp * rd;
@ -122,7 +118,7 @@ float ScreenSpace_SSS(
int n = 0;
for (int i = 0; i < samples; i++) {
vec2 sp = tapLocation_alternate(i, 0.0, samples, 20, samplePos)* 0.2;
vec2 sp = tapLocation_alternate(i, samples, 20, samplePos)* 0.2;
float rd = mulfov2 ;
vec2 sampleOffset = sp * rd;

View File

@ -162,7 +162,7 @@ const float sunPathRotation = -35; //[-90 -89 -88 -87 -86 -85 -84 -83 -82 -81 -8
#define fog_coefficientMieG 3.0 // [0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
#define fog_coefficientMieB 3.0 // [0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
#define RainFog_amount 1 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
#define RainFog_amount 3 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
#define BLOOMY_FOG 2.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 6.0 10.0 15.0 20.0]
#define BLOOM_STRENGTH 4.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0]
@ -490,8 +490,15 @@ uniform int moonPhase;
#define LIGHTNING_FLASH // FOR OPTIFINE USERS. some mods change the sky color, which can trigger the lightning flash detection.
#define RESOURCEPACK_SKY 0 // [0 1 2]
// fix settings
#if RESOURCEPACK_SKY == 0
#endif
#ifdef VANILLA_SUN_AND_MOON
#endif
#ifdef LIGHTNING_FLASH
#endif
#if BLISS_SHADERS == 0
#endif
#endif

View File

@ -6,14 +6,20 @@
shadowEntities = false
#endif
oldLighting=false
underwaterOverlay=false
sun=true
moon=true
#if RESOURCEPACK_SKY == 2
sun=true
moon=true
#else
sun=false
moon=false
#endif
clouds=off
stars=false
vignette=false
underwaterOverlay=false
dynamicHandLight=true
oldLighting=false
separateAo = true
particles.before.deferred = true
@ -21,22 +27,19 @@ particles.before.deferred = true
rain.depth = false
beacon.beam.depth = true
frustum.culling=false
shadow.culling=false
program.composite4.enabled = TAA_UPSCALING
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
#Get the correct alpha value : S_A*(1-DST_A)+DST_A
blend.gbuffers_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.gbuffers_hand_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
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_armor_glint = 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_weather = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.gbuffers_damagedblock = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.gbuffers_hand_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
blend.gbuffers_skytextured = SRC_ALPHA DST_ALPHA
# Disable blending
blend.gbuffers_hand = off
@ -110,7 +113,7 @@ PhysicsMod_support [LabPBR]
######## WORLD
screen.World.columns=1
screen.World = [Water] [Waving_Stuff] [LabPBR] <empty> AEROCHROME_MODE AEROCHROME_PINKNESS AEROCHROME_WOOL_ENABLED
screen.World = [Water] [Waving_Stuff] [LabPBR] RESOURCEPACK_SKY <empty> 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

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite1.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite1.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite10.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite10.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite11.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite11.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite2.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite2.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite3.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite3.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite4.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite4.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite5.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite5.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite6.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite6.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite7.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite7.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite8.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite8.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite9.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/composite9.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/deferred.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/deferred.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/deferred1.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/deferred1.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/final.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/final.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define ENCHANT_GLINT
#include "/dimensions/all_vanilla_emissives.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define ENCHANT_GLINT
#include "/dimensions/all_vanilla_emissives.vsh"

View File

@ -0,0 +1,9 @@
#version 120
// #define ENTITIES
#define BLOCKENTITIES
#define WORLD
#define FALLBACK_SHADER
#include "/dimensions/all_solid.fsh"

View File

@ -0,0 +1,10 @@
#version 120
// #define ENTITIES
// #define LINE
#define BLOCKENTITIES
#define WORLD
#define FALLBACK_SHADER
#include "/dimensions/all_solid.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define BEACON_BEAM
#include "/dimensions/all_vanilla_emissives.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define BEACON_BEAM
#include "/dimensions/all_vanilla_emissives.vsh"

View File

@ -0,0 +1,8 @@
#version 120
#define WORLD
#define BLOCKENTITIES
#define FALLBACK_SHADER
#include "/dimensions/all_solid.fsh"

View File

@ -0,0 +1,8 @@
#version 120
#define WORLD
#define BLOCKENTITIES
#define FALLBACK_SHADER
#include "/dimensions/all_solid.vsh"

View File

@ -0,0 +1,6 @@
#version 120
#define FALLBACK_SHADER
#define DAMAGE_BLOCK_EFFECT
#include "/dimensions/all_translucent.fsh"

View File

@ -0,0 +1,6 @@
#version 120
#define FALLBACK_SHADER
#define DAMAGE_BLOCK_EFFECT
#include "/dimensions/all_translucent.vsh"

View File

@ -0,0 +1,8 @@
#version 120
#define WORLD
#define ENTITIES
#define FALLBACK_SHADER
#include "/dimensions/all_solid.fsh"

View File

@ -0,0 +1,9 @@
#version 120
// #define WORLD
#define ENTITIES
#define FALLBACK_SHADER
#include "/dimensions/all_solid.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define GLOWING
#include "/dimensions/all_vanilla_emissives.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define GLOWING
#include "/dimensions/all_vanilla_emissives.vsh"

View File

@ -0,0 +1,8 @@
#version 120
#define WORLD
#define HAND
#define FALLBACK_SHADER
#include "/dimensions/all_solid.fsh"

View File

@ -0,0 +1,8 @@
#version 120
#define WORLD
#define HAND
#define FALLBACK_SHADER
#include "/dimensions/all_solid.vsh"

View File

@ -0,0 +1,6 @@
#version 120
#define HAND
#define FALLBACK_SHADER
#include "/dimensions/all_translucent.fsh"

View File

@ -0,0 +1,6 @@
#version 120
#define HAND
#define FALLBACK_SHADER
#include "/dimensions/all_translucent.vsh"

View File

@ -0,0 +1,7 @@
#version 120
/* RENDERTARGETS:0 */
void main() {
discard;
}

View File

@ -0,0 +1,5 @@
#version 120
void main() {
gl_Position = ftransform();
}

View File

@ -0,0 +1,7 @@
#version 120
/* RENDERTARGETS:0 */
void main() {
discard;
}

View File

@ -0,0 +1,5 @@
#version 120
void main() {
gl_Position = ftransform();
}

View File

@ -0,0 +1,5 @@
#version 120
#define SPIDER_EYES
#include "/dimensions/all_vanilla_emissives.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define SPIDER_EYES
#include "/dimensions/all_vanilla_emissives.vsh"

View File

@ -0,0 +1,7 @@
#version 120
#define FALLBACK_SHADER
#define WORLD
#include "/dimensions/all_solid.fsh"

View File

@ -0,0 +1,7 @@
#version 120
#define FALLBACK_SHADER
#define WORLD
#include "/dimensions/all_solid.vsh"

View File

@ -0,0 +1,6 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/all_particles.fsh"

View File

@ -0,0 +1,6 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/all_particles.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/all_particles.fsh"

View File

@ -0,0 +1,8 @@
#version 120
// #define WEATHER
#define PARTICLES
#define FALLBACK_SHADER
#include "/dimensions/all_particles.vsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/all_translucent.fsh"

View File

@ -0,0 +1,5 @@
#version 120
#define FALLBACK_SHADER
#include "/dimensions/all_translucent.vsh"

View File

@ -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;
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}