mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-10 04:53:07 +08:00
Add custom moon rotation with possible eclipses! Add lighting with shadows to main end island. Add lightning shadows. Add Caelum support. Fix water interaction not working after ~5k blocks from spawn. Fix DH chunk fading on Oculus. Add option to exclude all entities from puddles. Merge Xonk's latest commit. Some more stuff I can't remember.
This commit is contained in:
+7
-1
@@ -38,4 +38,10 @@ Credit to the people who inspired many changes and ideas, that you NEED to know
|
||||
Temporal credits entry to people who added more mod support to Bliss:
|
||||
MikiP98 / https://github.com/MikiP98 | Miki-Liki (Modrinth)
|
||||
Benjamin Rühl / https://github.com/benruehl
|
||||
ludo_silver (discord)
|
||||
ludo_silver (discord)
|
||||
|
||||
|
||||
|
||||
Image credits:
|
||||
Moon Texture from https://www.solarsystemscope.com/textures/
|
||||
Sun Corona Texture by Luc Viatour / https://Lucnix.be
|
||||
File diff suppressed because one or more lines are too long
@@ -121,6 +121,10 @@ uniform int isEyeInWater;
|
||||
uniform float rainStrength;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined CUSTOM_MOON_ROTATION && LIGHTNING_SHADOWS > 0
|
||||
uniform vec4 lightningBoltPosition;
|
||||
uniform float sunElevation;
|
||||
#endif
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#define CLOUDSHADOWSONLY
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
varying vec4 pos;
|
||||
varying vec4 gcolor;
|
||||
|
||||
@@ -97,7 +101,6 @@ void main() {
|
||||
|
||||
|
||||
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
|
||||
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
||||
|
||||
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
||||
|
||||
@@ -105,10 +108,19 @@ void main() {
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 WmoonVec = customMoonVecSSBO;
|
||||
|
||||
WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
WsunVec2 = lightCol.a * normalize(sunPosition);
|
||||
WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
WsunVec2 = normalize(sunPosition);
|
||||
|
||||
WsunVec = mix(WmoonVec, WsunVec, float(sunElevation > 1e-5));
|
||||
WsunVec2 = mix(normalize(mat3(gbufferModelView)*WmoonVec), WsunVec2, float(sunElevation > 1e-5));
|
||||
#else
|
||||
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
||||
WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
WsunVec2 = lightCol.a * normalize(sunPosition);
|
||||
#endif
|
||||
|
||||
#ifdef TAA_UPSCALING
|
||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
||||
|
||||
@@ -79,6 +79,11 @@ uniform vec3 previousCameraPosition;
|
||||
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION && LIGHTNING_SHADOWS > 0
|
||||
uniform vec4 lightningBoltPosition;
|
||||
uniform float sunElevation;
|
||||
#endif
|
||||
|
||||
#define CLOUDSHADOWSONLY
|
||||
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
@@ -134,18 +139,23 @@ float encodeVec2(float x,float y){
|
||||
return encodeVec2(vec2(x,y));
|
||||
}
|
||||
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
// #undef BASIC_SHADOW_FILTER
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER
|
||||
float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDistFade){
|
||||
|
||||
// if(maxDistFade <= 0.0) return 1.0;
|
||||
|
||||
// setup shadow projection
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 projectedShadowPosition = mat3(customShadowMatrixSSBO) * playerPos + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz;
|
||||
#endif
|
||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
|
||||
// un-distort
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
@@ -154,6 +164,9 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
//vec4 shadowPos = customShadowPerspectiveSSBO * (customShadowMatrixSSBO * vec4(playerPos, 1.0));
|
||||
//projectedShadowPosition = shadowPos.xyz / shadowPos.w;
|
||||
|
||||
// hamburger
|
||||
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5);
|
||||
|
||||
@@ -434,10 +447,10 @@ void main() {
|
||||
directLightColor = lightCol.rgb/2400.0;
|
||||
AmbientLightColor = averageSkyCol_Clouds / 900.0;
|
||||
|
||||
#ifdef USE_CUSTOM_DIFFUSE_LIGHTING_COLORS
|
||||
directLightColor = luma(directLightColor) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
AmbientLightColor = luma(AmbientLightColor) * vec3(INDIRECTLIGHT_DIFFUSE_R,INDIRECTLIGHT_DIFFUSE_G,INDIRECTLIGHT_DIFFUSE_B);
|
||||
#endif
|
||||
#ifdef USE_CUSTOM_DIFFUSE_LIGHTING_COLORS
|
||||
directLightColor = luma(directLightColor) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
AmbientLightColor = luma(AmbientLightColor) * vec3(INDIRECTLIGHT_DIFFUSE_R,INDIRECTLIGHT_DIFFUSE_G,INDIRECTLIGHT_DIFFUSE_B);
|
||||
#endif
|
||||
|
||||
|
||||
float Shadows = 1.0;
|
||||
|
||||
@@ -282,7 +282,17 @@ void main() {
|
||||
// if( dot(gl_Color.rgb, vec3(1.0/3.0)) < 1.0) NameTags = 1;
|
||||
// if(gl_Color.a < 1.0) NameTags = 1;
|
||||
// if(gl_Color.a >= 0.24 && gl_Color.a <= 0.25 ) gl_Position = vec4(10,10,10,1);
|
||||
if(entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SSS_WEAK || entityId == ENTITY_PLAYER || entityId == 2468) normalMat.a = 0.45;
|
||||
#ifdef INCLUDE_UNLISTED_ENTITIES
|
||||
if(entityId == 65535) {
|
||||
bool unlistedEntity = true;
|
||||
} else {
|
||||
bool unlistedEntity = false;
|
||||
}
|
||||
#else
|
||||
bool unlistedEntity = false;
|
||||
#endif
|
||||
|
||||
if(entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SSS_WEAK || entityId == ENTITY_PLAYER || entityId == 2468 || unlistedEntity) normalMat.a = 0.45;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
#undef FLASHLIGHT_BOUNCED_INDIRECT
|
||||
|
||||
// #if defined END_SHADER || defined NETHER_SHADER
|
||||
@@ -17,7 +21,7 @@ varying vec4 lmtexcoord;
|
||||
varying vec4 color;
|
||||
uniform vec4 entityColor;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
const bool shadowHardwareFiltering = true;
|
||||
uniform sampler2DShadow shadow;
|
||||
|
||||
@@ -75,6 +79,8 @@ varying vec3 flatnormal;
|
||||
varying vec3 largeWaveDisplacementNormal;
|
||||
#endif
|
||||
|
||||
varying float LIGHTNING_BOLT;
|
||||
|
||||
uniform vec3 sunVec;
|
||||
uniform float near;
|
||||
// uniform float far;
|
||||
@@ -305,7 +311,7 @@ float ld(float dist) {
|
||||
|
||||
// #undef BASIC_SHADOW_FILTER
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_SHADER && defined END_ISLAND_LIGHT)
|
||||
|
||||
#include "/lib/Shadows.glsl"
|
||||
|
||||
@@ -314,25 +320,38 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
|
||||
// if(maxDistFade <= 0.0) return 1.0;
|
||||
|
||||
// setup shadow projection
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz;
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 projectedShadowPosition = mat3(customShadowMatrixSSBO) * playerPos + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz;
|
||||
#endif
|
||||
|
||||
applyShadowBias(projectedShadowPosition, playerPos, geoNormals);
|
||||
applyShadowBias(projectedShadowPosition, playerPos, geoNormals);
|
||||
|
||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
|
||||
//mat4 Custom_ViewMatrix = BuildShadowViewMatrix();
|
||||
//projectedShadowPosition = mat3(Custom_ViewMatrix) * playerPos + Custom_ViewMatrix[3].xyz;
|
||||
//projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
// un-distort
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
projectedShadowPosition.xy *= distortFactor;
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
// un-distort
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
projectedShadowPosition.xy *= distortFactor;
|
||||
projectedShadowPosition.z += shadowProjection[3].z * 0.0012;
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
projectedShadowPosition.z += shadowProjection[3].z * 0.0012;
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
vec4 shadowPos = customShadowMatrixSSBO * vec4(playerPos, 1.0);
|
||||
applyShadowBias(shadowPos.xyz, playerPos, geoNormals);
|
||||
shadowPos = customShadowPerspectiveSSBO * shadowPos;
|
||||
vec3 projectedShadowPosition = shadowPos.xyz / shadowPos.w;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// hamburger
|
||||
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5);
|
||||
@@ -342,7 +361,11 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
|
||||
|
||||
#ifdef BASIC_SHADOW_FILTER
|
||||
int samples = int(SHADOW_FILTER_SAMPLE_COUNT * 0.5);
|
||||
float rdMul = (4.0*distortFactor*d0*k/shadowMapResolution) * 0.3;
|
||||
#ifdef END_SHADER
|
||||
float rdMul = (4.0*distortFactor*d0*k/shadowMapResolution) * 13.0;
|
||||
#else
|
||||
float rdMul = (4.0*distortFactor*d0*k/shadowMapResolution) * 0.6;
|
||||
#endif
|
||||
|
||||
for(int i = 0; i < samples; i++){
|
||||
vec2 offsetS = CleanSample(i, samples - 1, noise) * rdMul;
|
||||
@@ -387,7 +410,18 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
|
||||
directLightColor *= mix(vec3(1.0), translucentTint.rgb / samples, maxDistFade);
|
||||
#endif
|
||||
|
||||
return shadowmap / samples;
|
||||
float shadowResult = shadowmap / samples;
|
||||
|
||||
#ifdef END_SHADER
|
||||
float r = length(projectedShadowPosition.xy - vec2(0.5));
|
||||
if (r < 0.5 && abs(projectedShadowPosition.z) < 1.0) {
|
||||
shadowResult *= smoothstep(0.5, 0.25, r);
|
||||
} else {
|
||||
shadowResult = 0.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return shadowResult;
|
||||
// return mix(1.0, shadowmap / samples, maxDistFade);
|
||||
}
|
||||
#endif
|
||||
@@ -490,11 +524,11 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
#if defined DISTANT_HORIZONS && DH_CHUNK_FADING > 0
|
||||
float ditherFade = smoothstep(0.98 * far, 1.03 * far, viewDist);
|
||||
|
||||
if (step(ditherFade, R2_dither()) == 0.0) discard;
|
||||
if (step(ditherFade, R2_dither()) == 0.0 && LIGHTNING_BOLT == 0.0) discard;
|
||||
#endif
|
||||
|
||||
#if defined LIGHTNING
|
||||
Albedo = vec3(1.0,2.0,6.0);
|
||||
#ifdef LIGHTNING
|
||||
if (LIGHTNING_BOLT > 0.0) Albedo = 2.5 * vec3(1.0,2.2,6.5);
|
||||
#endif
|
||||
|
||||
#ifdef ENTITIES
|
||||
@@ -574,7 +608,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
if(viewDist < 35 && rainStrength > 0.0 && biome_precipitation == 1 && abs(worldSpaceNormal.z) < 0.95 && abs(worldSpaceNormal.x) < 0.95) {
|
||||
float effectStrength = smoothstep(0.85, 1.0, lightmap.y);
|
||||
rippleBump = ripples(worldPos.xz);
|
||||
waterPos.xyz += RIPPLE_STRENGTH * rippleBump * rainStrength * effectStrength * smoothstep(35, 10, viewDist);
|
||||
waterPos.xyz += RIPPLE_STRENGTH * rippleBump * rainStrength * effectStrength * smoothstep(35.0, 10.0, viewDist);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -736,7 +770,27 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
float fogShadow = GetEndFogShadow(worldPos, lightPos);
|
||||
float endPhase = endFogPhase(lightPos);
|
||||
|
||||
Direct_lighting += lightColors * endPhase * end_NdotL * fogShadow;
|
||||
Direct_lighting = lightColors * endPhase * end_NdotL * fogShadow;
|
||||
|
||||
#ifdef END_ISLAND_LIGHT
|
||||
vec3 WsunVec = normalize(vec3(END_LIGHT_POS)-(feetPlayerPos+cameraPosition));
|
||||
vec3 DirectLightColor = 0.55*vec3(AmbientLightEnd_R,AmbientLightEnd_G*0.6,AmbientLightEnd_B*0.8);
|
||||
|
||||
float NdotL = clamp((-15 + dot(normal, normalize(WsunVec*mat3(gbufferModelViewInverse)))*255.0) / 240.0 ,0.0,1.0);
|
||||
float Shadows = 1.0;
|
||||
|
||||
float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+16),0.0)*5.0,1.0));
|
||||
float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / shadowDistance,0.0)*5.0,1.0));
|
||||
|
||||
float LM_shadowMapFallback = min(max(lightmap.y-0.8, 0.0) * 25,1.0);
|
||||
|
||||
Shadows = ComputeShadowMap(DirectLightColor, shadowPlayerPos, shadowMapFalloff, blueNoise(), geoNormals);
|
||||
|
||||
// Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2);
|
||||
Shadows *= mix(LM_shadowMapFallback,1.0,shadowMapFalloff2);
|
||||
|
||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||
#endif
|
||||
|
||||
vec3 AmbientLightColor = vec3(AmbientLightEnd_R,AmbientLightEnd_G,AmbientLightEnd_B) ;
|
||||
|
||||
@@ -815,7 +869,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
|
||||
float reflectance = 0.0;
|
||||
|
||||
#if !defined OVERWORLD_SHADER
|
||||
#if !defined OVERWORLD_SHADER || (!defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
vec3 WsunVec = vec3(0.0);
|
||||
vec3 DirectLightColor = WsunVec;
|
||||
float Shadows = 0.0;
|
||||
@@ -849,7 +903,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
float maxOverdrawDistance = OVERDRAW_MAX_DISTANCE;
|
||||
#endif
|
||||
|
||||
bool WATER = texture2D(colortex7, gl_FragCoord.xy*texelSize).a > 0.0 && length(feetPlayerPos) > clamp(far-16*4, 16, maxOverdrawDistance) && texture2D(depthtex1, gl_FragCoord.xy*texelSize).x >= 1.0;
|
||||
bool WATER = texture2D(colortex7, gl_FragCoord.xy*texelSize).a > 0.0 && length(feetPlayerPos) > clamp(far-16.0*4.0, 16.0, maxOverdrawDistance) && texture2D(depthtex1, gl_FragCoord.xy*texelSize).x >= 1.0;
|
||||
|
||||
if(WATER && isWater) {
|
||||
gl_FragData[0].a = 0.0;
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
#include "/lib/bokeh.glsl"
|
||||
#include "/lib/items.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
#include "/lib/entities.glsl"
|
||||
|
||||
uniform float frameTimeCounter;
|
||||
#include "/lib/Shadow_Params.glsl"
|
||||
|
||||
@@ -55,6 +61,7 @@ attribute vec4 mc_Entity;
|
||||
uniform int entityId;
|
||||
#endif
|
||||
|
||||
varying float LIGHTNING_BOLT;
|
||||
|
||||
uniform vec3 sunPosition;
|
||||
uniform vec3 moonPosition;
|
||||
@@ -244,9 +251,14 @@ void main() {
|
||||
// WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
|
||||
WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 moonVec = customMoonVecSSBO;
|
||||
#else
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
if(dot(-moonVec, WsunVec) < 0.9999) moonVec = -moonVec;
|
||||
#endif
|
||||
|
||||
vec3 WmoonVec = moonVec;
|
||||
if(dot(-moonVec, WsunVec) < 0.9999) WmoonVec = -moonVec;
|
||||
|
||||
WsunVec = mix(WmoonVec, WsunVec, clamp(lightCol.a,0,1));
|
||||
|
||||
@@ -254,6 +266,14 @@ void main() {
|
||||
|
||||
#endif
|
||||
|
||||
LIGHTNING_BOLT = 0.0;
|
||||
#ifdef ENTITIES
|
||||
if(entityId == ENTITY_LIGHTNING){
|
||||
LIGHTNING_BOLT = 1.0;
|
||||
normalMat.a = 0.50;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAA_UPSCALING
|
||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
#include "/lib/settings.glsl"
|
||||
layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
const ivec3 workGroups = ivec3(1, 1, 1);
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
uniform float sunElevation;
|
||||
uniform mat4 shadowModelView;
|
||||
uniform int worldTime;
|
||||
uniform int worldDay;
|
||||
// uniform float frameTimeCounter;
|
||||
uniform vec4 lightningBoltPosition;
|
||||
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
|
||||
vec3 moonDirection(float worldTime, float latitude, float pathRotation) {
|
||||
float phi = radians(-latitude);
|
||||
float del = radians(pathRotation);
|
||||
|
||||
float t = worldTime / 24000.0;
|
||||
|
||||
t *= 1.0 + 1.0 / MONTH_LENGTH;
|
||||
|
||||
float H = t * 2.0 * PI - PI; // hour angle
|
||||
|
||||
float sin_h = sin(phi)*sin(del) + cos(phi)*cos(del)*cos(H);
|
||||
float h = asin(sin_h); // height
|
||||
float cos_h = cos(h);
|
||||
|
||||
float cosA = (sin(del) - sin(phi)*sin_h) / (cos(phi)*cos_h);
|
||||
|
||||
cosA = clamp(cosA, -1.0, 1.0); // otherwise it bugs out...
|
||||
|
||||
float A = acos(cosA); // Azimuth
|
||||
if (sin(H) > 0.0) A = 2.0 * PI - A; // mirror onto other hemisphere
|
||||
|
||||
return vec3(cos_h * sin(A), sin_h, cos_h * cos(A));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined CUSTOM_MOON_ROTATION && defined OVERWORLD_SHADER) || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
#include "/lib/SSBOs.glsl"
|
||||
uniform vec3 cameraPosition;
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
float NEAR = 15.0;
|
||||
float FAR = 256.0;
|
||||
|
||||
mat4 createPerspectiveMatrix() {
|
||||
float fov = END_LIGHT_FOV;
|
||||
float yScale = 1.0 / tan(radians(fov) * 0.5);
|
||||
|
||||
return mat4(
|
||||
yScale, 0.0, 0.0, 0.0,
|
||||
0.0, yScale, 0.0, 0.0,
|
||||
0.0, 0.0, (FAR + NEAR) / (NEAR - FAR), -1.0,
|
||||
0.0, 0.0, 2.0 * FAR * NEAR / (NEAR - FAR), 1.0
|
||||
);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
mat4 BuildTranslationMatrix(vec3 delta) {
|
||||
return mat4(
|
||||
vec4(1.0, 0.0, 0.0, 0.0),
|
||||
vec4(0.0, 1.0, 0.0, 0.0),
|
||||
vec4(0.0, 0.0, 1.0, 0.0),
|
||||
vec4(delta, 1.0));
|
||||
}
|
||||
|
||||
mat4 BuildShadowViewMatrix(vec3 localLightDir) {
|
||||
#ifndef CAELUM_SUPPORT
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if LIGHTNING_SHADOWS > 1
|
||||
if (sunElevation > 0.0 && lightningBoltPosition.w == 0.0) return shadowModelView;
|
||||
#else
|
||||
if (sunElevation > 0.0) return shadowModelView;
|
||||
#endif
|
||||
#else
|
||||
localLightDir = normalize(END_LIGHT_POS);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vec3 worldUp = vec3(0.0, 1.0, 0.0);
|
||||
if (localLightDir == vec3(0.0, 1.0, 0.0)) worldUp = normalize(vec3(1.0, 0.0, 0.0));
|
||||
|
||||
vec3 zaxis = localLightDir;
|
||||
|
||||
vec3 xaxis = normalize(cross(worldUp, zaxis));
|
||||
vec3 yaxis = normalize(cross(zaxis, xaxis));
|
||||
|
||||
mat4 shadowModelViewEx = mat4(1.0);
|
||||
shadowModelViewEx[0].xyz = vec3(xaxis.x, yaxis.x, zaxis.x);
|
||||
shadowModelViewEx[1].xyz = vec3(xaxis.y, yaxis.y, zaxis.y);
|
||||
shadowModelViewEx[2].xyz = vec3(xaxis.z, yaxis.z, zaxis.z);
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
vec3 intervalOffset = -100.0 * localLightDir;
|
||||
#else
|
||||
vec3 intervalOffset = (-vec3(END_LIGHT_POS) + cameraPosition);
|
||||
#endif
|
||||
mat4 translation = BuildTranslationMatrix(intervalOffset);
|
||||
|
||||
return shadowModelViewEx * translation;
|
||||
}
|
||||
#endif
|
||||
|
||||
uniform mat4 gbufferModelViewInverse;
|
||||
uniform vec3 moonPosition;
|
||||
uniform vec3 sunPosition;
|
||||
|
||||
|
||||
void main() {
|
||||
#if defined CUSTOM_MOON_ROTATION && defined OVERWORLD_SHADER
|
||||
|
||||
#ifdef CAELUM_SUPPORT
|
||||
customMoonVecSSBO = -normalize(mat3(gbufferModelViewInverse) * moonPosition); //idk why it's negative
|
||||
#else
|
||||
// ensure the world time gets reset at a multiple of the month length
|
||||
float absWorldTime = worldTime + mod(worldDay, 100 - mod(100, MONTH_LENGTH))*24000.0;
|
||||
|
||||
float yearLengthTicks = float(MONTH_LENGTH) * 12.0 * 24000.0;
|
||||
float timeInYear = mod(absWorldTime, yearLengthTicks)/(yearLengthTicks);
|
||||
|
||||
float moon_offset = 2.0 * EARTH_ROTATION_TILT * smoothstep(0.0, 0.5, timeInYear) * smoothstep(1.0, 0.5, timeInYear) - EARTH_ROTATION_TILT;
|
||||
|
||||
customMoonVecSSBO = normalize(moonDirection(absWorldTime - MOON_TIME_OFFSET, MOON_LATITUDE, moon_offset));
|
||||
#endif
|
||||
|
||||
#if LIGHTNING_SHADOWS > 0
|
||||
customMoonVec2SSBO = customMoonVecSSBO;
|
||||
|
||||
if (lightningBoltPosition.w > 0.0) {
|
||||
vec4 lightningBoltPosition= lightningBoltPosition;
|
||||
lightningBoltPosition.y = max(lightningBoltPosition.y, cameraPosition.y);
|
||||
customMoonVecSSBO = normalize(lightningBoltPosition.xyz);
|
||||
}
|
||||
#endif
|
||||
|
||||
customShadowMatrixSSBO = BuildShadowViewMatrix(customMoonVecSSBO);
|
||||
#ifdef CAELUM_SUPPORT
|
||||
if (sunElevation > 0.0) customShadowMatrixSSBO = BuildShadowViewMatrix(normalize(mat3(gbufferModelViewInverse) * sunPosition)); //replace only the matrix
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
customShadowMatrixSSBO = BuildShadowViewMatrix(vec3(0.0, 1.0, 0.0));
|
||||
customShadowPerspectiveSSBO = createPerspectiveMatrix();
|
||||
#endif
|
||||
}
|
||||
@@ -4,8 +4,13 @@
|
||||
#undef DISTANT_HORIZONS
|
||||
#endif
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
flat varying vec3 WsunVec;
|
||||
#ifndef END_SHADER
|
||||
flat varying vec3 WsunVec;
|
||||
#endif
|
||||
flat varying vec2 TAA_Offset;
|
||||
|
||||
#include "/lib/res_params.glsl"
|
||||
@@ -253,7 +258,7 @@ float convertHandDepth_2(in float depth, bool hand) {
|
||||
vec2 SSAO(
|
||||
vec3 viewPos, vec3 normal, vec3 flatnormal, bool hand, bool leaves, float noise
|
||||
){
|
||||
int samples = 7;
|
||||
int samples = 4;
|
||||
float occlusion = 0.0;
|
||||
float sss = 0.0;
|
||||
|
||||
@@ -264,6 +269,8 @@ vec2 SSAO(
|
||||
float distanceScale = hand ? 30.0 : mix(40.0, 10.0, pow(clamp(1.0 - linearViewDistance/50.0,0.0,1.0),2.0));
|
||||
float depthCancelation = (linearViewDistance*linearViewDistance) / distanceScale ;
|
||||
|
||||
if (linearViewDistance < 15.0 || hand) samples = 7;
|
||||
|
||||
// distanceScale *= 10;
|
||||
vec2 screenEdges = 2.0/vec2(viewWidth, viewHeight);
|
||||
|
||||
@@ -287,19 +294,20 @@ vec2 SSAO(
|
||||
|
||||
vec3 viewPosDiff = offsetViewPos - viewPos;
|
||||
float viewPosDiffSquared = dot(viewPosDiff, viewPosDiff);
|
||||
|
||||
float threshHold = max(1.0 - viewPosDiffSquared/depthCancelation, 0.0);
|
||||
|
||||
if (viewPosDiffSquared > 1e-5){
|
||||
vec3 normViewPosDiff = normalize(viewPosDiff);
|
||||
float threshHold = max(1.0 - viewPosDiffSquared/depthCancelation, 0.0);
|
||||
|
||||
n += 1.0;
|
||||
float preAo = 1.0 - clamp(dot(normalize(viewPosDiff), flatnormal)*25.0,0.0,1.0);
|
||||
occlusion += max(0.0, dot(normalize(viewPosDiff), normal) - preAo) * threshHold;
|
||||
float preAo = 1.0 - clamp(dot(normViewPosDiff, flatnormal)*25.0,0.0,1.0);
|
||||
occlusion += max(0.0, dot(normViewPosDiff, normal) - preAo) * threshHold;
|
||||
|
||||
#ifdef Ambient_SSS
|
||||
#ifdef OLD_INDIRECT_SSS
|
||||
sss += clamp(-dot(normalize(viewPosDiff), flatnormal),0.0,1.0) * exp(-10*occlusion);
|
||||
sss += clamp(-dot(normViewPosDiff, flatnormal),0.0,1.0) * exp(-10*occlusion);
|
||||
#else
|
||||
sss += clamp(-dot(normalize(viewPosDiff), flatnormal) - occlusion/n,0.0,1.0) * 0.25 + (normalize(mat3(gbufferModelViewInverse) * -viewPosDiff).y - occlusion/n) * threshHold;
|
||||
sss += clamp(-dot(normViewPosDiff, flatnormal) - occlusion/n,0.0,1.0) * 0.25 + (normalize(mat3(gbufferModelViewInverse) * -viewPosDiff).y - occlusion/n) * threshHold;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -335,6 +343,11 @@ float ld(float dist) {
|
||||
return (2.0 * near) / (far + near - dist * (far - near));
|
||||
}
|
||||
|
||||
float LinearizeDepth(float depth, float near, float far) {
|
||||
float z = depth * 2.0 - 1.0;
|
||||
return (2.0 * near) / (far + near - z * (far - near));
|
||||
}
|
||||
|
||||
|
||||
#include "/lib/sky_gradient.glsl"
|
||||
|
||||
@@ -428,14 +441,23 @@ void main() {
|
||||
|
||||
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz;
|
||||
#ifdef END_SHADER
|
||||
vec3 WsunVec = normalize(END_LIGHT_POS-(feetPlayerPos+cameraPosition));
|
||||
#endif
|
||||
|
||||
float SpecularTex = texture2D(colortex8,texcoord).z;
|
||||
float LabSSS = clamp((-64.0 + SpecularTex * 255.0) / 191.0 ,0.0,1.0);
|
||||
|
||||
float NdotL = clamp(dot(normal,WsunVec),0.0,1.0);
|
||||
float vanillAO = clamp(texture2D(colortex15,texcoord).a,0.0,1.0) ;
|
||||
|
||||
float minshadowfilt = Min_Shadow_Filter_Radius;
|
||||
#ifdef END_SHADER
|
||||
float minshadowfilt = Min_Shadow_Filter_Radius_END;
|
||||
#else
|
||||
float minshadowfilt = Min_Shadow_Filter_Radius;
|
||||
#endif
|
||||
float maxshadowfilt = Max_Shadow_Filter_Radius;
|
||||
|
||||
if(lightmap.y < 0.1) maxshadowfilt = min(maxshadowfilt, minshadowfilt);
|
||||
@@ -453,37 +475,53 @@ void main() {
|
||||
|
||||
#ifdef Variable_Penumbra_Shadows
|
||||
// if (LabSSS > -1) {
|
||||
|
||||
vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz;
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos + shadowModelView[3].xyz;
|
||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
|
||||
// mat4 Custom_ViewMatrix = BuildShadowViewMatrix();
|
||||
// projectedShadowPosition = mat3(Custom_ViewMatrix) * feetPlayerPos + Custom_ViewMatrix[3].xyz;
|
||||
// projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
|
||||
//apply distortion
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
projectedShadowPosition.xy *= distortFactor;
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 projectedShadowPosition = mat3(customShadowMatrixSSBO) * feetPlayerPos + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * feetPlayerPos + shadowModelView[3].xyz;
|
||||
#endif
|
||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
|
||||
//apply distortion
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
projectedShadowPosition.xy *= distortFactor;
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
#ifdef END_SHADER
|
||||
vec4 shadowPos = customShadowMatrixSSBO * (gbufferModelViewInverse * vec4(viewPos, 1.0));
|
||||
shadowPos = customShadowPerspectiveSSBO * shadowPos;
|
||||
vec3 projectedShadowPosition = shadowPos.xyz / shadowPos.w;
|
||||
#endif
|
||||
|
||||
//do shadows only if on shadow map
|
||||
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.z) < 6.0 ){
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
projectedShadowPosition.z += shadowProjection[3].z * 0.0013;
|
||||
#endif
|
||||
|
||||
projectedShadowPosition.z += shadowProjection[3].z * 0.0013;
|
||||
|
||||
const float threshMul = max(2048.0/shadowMapResolution*shadowDistance/128.0,0.95);
|
||||
float distortThresh = (sqrt(1.0-NdotL*NdotL)/NdotL+0.7)/distortFactor;
|
||||
float diffthresh = distortThresh/6000.0*threshMul;
|
||||
|
||||
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5);
|
||||
//projectedShadowPosition.z = LinearizeDepth(projectedShadowPosition.z, 0.5, 256.0); // it should be linearized but I can't see a difference...
|
||||
|
||||
float mult = maxshadowfilt;
|
||||
float avgBlockerDepth = 0.0;
|
||||
vec2 scales = vec2(0.0, Max_Filter_Depth);
|
||||
#ifndef END_SHADER
|
||||
vec2 scales = vec2(0.0, Max_Filter_Depth);
|
||||
#else
|
||||
vec2 scales = vec2(0.0, Max_Filter_Depth_END);
|
||||
#endif
|
||||
float blockerCount = 0.0;
|
||||
float rdMul = distortFactor*(1.0+mult)*d0*k/shadowMapResolution;
|
||||
float diffthreshM = diffthresh*mult*d0*k/20.;
|
||||
@@ -497,6 +535,7 @@ void main() {
|
||||
float weight = 3.0 + (i+noise) *rdMul/SHADOW_FILTER_SAMPLE_COUNT*shadowMapResolution*distortFactor/2.7;
|
||||
|
||||
float d = texelFetch2D(shadow, ivec2((projectedShadowPosition.xy+offsetS*rdMul)*shadowMapResolution),0).x;
|
||||
//d = LinearizeDepth(d, 0.5, 256.0); // it should be linearized but I can't see a difference...
|
||||
float b = smoothstep(weight*diffthresh/2.0, weight*diffthresh, projectedShadowPosition.z - d);
|
||||
|
||||
blockerCount += b;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
flat varying vec2 TAA_Offset;
|
||||
flat varying vec3 WsunVec;
|
||||
|
||||
@@ -27,8 +31,14 @@ uniform int framemod8;
|
||||
void main() {
|
||||
gl_Position = ftransform();
|
||||
|
||||
WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 moonVec = customMoonVecSSBO;
|
||||
WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
WsunVec = mix(moonVec, WsunVec, float(sunElevation > 1e-5));
|
||||
// WsunVec = moonVec;
|
||||
#else
|
||||
WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
#endif
|
||||
|
||||
zMults = vec3(1.0/(far * near),far+near,far-near);
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT
|
||||
#include "/lib/SSBOs.glsl
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
uniform sampler2D CoronaTex;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// #if defined END_SHADER || defined NETHER_SHADER
|
||||
// #undef IS_LPV_ENABLED
|
||||
// #endifs
|
||||
@@ -20,7 +28,7 @@ uniform float nightVision;
|
||||
uniform float frameTimeCounter;
|
||||
uniform float rainStrength;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
const bool shadowHardwareFiltering = true;
|
||||
uniform sampler2DShadow shadow;
|
||||
|
||||
@@ -71,9 +79,10 @@ uniform float rainStrength;
|
||||
#endif
|
||||
|
||||
#ifdef END_SHADER
|
||||
uniform vec3 lightningEffect;
|
||||
|
||||
#include "/lib/stars.glsl"
|
||||
#ifndef END_ISLAND_LIGHT
|
||||
uniform vec3 lightningEffect;
|
||||
#include "/lib/stars.glsl"
|
||||
#endif
|
||||
|
||||
flat varying float Flashing;
|
||||
#undef LIGHTSOURCE_REFLECTION
|
||||
@@ -145,7 +154,9 @@ uniform int isEyeInWater;
|
||||
uniform ivec2 eyeBrightnessSmooth;
|
||||
|
||||
uniform vec3 sunVec;
|
||||
flat varying vec3 WsunVec;
|
||||
#if !defined END_ISLAND_LIGHT || !defined END_SHADER
|
||||
flat varying vec3 WsunVec;
|
||||
#endif
|
||||
flat varying vec3 unsigned_WsunVec;
|
||||
flat varying vec3 WmoonVec;
|
||||
flat varying float exposure;
|
||||
@@ -636,7 +647,7 @@ vec4 BilateralUpscale_VLFOG(sampler2D tex, sampler2D depth, float referenceDepth
|
||||
return colorSum/edgeSum;
|
||||
}
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
|
||||
vec3 ComputeShadowMap_COLOR(in vec3 projectedShadowPosition, float distortFactor, float noise, float shadowBlockerDepth, float NdotL, float maxDistFade, vec3 directLightColor, inout float FUNNYSHADOW, inout vec3 tintedSunlight, bool isSSS ,inout float shadowDebug){
|
||||
|
||||
@@ -666,8 +677,8 @@ vec3 ComputeShadowMap_COLOR(in vec3 projectedShadowPosition, float distortFactor
|
||||
translucentShadow.rgb = normalize(translucentShadow.rgb*translucentShadow.rgb + 0.0001) * (1.0-shadowAlpha);
|
||||
|
||||
// translucentTint += mix(translucentShadow.rgb * mix(opaqueShadowT, 1.0, backface), vec3(1.0), max(opaqueShadow, backface * (shadowAlpha < 1.0 ? 0.0 : 1.0)));
|
||||
|
||||
shadowColor += directLightColor * mix(translucentShadow.rgb * opaqueShadowT, vec3(1.0), opaqueShadow);
|
||||
// shadowColor += directLightColor * mix(translucentShadow.rgb * opaqueShadowT, vec3(1.0), opaqueShadow);
|
||||
shadowColor += mix(translucentShadow.rgb * opaqueShadowT, vec3(1.0), opaqueShadow);
|
||||
|
||||
translucentTint += mix(translucentShadow.rgb, vec3(1.0), max(opaqueShadow, backface * (shadowAlpha < 1.0 ? 0.0 : 1.0)));
|
||||
FUNNYSHADOW += ((1.0-shadowAlpha) * opaqueShadowT)/samples;
|
||||
@@ -969,6 +980,11 @@ void main() {
|
||||
slopednormal = normalize(clamp(normal, ApproximatedFlatNormal*2.0 - 1.0, ApproximatedFlatNormal*2.0 + 1.0) );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined END_SHADER && defined END_ISLAND_LIGHT
|
||||
vec3 WsunVec = normalize(END_LIGHT_POS-(feetPlayerPos+cameraPosition));
|
||||
#endif
|
||||
|
||||
////// --------------- COLORS --------------- //////
|
||||
|
||||
vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);
|
||||
@@ -991,7 +1007,11 @@ void main() {
|
||||
|
||||
vec3 shadowColor = vec3(1.0);
|
||||
vec3 SSSColor = vec3(1.0);
|
||||
vec3 filteredShadow = vec3(Min_Shadow_Filter_Radius,1.0,0.0);
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
vec3 filteredShadow = vec3(Min_Shadow_Filter_Radius_END,1.0,0.0);
|
||||
#else
|
||||
vec3 filteredShadow = vec3(Min_Shadow_Filter_Radius,1.0,0.0);
|
||||
#endif
|
||||
|
||||
float NdotL = 1.0;
|
||||
float lightLeakFix = clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0);
|
||||
@@ -999,15 +1019,33 @@ void main() {
|
||||
#ifdef OVERWORLD_SHADER
|
||||
DirectLightColor = lightCol.rgb / 2400.0;
|
||||
AmbientLightColor = averageSkyCol_Clouds / 900.0;
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION && LIGHTNING_SHADOWS > 0
|
||||
#if LIGHTNING_SHADOWS < 2
|
||||
if (lightningBoltPosition.w > 0.0 && sunElevation < 0.0)
|
||||
#else
|
||||
if (lightningBoltPosition.w > 0.0)
|
||||
#endif
|
||||
{
|
||||
vec3 lightningColor = vec3(2.0, 4.5, 6.6) * lightningFlash;
|
||||
DirectLightColor += lightningColor * smoothstep(500.0, 0.0, length(feetPlayerPos-lightningBoltPosition.xyz));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_CUSTOM_DIFFUSE_LIGHTING_COLORS
|
||||
DirectLightColor.rgb = luma(DirectLightColor.rgb) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
DirectLightColor = luma(DirectLightColor) * vec3(DIRECTLIGHT_DIFFUSE_R,DIRECTLIGHT_DIFFUSE_G,DIRECTLIGHT_DIFFUSE_B);
|
||||
AmbientLightColor = luma(AmbientLightColor) * vec3(INDIRECTLIGHT_DIFFUSE_R,INDIRECTLIGHT_DIFFUSE_G,INDIRECTLIGHT_DIFFUSE_B);
|
||||
#endif
|
||||
|
||||
shadowColor = DirectLightColor;
|
||||
|
||||
bool inShadowmapBounds = false;
|
||||
//bool inShadowmapBounds = false;
|
||||
#endif
|
||||
|
||||
#if defined END_SHADER && defined END_ISLAND_LIGHT
|
||||
DirectLightColor = 0.55*vec3(AmbientLightEnd_R,AmbientLightEnd_G*0.6,AmbientLightEnd_B*0.8);
|
||||
|
||||
shadowColor = DirectLightColor;
|
||||
#endif
|
||||
|
||||
MinimumLightColor = MinimumLightColor + 0.7 * MinimumLightColor * dot(slopednormal, feetPlayerPos_normalized);
|
||||
@@ -1084,12 +1122,12 @@ void main() {
|
||||
///////////////////////////// MAJOR LIGHTSOURCE STUFF ////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
|
||||
float LM_shadowMapFallback = clamp(lightmap.y, 0.0,1.0);
|
||||
// float LM_shadowMapFallback = clamp(lightmap.y, 0.0,1.0);
|
||||
|
||||
float LightningPhase = 0.0;
|
||||
vec3 LightningFlashLighting = Iris_Lightningflash(feetPlayerPos, lightningBoltPosition.xyz, slopednormal, LightningPhase) * pow(lightmap.y,10);
|
||||
//float LightningPhase = 0.0;
|
||||
//vec3 LightningFlashLighting = Iris_Lightningflash(feetPlayerPos, lightningBoltPosition.xyz, slopednormal, LightningPhase) * pow(lightmap.y,10);
|
||||
|
||||
NdotL = clamp((-15 + dot(slopednormal, WsunVec)*255.0) / 240.0 ,0.0,1.0);
|
||||
|
||||
@@ -1113,27 +1151,55 @@ void main() {
|
||||
if(!hand) GriAndEminShadowFix(shadowPlayerPos, FlatNormals, vanilla_AO, lightmap.y, lightLeakFix);
|
||||
#endif
|
||||
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * shadowPlayerPos + shadowModelView[3].xyz;
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 projectedShadowPosition = mat3(customShadowMatrixSSBO) * shadowPlayerPos + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
vec3 projectedShadowPosition = mat3(shadowModelView) * shadowPlayerPos + shadowModelView[3].xyz;
|
||||
#endif
|
||||
|
||||
applyShadowBias(projectedShadowPosition, shadowPlayerPos, FlatNormals);
|
||||
applyShadowBias(projectedShadowPosition, shadowPlayerPos, FlatNormals);
|
||||
projectedShadowPosition = diagonal3_old(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
|
||||
projectedShadowPosition = diagonal3_old(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
||||
// Calclulate distortion factor before bias application
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
projectedShadowPosition.xy *= distortFactor;
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
// Calclulate distortion factor before bias application
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
||||
projectedShadowPosition.xy *= distortFactor;
|
||||
projectedShadowPosition.z += shadowProjection[3].z * 0.0012;
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
projectedShadowPosition.z += shadowProjection[3].z * 0.0012;
|
||||
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
vec4 shadowPos = customShadowMatrixSSBO * (gbufferModelViewInverse * vec4(viewPos, 1.0));
|
||||
applyShadowBias(shadowPos.xyz, shadowPlayerPos, FlatNormals);
|
||||
shadowPos = customShadowPerspectiveSSBO * shadowPos;
|
||||
vec3 projectedShadowPosition = shadowPos.xyz / shadowPos.w;
|
||||
#endif
|
||||
|
||||
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5) ;
|
||||
|
||||
float ShadowAlpha = 0.0; // this is for subsurface scattering later.
|
||||
vec3 tintedSunlight = DirectLightColor; // this is for subsurface scattering later.
|
||||
|
||||
shadowColor = ComputeShadowMap_COLOR(projectedShadowPosition, distortFactor, noise_2, filteredShadow.x, flatNormNdotL, shadowMapFalloff, DirectLightColor, ShadowAlpha, tintedSunlight, LabSSS > 0.0,Shadows);
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
// make light fade out
|
||||
float r = length(projectedShadowPosition.xy - vec2(0.5));
|
||||
|
||||
if (r < 0.5 && abs(projectedShadowPosition.z) < 1.0) {
|
||||
shadowColor = ComputeShadowMap_COLOR(projectedShadowPosition, distortFactor, noise_2, filteredShadow.x, flatNormNdotL, shadowMapFalloff, DirectLightColor, ShadowAlpha, tintedSunlight, LabSSS > 0.0,Shadows);
|
||||
shadowColor *= smoothstep(0.5, 0.25, r);
|
||||
} else {
|
||||
shadowColor = vec3(0.0);
|
||||
}
|
||||
|
||||
#else
|
||||
shadowColor = ComputeShadowMap_COLOR(projectedShadowPosition, distortFactor, noise_2, filteredShadow.x, flatNormNdotL, shadowMapFalloff, DirectLightColor, ShadowAlpha, tintedSunlight, LabSSS > 0.0,Shadows);
|
||||
#endif
|
||||
|
||||
// transition to fallback lightmap shadow mask.
|
||||
// shadowColor *= mix(isWater ? lightLeakFix : LM_shadowMapFallback, 1.0, shadowMapFalloff2);
|
||||
@@ -1154,7 +1220,7 @@ void main() {
|
||||
if(entities) sunSSS_density = 0.0;
|
||||
#endif
|
||||
|
||||
#ifdef SCREENSPACE_CONTACT_SHADOWS
|
||||
#if defined SCREENSPACE_CONTACT_SHADOWS && !defined END_SHADER
|
||||
vec2 SS_directLight = SSRT_Shadows(toScreenSpace_DH(texcoord/RENDER_SCALE, z, DH_depth1), isDHrange, normalize(WsunVec*mat3(gbufferModelViewInverse)), interleaved_gradientNoise_temporal(), sunSSS_density > 0.0 && shadowMapFalloff2 < 1.0, hand);
|
||||
|
||||
// combine shadowmap with screenspace shadows.
|
||||
@@ -1172,13 +1238,16 @@ void main() {
|
||||
#endif
|
||||
|
||||
// TODO CHECK IF *= OR =
|
||||
SSSColor = SubsurfaceScattering_sun(albedo, ShadowBlockerDepth, sunSSS_density, clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), SS_directLight.g, shadowMapFalloff2, hand);
|
||||
// *= looks better idk
|
||||
SSSColor *= SubsurfaceScattering_sun(albedo, ShadowBlockerDepth, sunSSS_density, clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), SS_directLight.g, shadowMapFalloff2, hand);
|
||||
|
||||
if(isEyeInWater != 1) SSSColor *= lightLeakFix;
|
||||
|
||||
float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec);
|
||||
shadowColor *= cloudShadows;
|
||||
SSSColor *= cloudShadow*cloudShadows;
|
||||
#ifndef END_SHADER
|
||||
float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec);
|
||||
shadowColor *= cloudShadows;
|
||||
SSSColor *= cloudShadow*cloudShadows;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1361,7 +1430,7 @@ void main() {
|
||||
#if defined END_SHADER
|
||||
Direct_lighting *= AO;
|
||||
#endif
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
|
||||
|
||||
#ifdef AO_in_sunlight
|
||||
@@ -1414,6 +1483,29 @@ void main() {
|
||||
#endif
|
||||
|
||||
#if !defined ambientLight_only && (RESOURCEPACK_SKY == 1 || RESOURCEPACK_SKY == 0)
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
float sunMoonDist = length(unsigned_WsunVec - WmoonVec);
|
||||
if (sunMoonDist < 0.004){
|
||||
vec3 tangent2 = normalize(cross(unsigned_WsunVec, vec3(0.0, 1.0, 0.0)));
|
||||
vec3 binormal2 = cross(unsigned_WsunVec, tangent2);
|
||||
vec3 dirDiff2 = worldDir - unsigned_WsunVec;
|
||||
|
||||
float u2 = dot(dirDiff2, tangent2);
|
||||
float v2 = dot(dirDiff2, binormal2);
|
||||
|
||||
float sunAngularRadius = acos(0.9984);
|
||||
|
||||
u2 = u2 / (2.0 * sunAngularRadius) + 0.5;
|
||||
v2 = -v2 / (1.96 * sunAngularRadius) + 0.505;
|
||||
|
||||
if (u2 > 0.0 && u2 < 1.0 && v2 > 0.0 && v2 < 1.0) {
|
||||
vec2 coronaUV = vec2(u2, v2);
|
||||
vec3 coronaTex = texture2D(CoronaTex, coronaUV).rgb;
|
||||
Background += 0.5 * coronaTex * coronaTex * coronaTex * coronaTex * coronaTex * smoothstep(0.004, 0.0002, sunMoonDist);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Background += drawSun(dot(unsigned_WsunVec, feetPlayerPos_normalized), sunCol / 2400.0);
|
||||
|
||||
#ifdef REALMOON
|
||||
@@ -1424,32 +1516,50 @@ void main() {
|
||||
float u = dot(dirDiff, tangent);
|
||||
float v = dot(dirDiff, binormal);
|
||||
|
||||
float moonAngularRadius = acos(0.9992);
|
||||
float moonSize = MOON_SIZE;
|
||||
float moonAngularRadius = acos(moonSize);
|
||||
|
||||
u = u / (2.0 * moonAngularRadius) + 0.5;
|
||||
v = -v / (2.0 * moonAngularRadius) + 0.5;
|
||||
vec2 moonUV = vec2(u, v);
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 moonTex = texture2D(moon, sphereMap(moonUV)).rgb;
|
||||
float moonVis = smoothstep(0.08, -0.03, WmoonVec.y);
|
||||
|
||||
float moonVis = smoothstep(0.12, -0.03, -sunElevation);
|
||||
float moonphaseMult = 1.0;
|
||||
#ifdef MOONPHASE_BASED_MOONLIGHT
|
||||
float[8] phase = float[8](
|
||||
1.0,
|
||||
smoothstep(0.85, 0.65, u + pow(abs(0.8*(v-0.5)), 2.0)),
|
||||
smoothstep(0.6, 0.4, u),
|
||||
smoothstep(0.35, 0.15, u - pow(abs(0.8*(v-0.5)), 2.0)),
|
||||
0.0,
|
||||
smoothstep(0.65, 0.85, u + pow(abs(0.8*(v-0.5)), 2.0)),
|
||||
smoothstep(0.4, 0.6, u),
|
||||
smoothstep(0.15, 0.35, u - pow(abs(0.8*(v-0.5)), 2.0))
|
||||
);
|
||||
vec2 pos = 2.0 * moonUV - 1.0;
|
||||
float r2 = dot(pos, pos); // we got 'em r2
|
||||
|
||||
moonphaseMult = phase[moonPhase];
|
||||
vec3 moonDirLocal = normalize(vec3(pos.x, pos.y, sqrt(1.0 - r2)));
|
||||
|
||||
vec3 moonDirWorld = moonDirLocal.x * tangent - moonDirLocal.y * binormal - moonDirLocal.z * WmoonVec;
|
||||
|
||||
float sunLight = dot(normalize(moonDirWorld), unsigned_WsunVec);
|
||||
float mask = smoothstep(-0.2, 0.12, sunLight);
|
||||
|
||||
moonTex *= (1.0 - vec3(0.0, 0.5, 0.7)*clamp((1.0-0.5*v)*moonVis, 0.0, 1.0)) * mask;
|
||||
#else
|
||||
float moonVis = smoothstep(0.12, -0.03, -moonElevation);
|
||||
float moonphaseMult = 1.0;
|
||||
#ifdef MOONPHASE_BASED_MOONLIGHT
|
||||
float[8] phase = float[8](
|
||||
1.0,
|
||||
smoothstep(0.85, 0.65, u + pow(abs(0.8*(v-0.5)), 2.0)),
|
||||
smoothstep(0.6, 0.4, u),
|
||||
smoothstep(0.35, 0.15, u - pow(abs(0.8*(v-0.5)), 2.0)),
|
||||
0.0,
|
||||
smoothstep(0.65, 0.85, u + pow(abs(0.8*(v-0.5)), 2.0)),
|
||||
smoothstep(0.4, 0.6, u),
|
||||
smoothstep(0.15, 0.35, u - pow(abs(0.8*(v-0.5)), 2.0))
|
||||
);
|
||||
|
||||
moonphaseMult = phase[moonPhase];
|
||||
#endif
|
||||
vec3 moonTex = (1 - vec3(0.0, 0.5, 0.7)*clamp((1-0.5*v)*moonVis, 0.0, 1.0)) * moonphaseMult * texture2D(moon, sphereMap(moonUV)).rgb;
|
||||
#endif
|
||||
vec3 moonTex = (1 - vec3(0.0, 0.5, 0.7)*clamp((1-0.5*v)*moonVis, 0.0, 1.0)) * moonphaseMult * texture2D(moon, sphereMap(moonUV)).rgb;
|
||||
|
||||
vec3 moonLightCol = moonColorBase2;
|
||||
Background += pow(moonTex, vec3(3.2)) * 20.0 * drawRealMoon(feetPlayerPos_normalized, WmoonVec, moonLightCol, Background);
|
||||
Background += pow(moonTex, vec3(3.2)) * 20.0 * drawRealMoon(feetPlayerPos_normalized, WmoonVec, moonLightCol, Background, moonSize);
|
||||
#else
|
||||
vec3 moonLightCol = moonCol / 2400.0;
|
||||
Background += drawMoon(feetPlayerPos_normalized, WmoonVec, moonLightCol, Background);
|
||||
@@ -1504,7 +1614,7 @@ void main() {
|
||||
gl_FragData[0].rgb = vec3(1.0) * (Shadows * NdotL * 0.9 + 0.1);
|
||||
|
||||
if(dot(feetPlayerPos_normalized, unsigned_WsunVec) > 0.999 ) gl_FragData[0].rgb = vec3(10,10,0);
|
||||
if(dot(feetPlayerPos_normalized, -WmoonVec) > 0.999 ) gl_FragData[0].rgb = vec3(1,1,10);
|
||||
if(dot(feetPlayerPos_normalized, WmoonVec) > 0.999 ) gl_FragData[0].rgb = vec3(1,1,10);
|
||||
#endif
|
||||
#if DEBUG_VIEW == debug_NORMALS
|
||||
if(swappedDepth >= 1.0) Direct_lighting = vec3(1.0);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef END_SHADER
|
||||
flat varying float Flashing;
|
||||
#endif
|
||||
@@ -64,15 +68,21 @@ void main() {
|
||||
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
||||
|
||||
unsigned_WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 moonVec = customMoonVecSSBO;
|
||||
//sunCol *= smoothstep(0.005, 0.09, length(moonVec - unsigned_WsunVec));
|
||||
#else
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
if(dot(-moonVec, unsigned_WsunVec) < 0.9999) moonVec = -moonVec;
|
||||
#endif
|
||||
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
|
||||
WmoonVec = moonVec;
|
||||
|
||||
if(dot(-moonVec, unsigned_WsunVec) < 0.9999) WmoonVec = -moonVec;
|
||||
|
||||
WsunVec = mix(WmoonVec, unsigned_WsunVec, clamp(lightCol.a,0,1));
|
||||
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION && LIGHTNING_SHADOWS > 0
|
||||
WmoonVec = customMoonVec2SSBO;
|
||||
#endif
|
||||
|
||||
exposure = texelFetch2D(colortex4,ivec2(10,37),0).r;
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
#define EXCLUDE_WRITE_TO_LUT
|
||||
|
||||
flat varying vec4 lightCol;
|
||||
@@ -304,7 +308,7 @@ vec4 waterVolumetrics(vec3 rayStart, vec3 rayEnd, float rayLength, vec2 dither,
|
||||
vec3 spPos = start.xyz + dV*d;
|
||||
|
||||
//project into biased shadowmap space
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
#ifdef DISTORT_SHADOWMAP && defined OVERWORLD_SHADER
|
||||
float distortFactor = calcDistort(spPos.xy);
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
@@ -528,6 +532,11 @@ void main() {
|
||||
vec3 directLightColor = lightCol.rgb / 2400.0;
|
||||
vec3 directSunlightColor = sunlightCol / 2400.0;
|
||||
vec3 directMoonlightColor = moonlightCol / 2400.0;
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
directMoonlightColor *= mix(0.0, 1.0, clamp(WmoonVec.y + 0.05, 0.0, 0.1)/0.1);
|
||||
#endif
|
||||
|
||||
vec3 indirectLightColor = averageSkyCol / 1200.0;
|
||||
vec3 indirectLightColor_dynamic = averageSkyCol_Clouds / 1200.0;
|
||||
float cloudPlaneDistance = 0.0;
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
#include "/lib/util.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
flat varying vec4 lightCol;
|
||||
flat varying vec3 sunlightCol;
|
||||
flat varying vec3 moonlightCol;
|
||||
@@ -77,9 +81,19 @@ void main() {
|
||||
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
||||
WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#if LIGHTNING_SHADOWS > 0
|
||||
vec3 moonVec = customMoonVec2SSBO;
|
||||
#else
|
||||
vec3 moonVec = customMoonVecSSBO;
|
||||
#endif
|
||||
sunlightCol *= smoothstep(0.005, 0.09, length(moonVec - WsunVec));
|
||||
#else
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
if(dot(-moonVec, WsunVec) < 0.9999) moonVec = -moonVec;
|
||||
#endif
|
||||
|
||||
WmoonVec = moonVec;
|
||||
if(dot(-moonVec, WsunVec) < 0.9999) WmoonVec = -moonVec;
|
||||
|
||||
WrealSunVec = WsunVec;
|
||||
WsunVec = mix(WmoonVec, WsunVec, clamp(lightCol.a,0,1));
|
||||
|
||||
+271
-344
@@ -39,6 +39,8 @@ uniform vec2 texelSize;
|
||||
uniform float viewHeight;
|
||||
uniform float viewWidth;
|
||||
uniform float nightVision;
|
||||
uniform float fogEnd;
|
||||
uniform vec3 fogColor;
|
||||
uniform vec3 sunVec;
|
||||
uniform float frameTimeCounter;
|
||||
uniform int frameCounter;
|
||||
@@ -297,30 +299,6 @@ vec3 toClipSpace3Prev(vec3 viewSpacePosition) {
|
||||
return projMAD(gbufferPreviousProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
vec3 closestToCamera5taps(vec2 texcoord, sampler2D depth)
|
||||
{
|
||||
vec2 du = vec2(texelSize.x*2., 0.0);
|
||||
vec2 dv = vec2(0.0, texelSize.y*2.);
|
||||
|
||||
vec3 dtl = vec3(texcoord,0.) + vec3(-texelSize, texture2D(depth, texcoord - dv - du).x);
|
||||
vec3 dtr = vec3(texcoord,0.) + vec3( texelSize.x, -texelSize.y, texture2D(depth, texcoord - dv + du).x);
|
||||
vec3 dmc = vec3(texcoord,0.) + vec3( 0.0, 0.0, texture2D(depth, texcoord).x);
|
||||
vec3 dbl = vec3(texcoord,0.) + vec3(-texelSize.x, texelSize.y, texture2D(depth, texcoord + dv - du).x);
|
||||
vec3 dbr = vec3(texcoord,0.) + vec3( texelSize.x, texelSize.y, texture2D(depth, texcoord + dv + du).x);
|
||||
|
||||
vec3 dmin = dmc;
|
||||
dmin = dmin.z > dtr.z ? dtr : dmin;
|
||||
dmin = dmin.z > dtl.z ? dtl : dmin;
|
||||
dmin = dmin.z > dbl.z ? dbl : dmin;
|
||||
dmin = dmin.z > dbr.z ? dbr : dmin;
|
||||
|
||||
#ifdef TAA_UPSCALING
|
||||
dmin.xy = dmin.xy/RENDER_SCALE;
|
||||
#endif
|
||||
|
||||
return dmin;
|
||||
}
|
||||
|
||||
vec3 toClipSpace3Prev_DH( vec3 viewSpacePosition, bool depthCheck ) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
@@ -331,35 +309,6 @@ vec3 toClipSpace3Prev_DH( vec3 viewSpacePosition, bool depthCheck ) {
|
||||
#endif
|
||||
}
|
||||
|
||||
vec3 toScreenSpace_DH_special(vec3 POS, bool depthCheck ) {
|
||||
|
||||
vec4 viewPos = vec4(0.0);
|
||||
vec3 feetPlayerPos = vec3(0.0);
|
||||
vec4 iProjDiag = vec4(0.0);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
if (depthCheck) {
|
||||
iProjDiag = vec4(dhProjectionInverse[0].x, dhProjectionInverse[1].y, dhProjectionInverse[2].zw);
|
||||
|
||||
feetPlayerPos = POS * 2.0 - 1.0;
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + dhProjectionInverse[3];
|
||||
viewPos.xyz /= viewPos.w;
|
||||
|
||||
} else {
|
||||
#endif
|
||||
iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw);
|
||||
|
||||
feetPlayerPos = POS * 2.0 - 1.0;
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + gbufferProjectionInverse[3];
|
||||
viewPos.xyz /= viewPos.w;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
}
|
||||
#endif
|
||||
|
||||
return viewPos.xyz;
|
||||
}
|
||||
|
||||
vec4 bilateralUpsample(out float outerEdgeResults, float referenceDepth, sampler2D depth, bool hand){
|
||||
|
||||
vec4 colorSum = vec4(0.0);
|
||||
@@ -458,12 +407,99 @@ vec4 VLTemporalFiltering(vec3 viewPos, in float referenceDepth, sampler2D depth,
|
||||
|
||||
uniform float waterEnteredAltitude;
|
||||
|
||||
#define CAVE_FOG_DARKEN_SKY
|
||||
|
||||
void blendAllFogTypes( inout vec3 color, inout float bloomyFogMult, vec4 volumetrics, float linearDistance, vec3 playerPos, vec3 cameraPosition, bool isSky, bool isLightning){
|
||||
|
||||
// blend cave fog
|
||||
#if defined OVERWORLD_SHADER && defined CAVE_FOG
|
||||
if (isEyeInWater == 0 && eyeAltitude < 1500){
|
||||
vec3 cavefogCol = vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B) * 0.3;
|
||||
cavefogCol *= 1.0-pow(1.0-pow(1.0 - max(1.0 - linearDistance/far,0),2),CaveFogFallOff);
|
||||
cavefogCol *= exp(-7.0*clamp(playerPos.y*0.5+0.5,0,1)) * 0.999 + 0.001;
|
||||
|
||||
float skyhole = pow(clamp(1.0-pow(max(playerPos.y - 0.6,0.0)*5.0,2.0),0.0,1.0),2);
|
||||
|
||||
#if (CAVE_DETECTION == 0.0) || (CAVE_DETECTION == 1.0)
|
||||
#if (CAVE_DETECTION == 1.0)
|
||||
float caveFactor = 1-smoothstep(60.0, 63.0, cameraPosition.y);
|
||||
#else
|
||||
float caveFactor = 1.0;
|
||||
#endif
|
||||
#else
|
||||
float caveFactor = 0.0;
|
||||
#endif
|
||||
|
||||
color.rgb = mix(color.rgb + cavefogCol * caveDetection, cavefogCol, isSky ? skyhole * caveDetection * caveFactor: 0.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// water absorption; it is completed when volumetrics are blended.
|
||||
if(isEyeInWater == 1){
|
||||
vec3 totEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);
|
||||
vec3 scatterCoef = Dirt_Amount * vec3(Dirt_Scatter_R, Dirt_Scatter_G, Dirt_Scatter_B) / 3.14;
|
||||
|
||||
float distanceFromWaterSurface = playerPos.y + 1.0 + (cameraPosition.y - waterEnteredAltitude)/waterEnteredAltitude;
|
||||
distanceFromWaterSurface = clamp(distanceFromWaterSurface,0,1);
|
||||
|
||||
vec3 transmittance = exp(-totEpsilon * linearDistance);
|
||||
color.rgb *= transmittance;
|
||||
|
||||
vec3 transmittance2 = exp(-totEpsilon * 50.0);
|
||||
float fogfade = 1.0 - max((1.0 - linearDistance / min(far, 16.0*7.0) ),0);
|
||||
color.rgb += (transmittance2 * scatterCoef) * fogfade;
|
||||
|
||||
bloomyFogMult *= 0.5;
|
||||
}
|
||||
|
||||
/// blend volumetrics
|
||||
if(!isLightning) color = color * volumetrics.a;
|
||||
color += volumetrics.rgb;
|
||||
|
||||
// make bloomy fog only work outside of the overworld (unless underwater)
|
||||
#if !defined OVERWORLD_SHADER
|
||||
bloomyFogMult *= volumetrics.a;
|
||||
#endif
|
||||
|
||||
// blend vanilla fogs (blindness, darkness, lava, powdered snow)
|
||||
if(isEyeInWater > 1 || blindness > 0 || darknessFactor > 0){
|
||||
float enviornmentFogDensity = 1.0 - clamp(linearDistance/fogEnd,0,1);
|
||||
enviornmentFogDensity = 1.0 - enviornmentFogDensity*enviornmentFogDensity;
|
||||
enviornmentFogDensity *= enviornmentFogDensity;
|
||||
enviornmentFogDensity = mix(enviornmentFogDensity, 1.0, min(darknessLightFactor*2.0,1));
|
||||
|
||||
color = mix(color, toLinear(fogColor), enviornmentFogDensity);
|
||||
}
|
||||
}
|
||||
|
||||
void blendForwardRendering( inout vec3 color, vec4 translucentShader ){
|
||||
// REMEMBER that forward rendered color is written as color.rgb/10.0, invert it.
|
||||
if(translucentShader.a > 0) {
|
||||
color = color * (1.0 - translucentShader.a) + translucentShader.rgb * 10.0;
|
||||
}
|
||||
}
|
||||
|
||||
float getBorderFogDensity(float linearDistance, vec3 playerPos, bool sky){
|
||||
|
||||
if(sky) return 0.0;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float borderFogDensity = smoothstep(1.0, 0.0, min(max(1.0 - linearDistance / dhRenderDistance,0.0)*3.0,1.0) );
|
||||
#else
|
||||
float borderFogDensity = smoothstep(1.0, 0.0, min(max(1.0 - linearDistance / far,0.0)*3.0,1.0) );
|
||||
#endif
|
||||
|
||||
borderFogDensity *= exp(-10.0 * pow(clamp(playerPos.y,0.0,1.0)*4.0,2.0));
|
||||
borderFogDensity *= (1.0-caveDetection);
|
||||
|
||||
return borderFogDensity;
|
||||
}
|
||||
|
||||
void main() {
|
||||
/* RENDERTARGETS:7,3,10 */
|
||||
|
||||
////// --------------- SETUP STUFF --------------- //////
|
||||
vec2 texcoord = gl_FragCoord.xy*texelSize;
|
||||
|
||||
float depth = texelFetch2D(depthtex0, ivec2(gl_FragCoord.xy),0).x;
|
||||
bool hand = depth < 0.56;
|
||||
float z = depth;
|
||||
@@ -491,16 +527,18 @@ void main() {
|
||||
float DH_depth0 = 0.0;
|
||||
#endif
|
||||
|
||||
bool isSky = swappedDepth >= 1.0;
|
||||
|
||||
vec3 viewPos = toScreenSpace_DH(texcoord/RENDER_SCALE, z, DH_depth0);
|
||||
vec3 playerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz;
|
||||
|
||||
vec3 playerPos_normalized = normVec(playerPos);
|
||||
float linearDistance = length(playerPos);
|
||||
float linearDistance_cylinder = length(playerPos.xz);
|
||||
vec3 playerPos_normalized = normalize(playerPos);
|
||||
|
||||
vec3 viewPos_alt = toScreenSpace(vec3(texcoord/RENDER_SCALE, z2));
|
||||
vec3 playerPos_alt = mat3(gbufferModelViewInverse) * viewPos_alt + gbufferModelViewInverse[3].xyz;
|
||||
|
||||
float linearDistance = length(playerPos);
|
||||
float linearDistance_cylinder = length(playerPos.xz);
|
||||
float linearDistance_cylinder_alt = length(playerPos_alt.xz);
|
||||
|
||||
float lightleakfix = clamp(pow(eyeBrightnessSmooth.y/240.,2) ,0.0,1.0);
|
||||
float lightleakfixfast = clamp(eyeBrightness.y/240.,0.0,1.0);
|
||||
@@ -537,317 +575,206 @@ void main() {
|
||||
////// --------------- get volumetrics
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_mixedLinearZ = sqrt(texelFetch2D(colortex12,ivec2(gl_FragCoord.xy),0).a/65000.0);
|
||||
vec4 temporallyFilteredVL = VLTemporalFiltering(viewPos, DH_mixedLinearZ, colortex12, hand);
|
||||
vec4 temporallyFilteredVL = VLTemporalFiltering(viewPos, DH_mixedLinearZ, colortex12,hand);
|
||||
#else
|
||||
vec4 temporallyFilteredVL = VLTemporalFiltering(viewPos, frDepth, depthtex0, hand);
|
||||
#endif
|
||||
|
||||
gl_FragData[2] = temporallyFilteredVL;
|
||||
|
||||
|
||||
float bloomyFogMult = 1.0;
|
||||
|
||||
////// --------------- MAIN COLOR BUFFER
|
||||
////// --------------- distort texcoords as a refraction effect
|
||||
vec2 refractedCoord = texcoord;
|
||||
|
||||
////// --------------- MAIN COLOR BUFFER
|
||||
#ifdef FAKE_REFRACTION_EFFECT
|
||||
// ApplyDistortion(refractedCoord, tangentNormals, linearDistance, isEntity);
|
||||
// vec3 color = texture2D(colortex3, refractedCoord).rgb;
|
||||
vec3 color = doRefractionEffect(refractedCoord, tangentNormals.xy, linearDistance, isReflectiveEntity, isWater && isEyeInWater == 1);
|
||||
#else
|
||||
// vec3 color = texture2D(colortex3, refractedCoord).rgb;
|
||||
vec3 color = texelFetch2D(colortex3, ivec2(refractedCoord/texelSize),0).rgb;
|
||||
vec3 color = texture2D(colortex3, refractedCoord).rgb;
|
||||
#endif
|
||||
|
||||
////// --------------- lightning effect
|
||||
|
||||
bool isLightning = false;
|
||||
|
||||
#if defined OVERWORLD_SHADER && defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 && defined VOLUMETRIC_CLOUDS
|
||||
|
||||
vec2 cloudDepth = imageLoad(cloudDepthTex, ivec2(gl_FragCoord.xy*VL_RENDER_RESOLUTION*RENDER_SCALE)).rg;
|
||||
|
||||
vec3 lightningpos = vec3(getLightningPosition(600, 4680));
|
||||
//lightningpos = vec3(0,0,1);
|
||||
|
||||
float lightningDist = length(lightningpos);
|
||||
|
||||
if ((lightningDist < cloudDepth.r || cloudDepth.r == 0.0) && (thunderStrength > 0.0 || rainStrength == 0.0)) {
|
||||
vec2 tc = (gl_FragCoord.xy - 0.5)*texelSize;
|
||||
|
||||
float depth = z;
|
||||
|
||||
float z0 = depth < 0.56 ? convertHandDepth(depth) : depth;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = DH_depth0;
|
||||
#else
|
||||
float DH_z0 = 1.0;
|
||||
#endif
|
||||
|
||||
float uvScalar = 3.0 * CUSTOM_LIGHTNING_SCALE;
|
||||
|
||||
vec3 normLightningpos = normalize(lightningpos);
|
||||
|
||||
vec3 worldDir = normalize(mat3(gbufferModelViewInverse) * toScreenSpace(vec3(texcoord /RENDER_SCALE,1.0)));
|
||||
|
||||
vec3 tangent = normalize(cross(normLightningpos, vec3(0.0, 1.0, 0.0)));
|
||||
vec3 binormal = cross(normLightningpos, tangent);
|
||||
vec3 dirDiff = worldDir - normLightningpos;
|
||||
|
||||
float u = -1.0;
|
||||
float v = -1.0;
|
||||
vec4 lightningTex = vec4(0.0);
|
||||
if (dot(worldDir, normLightningpos) > 0.0) {
|
||||
u = dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
v = 0.55*dot(dirDiff, binormal) + 0.1/uvScalar;
|
||||
|
||||
vec2 uv = vec2(u, v) * uvScalar;
|
||||
|
||||
float randomTex = 16.0*rand(lightningTimer*72.82723486);
|
||||
|
||||
#if CUSTOM_LIGHTNING_TEX > 0
|
||||
randomTex = CUSTOM_LIGHTNING_TEX - 1.0;
|
||||
#endif
|
||||
|
||||
// TODO: There has to be a better way to do this.............
|
||||
if (randomTex < 1.0) {
|
||||
lightningTex = texture2D(lightningTex1, uv);
|
||||
} else if (randomTex < 2.0) {
|
||||
lightningTex = texture2D(lightningTex2, uv);
|
||||
} else if (randomTex < 3.0) {
|
||||
u = 1.3*dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex3, uv);
|
||||
} else if (randomTex < 4.0) {
|
||||
lightningTex = texture2D(lightningTex4, uv);
|
||||
} else if (randomTex < 5.0) {
|
||||
lightningTex = texture2D(lightningTex5, uv);
|
||||
} else if (randomTex < 6.0) {
|
||||
u = 1.25*dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex6, uv);
|
||||
} else if (randomTex < 7.0) {
|
||||
lightningTex = texture2D(lightningTex7, uv);
|
||||
} else if (randomTex < 8.0) {
|
||||
lightningTex = texture2D(lightningTex8, uv);
|
||||
} else if (randomTex < 9.0) {
|
||||
u = 1.4*dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex9, uv);
|
||||
} else if (randomTex < 10.0) {
|
||||
lightningTex = texture2D(lightningTex10, uv);
|
||||
} else if (randomTex < 11.0) {
|
||||
u = 0.5*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex11, uv);
|
||||
} else if (randomTex < 12.0) {
|
||||
u = 0.45*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex12, uv);
|
||||
} else if (randomTex < 13.0) {
|
||||
u = 0.45*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex13, uv);
|
||||
} else if (randomTex < 14.0) {
|
||||
u = 0.5*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex14, uv);
|
||||
} else if (randomTex < 15.0) {
|
||||
u = 0.45*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex15, uv);
|
||||
} else {
|
||||
u = 0.4*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex16, uv);
|
||||
}
|
||||
|
||||
lightningTex.rgb *= vec3(CUSTOM_LIGHTNING_R, CUSTOM_LIGHTNING_G, CUSTOM_LIGHTNING_B) * CUMULONIMBUS_LIGHTNING_BRIGHTNESS * 0.01;
|
||||
|
||||
if(cloudDepth.g > 0.0) lightningTex.rgb *= smoothstep(7000.0, 1500.0, lightningDist - cloudDepth.g);
|
||||
|
||||
if(lightningTex.rgb != vec3(0.0)) {
|
||||
#if defined CUSTOM_LIGHTNING_POS && CUSTOM_LIGHTNING_TEX > 0
|
||||
lightningTex.a *= pow(lightningTex.a, 2.0);
|
||||
|
||||
lightningTex.rgb *= 75;
|
||||
#else
|
||||
lightningTex.a *= pow(lightningTex.a, lightningStart); // fade alpha in for cool expansion effect
|
||||
|
||||
lightningTex.rgb += 120 * lightningMid * lightningTex.rgb; // bright flash in the middle
|
||||
|
||||
lightningTex.rgb *= 75 * lightningFade; // fade out
|
||||
#endif
|
||||
}
|
||||
|
||||
if (length(lightningTex.rgb) == 0.0) lightningTex.a = 0.0;
|
||||
}
|
||||
|
||||
bool isSky = z0 == 1.0 && DH_z0 == 1.0;
|
||||
bool oneTexOnly = u > 0 && v > 0 && u*uvScalar < 1 && v*uvScalar < 1;
|
||||
|
||||
if (lightningTex.a > 0.01 && oneTexOnly && isSky) {
|
||||
color = lightningTex.rgb * lightningFlash;
|
||||
isLightning = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
////// --------------- START BLENDING FOGS AND FORWARD RENDERED COLOR
|
||||
vec4 TranslucentShader = texture2D(colortex2, texcoord);
|
||||
// color = vec3(texcoord-0.5,0.0) * mat3(gbufferModelViewInverse);
|
||||
|
||||
// blend border fog. be sure to blend before and after forward rendered color blends.
|
||||
#if defined BorderFog && defined OVERWORLD_SHADER
|
||||
vec4 borderFog = vec4(skyGroundColor, getBorderFogDensity(linearDistance_cylinder, playerPos_normalized, swappedDepth >= 1.0));
|
||||
|
||||
#if !defined SKY_GROUND
|
||||
borderFog.rgb = skyFromTex(playerPos, colortex4)/1200.0 * Sky_Brightness;
|
||||
#endif
|
||||
borderFog *= BorderFogIntensity;
|
||||
#if !defined DISTANT_HORIZONS
|
||||
color = mix(color, borderFog.rgb, getBorderFogDensity(linearDistance_cylinder_alt, normalize(playerPos_alt), z2 >= 1.0 || TranslucentShader.a <= 0));
|
||||
#endif
|
||||
#else
|
||||
vec4 borderFog = vec4(0.0);
|
||||
#endif
|
||||
|
||||
// apply block breaking effect.
|
||||
if(albedo.a > 0.01 && !isWater && TranslucentShader.a <= 0.0 && !isEntity) color = mix(color*6.0, color, luma(albedo.rgb)) * albedo.rgb;
|
||||
|
||||
////// --------------- BLEND TRANSLUCENT GBUFFERS
|
||||
//////////// and do border fog on opaque and translucents
|
||||
|
||||
#if defined BorderFog
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float fog = smoothstep(1.0, 0.0, min(max(1.0 - linearDistance_cylinder / dhRenderDistance,0.0)*3.0,1.0) );
|
||||
#else
|
||||
float fog = smoothstep(1.0, 0.0, min(max(1.0 - linearDistance_cylinder / far,0.0)*3.0,1.0) );
|
||||
#endif
|
||||
|
||||
fog *= exp(-10.0 * pow(clamp(playerPos_normalized.y,0.0,1.0)*4.0,2.0));
|
||||
|
||||
fog *= (1.0-caveDetection);
|
||||
|
||||
fog *= BorderFogIntensity;
|
||||
|
||||
if(swappedDepth >= 1.0 || isEyeInWater != 0) fog = 0.0;
|
||||
|
||||
#ifdef SKY_GROUND
|
||||
vec3 borderFogColor = skyGroundColor;
|
||||
#else
|
||||
vec3 borderFogColor = skyFromTex(playerPos_normalized, colortex4)/1200.0 * Sky_Brightness;
|
||||
#endif
|
||||
|
||||
color.rgb = mix(color.rgb, borderFogColor, fog);
|
||||
#else
|
||||
float fog = 0.0;
|
||||
// apply multiplicative color blend for glass n stuff
|
||||
#ifdef Glass_Tint
|
||||
if(!isWater) color *= mix(normalize(albedo.rgb+1e-7), vec3(1.0), max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0))) ;
|
||||
#endif
|
||||
|
||||
if (TranslucentShader.a > 0.0){
|
||||
#ifdef Glass_Tint
|
||||
if(!isWater) color *= mix(normalize(albedo.rgb+1e-7), vec3(1.0), max(fog, min(max(0.1-albedo.a,0.0) * 10.0,1.0))) ;
|
||||
#endif
|
||||
// blend forward rendered programs onto the color.
|
||||
blendForwardRendering(color, TranslucentShader);
|
||||
|
||||
#ifdef BorderFog
|
||||
TranslucentShader = mix(TranslucentShader, vec4(0.0), fog);
|
||||
#endif
|
||||
|
||||
color *= (1.0-TranslucentShader.a);
|
||||
color += TranslucentShader.rgb*10.0 ;
|
||||
}
|
||||
|
||||
////// --------------- VARIOUS FOG EFFECTS (behind volumetric fog)
|
||||
|
||||
////// --------------- lightning effect
|
||||
|
||||
bool isLightning = false;
|
||||
|
||||
#if defined OVERWORLD_SHADER && defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 && defined VOLUMETRIC_CLOUDS
|
||||
|
||||
vec2 cloudDepth = imageLoad(cloudDepthTex, ivec2(gl_FragCoord.xy*VL_RENDER_RESOLUTION*RENDER_SCALE)).rg;
|
||||
|
||||
vec3 lightningpos = vec3(getLightningPosition(600, 4680));
|
||||
//lightningpos = vec3(0,0,1);
|
||||
|
||||
float lightningDist = length(lightningpos);
|
||||
|
||||
if ((lightningDist < cloudDepth.r || cloudDepth.r == 0.0) && (thunderStrength > 0.0 || rainStrength == 0.0)) {
|
||||
vec2 tc = (gl_FragCoord.xy - 0.5)*texelSize;
|
||||
|
||||
float depth = z;
|
||||
|
||||
float z0 = depth < 0.56 ? convertHandDepth(depth) : depth;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = DH_depth0;
|
||||
#else
|
||||
float DH_z0 = 1.0;
|
||||
#endif
|
||||
|
||||
float uvScalar = 3.0 * CUSTOM_LIGHTNING_SCALE;
|
||||
|
||||
vec3 normLightningpos = normalize(lightningpos);
|
||||
|
||||
vec3 worldDir = normalize(mat3(gbufferModelViewInverse) * toScreenSpace(vec3(texcoord /RENDER_SCALE,1.0)));
|
||||
|
||||
vec3 tangent = normalize(cross(normLightningpos, vec3(0.0, 1.0, 0.0)));
|
||||
vec3 binormal = cross(normLightningpos, tangent);
|
||||
vec3 dirDiff = worldDir - normLightningpos;
|
||||
|
||||
float u = -1.0;
|
||||
float v = -1.0;
|
||||
vec4 lightningTex = vec4(0.0);
|
||||
if (dot(worldDir, normLightningpos) > 0.0) {
|
||||
u = dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
v = 0.55*dot(dirDiff, binormal) + 0.1/uvScalar;
|
||||
|
||||
vec2 uv = vec2(u, v) * uvScalar;
|
||||
|
||||
float randomTex = 16*rand(lightningTimer*72.82723486);
|
||||
|
||||
#if CUSTOM_LIGHTNING_TEX > 0
|
||||
randomTex = CUSTOM_LIGHTNING_TEX-1;
|
||||
#endif
|
||||
|
||||
if (randomTex < 1.0) {
|
||||
lightningTex = texture2D(lightningTex1, uv);
|
||||
} else if (randomTex < 2.0) {
|
||||
lightningTex = texture2D(lightningTex2, uv);
|
||||
} else if (randomTex < 3.0) {
|
||||
u = 1.3*dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex3, uv);
|
||||
} else if (randomTex < 4.0) {
|
||||
lightningTex = texture2D(lightningTex4, uv);
|
||||
} else if (randomTex < 5.0) {
|
||||
lightningTex = texture2D(lightningTex5, uv);
|
||||
} else if (randomTex < 6.0) {
|
||||
u = 1.25*dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex6, uv);
|
||||
} else if (randomTex < 7.0) {
|
||||
lightningTex = texture2D(lightningTex7, uv);
|
||||
} else if (randomTex < 8.0) {
|
||||
lightningTex = texture2D(lightningTex8, uv);
|
||||
} else if (randomTex < 9.0) {
|
||||
u = 1.4*dot(dirDiff, tangent) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex9, uv);
|
||||
} else if (randomTex < 10.0) {
|
||||
lightningTex = texture2D(lightningTex10, uv);
|
||||
} else if (randomTex < 11.0) {
|
||||
u = 0.5*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex11, uv);
|
||||
} else if (randomTex < 12.0) {
|
||||
u = 0.45*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex12, uv);
|
||||
} else if (randomTex < 13.0) {
|
||||
u = 0.45*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex13, uv);
|
||||
} else if (randomTex < 14.0) {
|
||||
u = 0.5*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex14, uv);
|
||||
} else if (randomTex < 15.0) {
|
||||
u = 0.45*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex15, uv);
|
||||
} else {
|
||||
u = 0.4*dot(dirDiff, tangent)+0.5/uvScalar;
|
||||
v = 0.7*dot(dirDiff, binormal) + 0.5/uvScalar;
|
||||
uv = vec2(u, v) * uvScalar;
|
||||
lightningTex = texture2D(lightningTex16, uv);
|
||||
}
|
||||
|
||||
lightningTex.rgb *= vec3(CUSTOM_LIGHTNING_R, CUSTOM_LIGHTNING_G, CUSTOM_LIGHTNING_B) * CUMULONIMBUS_LIGHTNING_BRIGHTNESS * 0.01;
|
||||
|
||||
if(cloudDepth.g > 0.0) lightningTex.rgb *= smoothstep(7000.0, 1500.0, lightningDist - cloudDepth.g);
|
||||
|
||||
if(lightningTex.rgb != vec3(0.0)) {
|
||||
#if defined CUSTOM_LIGHTNING_POS && CUSTOM_LIGHTNING_TEX > 0
|
||||
lightningTex.a *= pow(lightningTex.a, 2.0);
|
||||
|
||||
lightningTex.rgb *= 75;
|
||||
#else
|
||||
lightningTex.a *= pow(lightningTex.a, lightningStart); // fade alpha in for cool expansion effect
|
||||
|
||||
lightningTex.rgb += 120 * lightningMid * lightningTex.rgb; // bright flash in the middle
|
||||
|
||||
lightningTex.rgb *= 75 * lightningFade; // fade out
|
||||
#endif
|
||||
}
|
||||
|
||||
if (length(lightningTex.rgb) == 0.0) lightningTex.a = 0.0;
|
||||
}
|
||||
|
||||
bool isSky = z0 == 1.0 && DH_z0 == 1.0;
|
||||
bool oneTexOnly = u > 0 && v > 0 && u*uvScalar < 1 && v*uvScalar < 1;
|
||||
|
||||
if (lightningTex.a > 0.01 && oneTexOnly && isSky) {
|
||||
color = lightningTex.rgb * lightningFlash;
|
||||
isLightning = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////// blindness, nightvision, liquid fogs and misc fogs
|
||||
|
||||
#if defined OVERWORLD_SHADER && defined CAVE_FOG
|
||||
if (isEyeInWater == 0 && eyeAltitude < 1500){
|
||||
|
||||
vec3 cavefogCol = vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B);
|
||||
|
||||
// #ifdef PER_BIOME_ENVIRONMENT
|
||||
// BiomeFogColor(cavefogCol);
|
||||
// #endif
|
||||
|
||||
cavefogCol *= 1.0-pow(1.0-pow(1.0 - max(1.0 - linearDistance/far,0.0),2.0),CaveFogFallOff);
|
||||
cavefogCol *= exp(-7.0*clamp(normalize(playerPos_normalized).y*0.5+0.5,0.0,1.0)) * 0.999 + 0.001;
|
||||
|
||||
cavefogCol *= 0.3;
|
||||
|
||||
float skyhole = pow(clamp(1.0-pow(max(playerPos_normalized.y - 0.6,0.0)*5.0,2.0),0.0,1.0),2);
|
||||
|
||||
#if (CAVE_DETECTION == 0.0) || (CAVE_DETECTION == 1.0)
|
||||
#if (CAVE_DETECTION == 1.0)
|
||||
float caveFactor = 1-smoothstep(60.0, 63.0, cameraPosition.y);
|
||||
#else
|
||||
float caveFactor = 1.0;
|
||||
#endif
|
||||
#else
|
||||
float caveFactor = 0.0;
|
||||
#endif
|
||||
|
||||
color.rgb = mix(color.rgb + cavefogCol * caveDetection, cavefogCol, z >= 1.0 ? skyhole * caveDetection * caveFactor: 0.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
////// --------------- underwater fog
|
||||
if (isEyeInWater == 1){
|
||||
// float dirtAmount = Dirt_Amount;
|
||||
// vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);
|
||||
// vec3 dirtEpsilon = vec3(Dirt_Absorb_R, Dirt_Absorb_G, Dirt_Absorb_B);
|
||||
vec3 totEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);// dirtEpsilon*dirtAmount + waterEpsilon;
|
||||
vec3 scatterCoef = Dirt_Amount * vec3(Dirt_Scatter_R, Dirt_Scatter_G, Dirt_Scatter_B) / 3.14;
|
||||
|
||||
// float distanceFromWaterSurface = normalize(playerPos).y + 1.0 + (cameraPosition.y - waterEnteredAltitude)/waterEnteredAltitude;
|
||||
// distanceFromWaterSurface = clamp(distanceFromWaterSurface, 0.0,1.0);
|
||||
|
||||
vec3 transmittance = exp(-totEpsilon * linearDistance);
|
||||
color.rgb *= transmittance;
|
||||
|
||||
vec3 transmittance2 = exp(-totEpsilon * 50.0);
|
||||
float fogfade = 1.0 - max((1.0 - linearDistance / min(far, 16.0*7.0) ),0);
|
||||
color.rgb += (transmittance2 * scatterCoef) * fogfade;
|
||||
|
||||
|
||||
bloomyFogMult *= 0.5;
|
||||
}
|
||||
|
||||
////// --------------- BLEND FOG INTO SCENE
|
||||
//////////// apply VL fog over opaque and translucents
|
||||
|
||||
#if !defined OVERWORLD_SHADER
|
||||
bloomyFogMult *= temporallyFilteredVL.a;
|
||||
#if defined BorderFog && defined OVERWORLD_SHADER
|
||||
color = mix(color, borderFog.rgb, getBorderFogDensity(linearDistance_cylinder, playerPos_normalized, swappedDepth >= 1.0));
|
||||
#endif
|
||||
|
||||
// tweaks to VL for nametag rendering
|
||||
#if defined IS_IRIS
|
||||
// if(z >= 1.0) color = vec3(0,255,0);
|
||||
// else color = vec3(0.01);
|
||||
|
||||
if(!isLightning) color *= min(temporallyFilteredVL.a + (1.0-nametagbackground),1.0);
|
||||
color += temporallyFilteredVL.rgb * nametagbackground;
|
||||
#else
|
||||
color *= temporallyFilteredVL.a ;
|
||||
color += temporallyFilteredVL.rgb ;
|
||||
temporallyFilteredVL.a = min(temporallyFilteredVL.a + (1.0-nametagbackground),1.0);
|
||||
temporallyFilteredVL.rgb *= nametagbackground;
|
||||
#endif
|
||||
|
||||
////// --------------- VARIOUS FOG EFFECTS (in front of volumetric fog)
|
||||
//////////// blindness, nightvision, liquid fogs and misc fogs
|
||||
|
||||
////// --------------- bloomy rain effect
|
||||
#ifdef OVERWORLD_SHADER
|
||||
float rainDrops = clamp(texture2D(colortex9,texcoord).a, 0.0,1.0);
|
||||
if(rainDrops > 0.0) bloomyFogMult *= clamp(1.0 - pow(rainDrops*5.0,2),0.0,1.0);
|
||||
#endif
|
||||
|
||||
////// --------------- lava.
|
||||
if (isEyeInWater == 2){
|
||||
color.rgb = mix(color.rgb, vec3(0.1,0.0,0.0), 1.0-exp(-10.0*clamp(linearDistance*0.5,0.,1.))*0.5 );
|
||||
bloomyFogMult = 0.0;
|
||||
}
|
||||
// blend all fog types. volumetric fog, volumetric clouds, distance based fogs for lava, powdered snow, blindness, and darkness.
|
||||
blendAllFogTypes(color, bloomyFogMult, temporallyFilteredVL, linearDistance, playerPos_normalized, cameraPosition, isSky, isLightning);
|
||||
|
||||
///////// --------------- powdered snow
|
||||
if (isEyeInWater == 3){
|
||||
color.rgb = mix(color.rgb,vec3(0.5,0.75,1.0),clamp(linearDistance*0.5,0.,1.));
|
||||
bloomyFogMult = 0.0;
|
||||
}
|
||||
|
||||
////// --------------- blidnesss
|
||||
color.rgb *= mix(1.0,clamp( exp(pow(linearDistance*(blindness*0.2),2) * -5),0.,1.) , blindness);
|
||||
|
||||
//////// --------------- darkness effect
|
||||
color.rgb *= mix(1.0, (1.0-darknessLightFactor*2.0) * clamp(1.0-pow(length(viewPos)*(darknessFactor*0.07),2.0),0.0,1.0), darknessFactor);
|
||||
|
||||
////// --------------- FINALIZE
|
||||
#ifdef display_LUT
|
||||
float zoomLevel = 1.0;
|
||||
@@ -859,7 +786,7 @@ bool isLightning = false;
|
||||
}
|
||||
|
||||
#if defined OVERWORLD_SHADER
|
||||
if( hideGUI == 1) color.rgb = skyFromTex(playerPos_normalized, colortex4).rgb/1200.0;
|
||||
if( hideGUI == 1) color.rgb = skyCloudsFromTex(playerPos_normalized, colortex4).rgb/1200.0;
|
||||
#else
|
||||
if( hideGUI == 1) color.rgb = volumetricsFromTex(playerPos_normalized, colortex4, 0.0).rgb/1200.0;
|
||||
#endif
|
||||
|
||||
@@ -110,10 +110,10 @@ vec3 toClipSpace3Prev(vec3 viewSpacePosition) {
|
||||
return projMAD(gbufferPreviousProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
}
|
||||
vec3 tonemap(vec3 col){
|
||||
return col/(1+luma(col));
|
||||
return col/(1.+luma(col));
|
||||
}
|
||||
vec3 invTonemap(vec3 col){
|
||||
return col/(1-luma(col));
|
||||
return col/(1.-luma(col));
|
||||
}
|
||||
void convertHandDepth(inout float depth) {
|
||||
float ndcDepth = depth * 2.0 - 1.0;
|
||||
|
||||
@@ -40,8 +40,8 @@ vec2 quarterResTC = gl_FragCoord.xy*2.0*resScale*texelSize;
|
||||
//0.25
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC-2.0*vec2(texelSize.x,0.0))/2.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC+2.0*vec2(0.0,texelSize.y))/2.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC+2.0*vec2(0,-texelSize.y))/2*0.125;
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC+2.0*vec2(-texelSize.x,0.0))/2*0.125;
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC+2.0*vec2(0.0,-texelSize.y))/2.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC+2.0*vec2(-texelSize.x,0.0))/2.*0.125;
|
||||
|
||||
//0.125
|
||||
gl_FragData[0] += texture2D(colortex5,quarterResTC-2.0*vec2(texelSize.x,texelSize.y))/4.*0.125;
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
#define ReflectedFog
|
||||
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
flat varying vec3 averageSkyCol_Clouds;
|
||||
flat varying vec3 averageSkyCol;
|
||||
@@ -62,7 +64,7 @@ uniform ivec2 eyeBrightnessSmooth;
|
||||
uniform float caveDetection;
|
||||
uniform int isEyeInWater;
|
||||
|
||||
vec4 lightCol = vec4(lightSourceColor, float(sunElevation > 1e-5)*2-1.);
|
||||
// vec4 lightCol = vec4(lightSourceColor, float(sunElevation > 1e-5)*2-1.);
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
#include "/lib/ROBOBO_sky.glsl"
|
||||
@@ -71,7 +73,11 @@ vec4 lightCol = vec4(lightSourceColor, float(sunElevation > 1e-5)*2-1.);
|
||||
#include "/lib/waterBump.glsl"
|
||||
|
||||
vec3 WsunVec = mat3(gbufferModelViewInverse)*sunVec;
|
||||
vec3 WmoonVec = mat3(gbufferModelViewInverse)*moonVec;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 WmoonVec = customMoonVecSSBO;
|
||||
#else
|
||||
vec3 WmoonVec = mat3(gbufferModelViewInverse)*moonVec;
|
||||
#endif
|
||||
// vec3 WsunVec = normalize(LightDir);
|
||||
|
||||
vec3 toShadowSpaceProjected(vec3 p3){
|
||||
@@ -302,8 +308,19 @@ if (gl_FragCoord.x > 18. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257){
|
||||
vec3 skyAbsorb = vec3(0.0);
|
||||
|
||||
vec3 mC = vec3(fog_coefficientMieR*1e-6, fog_coefficientMieG*1e-6, fog_coefficientMieB*1e-6);
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#if LIGHTNING_SHADOWS > 0
|
||||
vec3 WmoonVec = customMoonVec2SSBO;
|
||||
#else
|
||||
vec3 WmoonVec = customMoonVecSSBO;
|
||||
#endif
|
||||
#else
|
||||
vec3 WmoonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition + gbufferModelViewInverse[3].xyz);
|
||||
if(dot(-WmoonVec, WsunVec) < 0.9999) WmoonVec = -WmoonVec;
|
||||
#endif
|
||||
|
||||
sky = calculateAtmosphere((averageSkyCol*4000./2.0), viewVector, vec3(0.0,1.0,0.0), WsunVec, -WsunVec, planetSphere, skyAbsorb, 10, blueNoise());
|
||||
sky = calculateAtmosphere((averageSkyCol*4000./2.0), viewVector, vec3(0.0,1.0,0.0), WsunVec, WmoonVec, planetSphere, skyAbsorb, 10, blueNoise());
|
||||
|
||||
// fade atmosphere conditions for rain away when you pass above the cloud plane.
|
||||
// float heightRelativeToClouds = clamp(1.0 - max(eyeAltitude - CloudLayer0_height,0.0) / 200.0 ,0.0,1.0);
|
||||
@@ -327,9 +344,20 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+
|
||||
float noise = interleaved_gradientNoise_temporal();
|
||||
|
||||
WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition + gbufferModelViewInverse[3].xyz);// * ( float(sunElevation > 1e-5)*2.0-1.0 );
|
||||
vec3 WmoonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition + gbufferModelViewInverse[3].xyz);// * ( );
|
||||
|
||||
if(dot(-WmoonVec, WsunVec) < 0.9999) WmoonVec = -WmoonVec;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#if LIGHTNING_SHADOWS > 0
|
||||
WmoonVec = customMoonVec2SSBO;
|
||||
#else
|
||||
WmoonVec = customMoonVecSSBO;
|
||||
#endif
|
||||
vec3 moonColor2 = moonColor * mix(0.0, 1.0, clamp(WmoonVec.y + 0.05, 0.0, 0.1)/0.1);
|
||||
//suncol *= mix(0.0, 1.0, clamp(WmoonVec.y + 0.05, 0.0, 0.1)/0.1);
|
||||
#else
|
||||
WmoonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition + gbufferModelViewInverse[3].xyz);
|
||||
if(dot(-WmoonVec, WsunVec) < 0.9999) WmoonVec = -WmoonVec;
|
||||
vec3 moonColor2 = moonColor;
|
||||
#endif
|
||||
|
||||
vec3 sky = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy)-ivec2(257,0),0).rgb/150.0;
|
||||
sky = mix(averageSkyCol_Clouds * AmbientLightTint * 0.25, sky, pow(clamp(viewVector.y+1.0,0.0,1.0),5.0));
|
||||
@@ -342,8 +370,14 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+
|
||||
|
||||
float cloudPlaneDistance = 0.0;
|
||||
vec2 cloudDistance = vec2(0.0);
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 sunColor2 = sunColor * smoothstep(0.005, 0.09, length(WmoonVec - WsunVec));
|
||||
#else
|
||||
vec3 sunColor2 = sunColor;
|
||||
#endif
|
||||
|
||||
vec4 volumetricClouds = GetVolumetricClouds(viewPos, vec2(noise, 1.0-noise), WsunVec, WmoonVec, sunColor*2.5, moonColor*2.5, skyGroundCol/30.0, cloudPlaneDistance, cloudDistance);
|
||||
vec4 volumetricClouds = GetVolumetricClouds(viewPos, vec2(noise, 1.0-noise), WsunVec, WmoonVec, sunColor2*2.5, moonColor2*2.5, skyGroundCol/30.0, cloudPlaneDistance, cloudDistance);
|
||||
|
||||
float atmosphereAlpha = 1.0;
|
||||
WsunVec = mix(WmoonVec, WsunVec, clamp(float(sunElevation > 1e-5)*2.0-1.0 ,0,1));
|
||||
|
||||
@@ -35,6 +35,7 @@ uniform mat4 gbufferModelViewInverse;
|
||||
uniform vec3 sunPosition;
|
||||
uniform vec2 texelSize;
|
||||
uniform float sunElevation;
|
||||
uniform float moonElevation;
|
||||
uniform float eyeAltitude;
|
||||
uniform float rainStrength;
|
||||
uniform float nightVision;
|
||||
@@ -43,6 +44,7 @@ uniform float near;
|
||||
uniform float frameTime;
|
||||
uniform int frameCounter;
|
||||
uniform vec3 cameraPosition;
|
||||
uniform vec4 lightningBoltPosition;
|
||||
|
||||
vec3 sunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
|
||||
@@ -82,6 +84,17 @@ float hash11(float p)
|
||||
#define USE_SCENE_CONTROLLER_SETTINGS
|
||||
#include "/lib/scene_controller.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
|
||||
#if LIGHTNING_SHADOWS > 0
|
||||
float lightningFlashTimer = floor(frameTimeCounter * 11.0);
|
||||
float randomSeed = fract(sin(dot(vec2(lightningFlashTimer), vec2(12.9898,78.233))) * 43758.5453);
|
||||
float lightningFlash = mix(0.1, 2.5, randomSeed);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
gl_Position = ftransform()*0.5+0.5;
|
||||
@@ -151,16 +164,31 @@ void main() {
|
||||
vec2 planetSphere = vec2(0.0);
|
||||
|
||||
float sunVis = clamp(sunElevation,0.0,0.04)/0.04*clamp(sunElevation,0.0,0.04)/0.04;
|
||||
float moonVis = clamp(-sunElevation,0.0,0.04)/0.04*clamp(-sunElevation,0.0,0.04)/0.04;
|
||||
float moonVis = clamp(-moonElevation,0.0,0.04)/0.04*clamp(-moonElevation,0.0,0.04)/0.04;
|
||||
|
||||
vec3 skyAbsorb = vec3(0.0);
|
||||
sunColor = calculateAtmosphere(vec3(0.0), sunVec, vec3(0.0,1.0,0.0), sunVec, -sunVec, planetSphere, skyAbsorb, 25,0.0);
|
||||
sunColor = sunColorBase/4000.0 * skyAbsorb;
|
||||
moonColor = moonColorBase/4000.0;
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#if LIGHTNING_SHADOWS > 0
|
||||
vec3 WmoonVec = customMoonVec2SSBO;
|
||||
#else
|
||||
vec3 WmoonVec = customMoonVecSSBO;
|
||||
#endif
|
||||
|
||||
float moonPhase = 1.0 - 0.5 * (dot(sunVec, WmoonVec) + 1.0);
|
||||
moonVis = smoothstep(0.08, -0.03, -WmoonVec.y);
|
||||
moonColor *= sqrt(moonPhase);
|
||||
|
||||
#endif
|
||||
|
||||
// lightSourceColor = sunVis >= 1e-5 ? sunColor * sunVis : moonColor * moonVis;
|
||||
lightSourceColor = sunColor * sunVis + moonColor * moonVis;
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
lightSourceColor *= smoothstep(0.005, 0.09, length(WmoonVec - sunVec));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined OVERWORLD_SHADER && defined TWILIGHT_FOREST_FLAG
|
||||
|
||||
@@ -50,9 +50,9 @@ vec2 decodeVec2(float a){
|
||||
void main() {
|
||||
/* RENDERTARGETS:4,12 */
|
||||
vec3 oldTex = texelFetch2D(colortex4, ivec2(gl_FragCoord.xy), 0).xyz;
|
||||
float newTex = texelFetch2D(depthtex1, ivec2(gl_FragCoord.xy*4), 0).x;
|
||||
float newTex = texelFetch2D(depthtex1, ivec2(gl_FragCoord.xy*4.), 0).x;
|
||||
|
||||
float dataUnpacked = decodeVec2(texelFetch2D(colortex1,ivec2(gl_FragCoord.xy*4),0).w).y;
|
||||
float dataUnpacked = decodeVec2(texelFetch2D(colortex1,ivec2(gl_FragCoord.xy*4.),0).w).y;
|
||||
bool hand = abs(dataUnpacked-0.75) < 0.01;
|
||||
|
||||
if(hand) convertHandDepth(newTex);
|
||||
|
||||
@@ -4,6 +4,6 @@ uniform vec2 texelSize;
|
||||
#include "/lib/res_params.glsl"
|
||||
void main() {
|
||||
gl_Position = ftransform();
|
||||
vec2 scaleRatio = max(vec2(0.25), vec2(18.+258*2,258.)*texelSize);
|
||||
vec2 scaleRatio = max(vec2(0.25), vec2(18.+258.*2.,258.)*texelSize);
|
||||
gl_Position.xy = (gl_Position.xy*0.5+0.5)*clamp(scaleRatio+0.01,0.0,1.0)*2.0-1.0;
|
||||
}
|
||||
|
||||
@@ -26,30 +26,30 @@ float interleaved_gradientNoise(){
|
||||
|
||||
|
||||
void main() {
|
||||
#if RESOURCEPACK_SKY != 0
|
||||
vec2 texcoord = gl_FragCoord.xy * texelSize;
|
||||
|
||||
vec2 texcoord = gl_FragCoord.xy * texelSize;
|
||||
gl_FragData[0] = texelFetch2D(colortex1, ivec2(gl_FragCoord.xy),0);
|
||||
|
||||
gl_FragData[0] = texelFetch2D(colortex1, ivec2(gl_FragCoord.xy),0);
|
||||
if(
|
||||
texelFetch2D(depthtex0, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
|| texelFetch2D(dhDepthTex, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
#endif
|
||||
|
||||
if(
|
||||
texelFetch2D(depthtex0, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
|| texelFetch2D(dhDepthTex, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
#endif
|
||||
) {
|
||||
// doing this for precision reasons, DH does NOT like depth => 1.0
|
||||
}else{
|
||||
|
||||
vec3 skyColor = texelFetch2D(colortex2, ivec2(gl_FragCoord.xy),0).rgb;
|
||||
skyColor.rgb = max(skyColor.rgb - skyColor.rgb * interleaved_gradientNoise()*0.05, 0.0);
|
||||
|
||||
) {
|
||||
// doing this for precision reasons, DH does NOT like depth => 1.0
|
||||
}else{
|
||||
|
||||
vec3 skyColor = texelFetch2D(colortex2, ivec2(gl_FragCoord.xy),0).rgb;
|
||||
skyColor.rgb = max(skyColor.rgb - skyColor.rgb * interleaved_gradientNoise()*0.05, 0.0);
|
||||
gl_FragData[0].rgb = skyColor/50.0;
|
||||
gl_FragData[0].a = 0.0;
|
||||
|
||||
gl_FragData[0].rgb = skyColor/50.0;
|
||||
gl_FragData[0].a = 0.0;
|
||||
|
||||
}
|
||||
|
||||
gl_FragData[1] = vec4(0,0,0,0);
|
||||
}
|
||||
|
||||
gl_FragData[1] = vec4(0,0,0,0);
|
||||
#endif
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
// #if defined END_SHADER || defined NETHER_SHADER
|
||||
#undef IS_LPV_ENABLED
|
||||
// #endif
|
||||
@@ -208,7 +213,7 @@ vec4 waterVolumetrics( vec3 rayStart, vec3 rayEnd, float estEndDepth, float estS
|
||||
vec3 spPos = start.xyz + dV*d;
|
||||
|
||||
//project into biased shadowmap space
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
#if defined DISTORT_SHADOWMAP && defined OVERWORLD_SHADER
|
||||
float distortFactor = calcDistort(spPos.xy);
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
@@ -320,6 +325,9 @@ void main() {
|
||||
vec3 directLightColor = lightCol.rgb / 2400.0;
|
||||
vec3 directSunlightColor = sunlightCol / 2400.0;
|
||||
vec3 directMoonlightColor = moonlightCol / 2400.0;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
directMoonlightColor *= mix(0.0, 1.0, clamp(WmoonVec.y + 0.05, 0.0, 0.1)/0.1);
|
||||
#endif
|
||||
vec3 indirectLightColor = averageSkyCol / 1200.0;
|
||||
vec3 indirectLightColor_dynamic = averageSkyCol_Clouds / 1200.0;
|
||||
|
||||
@@ -359,7 +367,7 @@ void main() {
|
||||
vec4 VolumetricClouds = GetVolumetricClouds(viewPos1, vec2(noise_1, noise_2), WrealSunVec, WmoonVec, directSunlightColor, directMoonlightColor, indirectLightColor, cloudPlaneDistance, cloudDistance);
|
||||
|
||||
float atmosphereAlpha = 1.0;
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, WsunVec, vec2(noise_1, noise_2), directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb,cloudPlaneDistance);
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, WsunVec, vec2(noise_1, noise_2), directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb,cloudPlaneDistance);
|
||||
|
||||
finalVolumetrics.rgb += VolumetricClouds.rgb;
|
||||
finalVolumetrics.a *= VolumetricClouds.a;
|
||||
|
||||
@@ -27,7 +27,9 @@ uniform vec3 moonPosition;
|
||||
uniform mat4 gbufferModelViewInverse;
|
||||
uniform int frameCounter;
|
||||
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#include "/lib/SSBOs.glsl"
|
||||
#endif
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@@ -70,17 +72,23 @@ void main() {
|
||||
#endif
|
||||
|
||||
#ifdef END_SHADER
|
||||
lightCol.rgb = vec3(0.0);
|
||||
averageSkyCol = vec3(0.0);
|
||||
averageSkyCol_Clouds = vec3(15);
|
||||
lightCol.rgb = 500.0 * vec3(AmbientLightEnd_R, AmbientLightEnd_G, AmbientLightEnd_B);
|
||||
averageSkyCol = 500.0 * vec3(AmbientLightEnd_R, AmbientLightEnd_G, AmbientLightEnd_B);
|
||||
averageSkyCol_Clouds = 500.0 * vec3(AmbientLightEnd_R, AmbientLightEnd_G, AmbientLightEnd_B);
|
||||
#endif
|
||||
|
||||
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
||||
WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 moonVec = customMoonVecSSBO;
|
||||
sunlightCol *= smoothstep(0.005, 0.09, length(moonVec - WsunVec));
|
||||
#else
|
||||
vec3 moonVec = normalize(mat3(gbufferModelViewInverse) * moonPosition);
|
||||
if(dot(-moonVec, WsunVec) < 0.9999) moonVec = -moonVec;
|
||||
#endif
|
||||
|
||||
WmoonVec = moonVec;
|
||||
if(dot(-moonVec, WsunVec) < 0.9999) WmoonVec = -moonVec;
|
||||
|
||||
WrealSunVec = WsunVec;
|
||||
WsunVec = mix(WmoonVec, WsunVec, clamp(lightCol.a,0,1));
|
||||
|
||||
+56
-13
@@ -1,13 +1,13 @@
|
||||
option.SHADER_VERSION_LABEL = Merlin1809's Bliss Fork
|
||||
option.SHADER_VERSION_LABEL = §dECLIPSE§r - A Bliss Edit
|
||||
prefix.SHADER_VERSION_LABEL = V
|
||||
value.SHADER_VERSION_LABEL.482 = 0.1.8
|
||||
value.SHADER_VERSION_LABEL.482 = 1.0.0
|
||||
|
||||
# if you're here to translate, this is not a joke, these do what they say
|
||||
profile.POTATO=§4Potato
|
||||
profile.VERY_LOW=§cVery Low
|
||||
profile.LOW=§aLow
|
||||
profile.MEDIUM=§2Medium
|
||||
profile.HIGH=§bHigh
|
||||
profile.MEDIUM=§2Medium (Recommended)
|
||||
profile.HIGH=§bHigh (Recommended)
|
||||
profile.VERY_HIGH=§9Very High
|
||||
profile.ULTRA=§dUltra
|
||||
|
||||
@@ -21,10 +21,10 @@ suffix.sunPathRotation = °
|
||||
option.sun_illuminance = Sun Brightness
|
||||
option.moon_illuminance = Moon Brightness
|
||||
option.MOONPHASE_BASED_MOONLIGHT = Moonphase based brightness levels
|
||||
option.LIGHTLEAKFIX_MODE = "lightleak fix" mode
|
||||
value.LIGHTLEAKFIX_MODE.0 = none. §csunlight will leak through walls§r
|
||||
value.LIGHTLEAKFIX_MODE.1 = gap fill/zoom. §cmakes shadows blocky§r
|
||||
value.LIGHTLEAKFIX_MODE.2 = use sky lightmap levels. §cno sunlight will shine in low lightmap levels§r
|
||||
option.LIGHTLEAKFIX_MODE = "Lightleak Fix" Mode
|
||||
value.LIGHTLEAKFIX_MODE.0 = None. §cSunlight will leak through walls§r
|
||||
value.LIGHTLEAKFIX_MODE.1 = Gap fill/zoom. §cMakes shadows blocky§r
|
||||
value.LIGHTLEAKFIX_MODE.2 = Use sky lightmap levels. §cNo sunlight in low lightmap levels§r
|
||||
|
||||
option.colortype = coloring mode
|
||||
value.colortype.1 = RGB color (above)
|
||||
@@ -36,17 +36,53 @@ option.colortype = coloring mode
|
||||
option.moonColorB = Moon Color: Blue
|
||||
|
||||
value.colortype.2 = Kelvin temperature (below)
|
||||
option.Sun_temp = Sun temperature
|
||||
option.Sun_temp = Sun Temperature
|
||||
suffix.Sun_temp = K
|
||||
option.Moon_temp = moon temperature
|
||||
option.Moon_temp = Moon Temperature
|
||||
suffix.Moon_temp = K
|
||||
option.REALMOON = Realistic Moon
|
||||
screen.MoonOptions = Moon Settings
|
||||
screen.SunOptions = Sun Settings
|
||||
screen.CUSTOM_MOON_SETTINGS = Custom Moon Settings
|
||||
option.REALMOON = Realistic Moon Texture
|
||||
option.CUSTOM_MOON_ROTATION = Custom Moon Rotation
|
||||
option.CAELUM_SUPPORT = Caelum (ArdaCraft) Support
|
||||
option.CAELUM_SUPPORT.comment = §cREQUIRES CUSTOM MOON ROTATION.§r Changes the light casted by the sun/moon to the correct position specified by Caelum.
|
||||
option.MOON_SIZE_SETTING = Moon Size
|
||||
option.MOON_LATITUDE = Latitude
|
||||
suffix.MOON_LATITUDE = °
|
||||
option.MONTH_LENGTH = Month Length
|
||||
value.MONTH_LENGTH.6 = 6 Days
|
||||
value.MONTH_LENGTH.7 = 7 Days
|
||||
value.MONTH_LENGTH.8 = 8 Days
|
||||
value.MONTH_LENGTH.9 = 9 Days
|
||||
value.MONTH_LENGTH.10 = 10 Days
|
||||
value.MONTH_LENGTH.11 = 11 Days
|
||||
value.MONTH_LENGTH.12 = 12 Days
|
||||
value.MONTH_LENGTH.13 = 13 Days
|
||||
value.MONTH_LENGTH.14 = 14 Days
|
||||
value.MONTH_LENGTH.15 = 15 Days
|
||||
value.MONTH_LENGTH.16 = 16 Days
|
||||
option.EARTH_ROTATION_TILT = Earth Rotation Tilt
|
||||
suffix.EARTH_ROTATION_TILT = °
|
||||
screen.CUSTOM_MOON_ROTATION_DISCLAIMER = §cChanging the values below might prevent eclipses!§r
|
||||
screen.CUSTOM_MOON_ROTATION_DISCLAIMER2 = §cChanging sun angle might prevent eclipses!§r
|
||||
screen.CUSTOM_MOON_ROTATION_DISCLAIMER3 = §cOne eclipse per ingame year guaranteed at -35° and -45°!§r
|
||||
option.MOON_TIME_OFFSET = Moon Time Offset (Ticks)
|
||||
option.CUSTOM_SHADOWS_QUALITY = Custom Shadows Culling
|
||||
value.CUSTOM_SHADOWS_QUALITY.0 = Fancy
|
||||
value.CUSTOM_SHADOWS_QUALITY.1 = Fast
|
||||
option.CUSTOM_SHADOWS_QUALITY.comment = Specify culling of custom light positions (Moon, Lightning, End). Can cause some shadows to be culled that shouldn't be culled
|
||||
screen.EndLighting = End Lighting
|
||||
option.END_ISLAND_LIGHT = Main End Island Light
|
||||
option.Max_Filter_Depth_END = Light Size Factor
|
||||
option.Min_Shadow_Filter_Radius_END = Minimum Shadow Filter Radius
|
||||
|
||||
option.STARS_AMOUNT = Stars Amount
|
||||
option.STARS_BRIGHTNESS = Stars Brightness
|
||||
screen.Misc_Settings = §cDebugging§r/Experimental Settings
|
||||
screen.Mod_support = Settings For Supported Mods
|
||||
|
||||
option.RESOURCEPACK_SKY = Resource Pack Sky
|
||||
option.RESOURCEPACK_SKY = Resource Pack Sky §c(slightly bugged)
|
||||
value.RESOURCEPACK_SKY.0 = Do not use
|
||||
value.RESOURCEPACK_SKY.1 = Sky + Shader sun/moon
|
||||
value.RESOURCEPACK_SKY.2 = Full sky
|
||||
@@ -114,6 +150,13 @@ screen.Direct_Light = Direct Light
|
||||
value.entityShadowDistanceMul.0.75 = 75% of Shadow Distance
|
||||
value.entityShadowDistanceMul.1.00 = 100% of Shadow Distance
|
||||
|
||||
option.LIGHTNING_SHADOWS = Lightning Shadows
|
||||
value.LIGHTNING_SHADOWS.0 = Off
|
||||
value.LIGHTNING_SHADOWS.1 = Only at night
|
||||
value.LIGHTNING_SHADOWS.2 = On
|
||||
|
||||
option.LIGHTNING_SHADOWS.comment = Makes lightning cast shadows. Replaces moon and/or sun shadows while lightning is active. §cREQUIRES CUSTOM MOON ROTATION§r
|
||||
|
||||
screen.Sun_and_Moon_Colors = Sun/Moon Colors
|
||||
option.Sun_temp = Sun Temperature
|
||||
option.Moon_temp = Moon Temperature
|
||||
@@ -121,7 +164,7 @@ screen.Direct_Light = Direct Light
|
||||
screen.Filtering = Shadow Filtering Settings
|
||||
option.BASIC_SHADOW_FILTER = Basic Shadow Filter
|
||||
option.SHADOW_FILTER_SAMPLE_COUNT = Basic Shadow Filter Samples
|
||||
option.Min_Shadow_Filter_Radius = Minimum Shadow filter Radius
|
||||
option.Min_Shadow_Filter_Radius = Minimum Shadow Filter Radius
|
||||
option.Variable_Penumbra_Shadows = Variable Penumbra Shadows
|
||||
option.VPS_Search_Samples = VPS Filter Samples
|
||||
option.Max_Shadow_Filter_Radius = Maximum Shadow Filter Radius
|
||||
|
||||
@@ -102,7 +102,7 @@ vec3 calculateAtmosphere(vec3 background, vec3 viewVector, vec3 upVector, vec3 s
|
||||
float referenceHeight = CloudLayer0_height;
|
||||
#endif
|
||||
float heightRelativeToClouds = clamp(1.0 - max(cameraPosition.y - referenceHeight,0.0) / 100.0 ,0.0,1.0);
|
||||
float planetGround = mix(exp(-1.0 * pow(max(-viewVector.y*10 + 0.1,0.0),2)), exp(-100.0 * pow(max(-viewVector.y*5 + 0.1,0.0),2)), heightRelativeToClouds); // darken the ground in the sky.
|
||||
float planetGround = mix(exp(-1.0 * pow(max(-viewVector.y*10. + 0.1,0.0),2.)), exp(-100.0 * pow(max(-viewVector.y*5. + 0.1,0.0),2.)), heightRelativeToClouds); // darken the ground in the sky.
|
||||
#else
|
||||
float planetGround = pow(clamp(viewVector.y+1.0,0.0,1.0),2); // darken the ground in the sky.
|
||||
#endif
|
||||
@@ -125,7 +125,12 @@ vec3 calculateAtmosphere(vec3 background, vec3 viewVector, vec3 upVector, vec3 s
|
||||
position += increment * (0.34*noise);
|
||||
|
||||
vec2 phaseSun = sky_phase(dot(viewVector, sunVector), 0.8);
|
||||
vec2 phaseMoon = sky_phase(dot(viewVector, moonVector), 0.8) ;
|
||||
vec2 phaseMoon = sky_phase(dot(viewVector, moonVector), 0.8);
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
float eclipseDarkeness = smoothstep(0.005, 0.09, length(sunVector-moonVector));
|
||||
phaseSun *= mix(1.0, eclipseDarkeness, smoothstep(-1.0, 0.175, viewVector.y));
|
||||
#endif
|
||||
|
||||
vec3 scatteringSun = vec3(0.0);
|
||||
vec3 scatteringMoon = vec3(0.0);
|
||||
@@ -133,7 +138,7 @@ vec3 calculateAtmosphere(vec3 background, vec3 viewVector, vec3 upVector, vec3 s
|
||||
|
||||
transmittance = vec3(1.0);
|
||||
|
||||
float high_sun = clamp(pow(sunVector.y+0.6,5),0.0,1.0) * 3.0; // make sunrise less blue, and allow sunset to be bluer
|
||||
float high_sun = clamp(pow(sunVector.y+0.6,5.),0.0,1.0) * 3.0; // make sunrise less blue, and allow sunset to be bluer
|
||||
float low_sun = clamp(((1.0-abs(sunVector.y))*3.) - high_sun,1.0,2.0) ;
|
||||
|
||||
#if defined OVERWORLD_SHADER && defined TWILIGHT_FOREST_FLAG
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
layout(binding = 0) buffer customMoonSSBO {
|
||||
mat4 customShadowMatrixSSBO; // 64 bytes
|
||||
|
||||
vec3 customMoonVecSSBO; // 16 bytes
|
||||
|
||||
vec3 customMoonVec2SSBO; // 16 bytes
|
||||
|
||||
mat4 customShadowPerspectiveSSBO; // 64 bytes
|
||||
};
|
||||
@@ -21,5 +21,9 @@ void applyShadowBias(inout vec3 projectedShadowPosition, in vec3 playerPos, in v
|
||||
|
||||
biasDistanceFactor = 1.0 + biasDistanceFactor * ((16.0*8.0) / shadowDistance) * 0.1;
|
||||
|
||||
projectedShadowPosition += (mat3(shadowModelView) * geoNormals) * biasSize * 0.15 * biasDistanceFactor;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
projectedShadowPosition += (mat3(customShadowMatrixSSBO) * geoNormals) * biasSize * 0.15 * biasDistanceFactor;
|
||||
#else
|
||||
projectedShadowPosition += (mat3(shadowModelView) * geoNormals) * biasSize * 0.15 * biasDistanceFactor;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -184,7 +184,8 @@ vec3 LightSourceColors(float vortexBounds, float lightningflash){
|
||||
// vec3 vortexColor = vec3(0.7,0.88,1.0);
|
||||
// vec3 lightningColor = vec3(ORB_R,ORB_G,ORB_B);
|
||||
|
||||
vec3 vortexColor = vec3(0.3,0.2,1.0);
|
||||
//vec3 vortexColor = vec3(0.3,0.2,1.0);
|
||||
vec3 vortexColor = vec3(AmbientLightEnd_R,0.8*AmbientLightEnd_G,0.83*AmbientLightEnd_B);
|
||||
vec3 lightningColor = vec3(0.75,0.5,1.0) * lightningflash;
|
||||
|
||||
#ifdef THE_ORB
|
||||
|
||||
@@ -52,7 +52,7 @@ float phaseRayleigh(float cosTheta) {
|
||||
return cosTheta * mul_add.x + mul_add.y; // optimized version from [Elek09], divided by 4 pi for energy conservation
|
||||
}
|
||||
float fogPhase(float lightPoint){
|
||||
float linear = clamp(-lightPoint*0.5+0.5,0.0,1.0);
|
||||
float linear = clamp(-lightPoint*0.5+0.5,0.001,1.0);
|
||||
float linear2 = 1.0 - clamp(lightPoint,0.0,1.0);
|
||||
|
||||
float exponential = exp2(pow(linear,0.3) * -15.0 ) * 1.5;
|
||||
@@ -89,7 +89,11 @@ vec4 GetVolumetricFog(
|
||||
|
||||
//project pixel position into projected shadowmap space
|
||||
vec3 wpos = mat3(gbufferModelViewInverse) * viewPosition + gbufferModelViewInverse[3].xyz;
|
||||
vec3 fragposition = mat3(shadowModelView) * wpos + shadowModelView[3].xyz;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 fragposition = mat3(customShadowMatrixSSBO) * wpos + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
vec3 fragposition = mat3(shadowModelView) * wpos + shadowModelView[3].xyz;
|
||||
#endif
|
||||
fragposition = diagonal3(shadowProjection) * fragposition + shadowProjection[3].xyz;
|
||||
|
||||
//project view origin into projected shadowmap space
|
||||
@@ -173,6 +177,7 @@ vec4 GetVolumetricFog(
|
||||
|
||||
|
||||
for (int i = 0; i < SAMPLECOUNT; i++) {
|
||||
if(totalAbsorbance.r < 0.01 && totalAbsorbance.g < 0.01 && totalAbsorbance.b < 0.01) break;
|
||||
float d = (pow(expFactor, float(i+dither.x)/float(SAMPLECOUNT))/expFactor - 1.0/expFactor)/(1-1.0/expFactor);
|
||||
float dd = pow(expFactor, float(i+dither.y)/float(SAMPLECOUNT)) * log(expFactor) / float(SAMPLECOUNT)/(expFactor-1.0);
|
||||
|
||||
@@ -187,7 +192,7 @@ vec4 GetVolumetricFog(
|
||||
//------------------------------------
|
||||
//------ SAMPLE SHADOWS FOR FOG EFFECTS
|
||||
//------------------------------------
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
#if defined DISTORT_SHADOWMAP && defined OVERWORLD_SHADER
|
||||
float distortFactor = calcDistort(progress.xy);
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
@@ -282,10 +287,10 @@ vec4 GetVolumetricFog(
|
||||
//------------------------------------
|
||||
|
||||
// maximum range for atmosphere haze, basically.
|
||||
float planetVolume = 1.0 - exp(clamp(1.0 - length(progressW-cameraPosition) / (16*150), 0.0,1.0) * -10);
|
||||
float planetVolume = 1.0 - exp(clamp(1.0 - length(progressW-cameraPosition) / (16.0*150.0), 0.0,1.0) * -10.0);
|
||||
|
||||
// just air
|
||||
vec2 airCoef = (exp2(-max(progressW.y-SEA_LEVEL,0.0)/vec2(8.0e3, 1.2e3)*vec2(6.,7.0)) * 192.0 * Haze_amount) * planetVolume;
|
||||
vec2 airCoef = (exp2(-max(progressW.y-SEA_LEVEL,0.0)/vec2(8.0e3, 1.2e3)*vec2(6.0,7.0)) * 192.0 * Haze_amount) * planetVolume;
|
||||
|
||||
// Pbr for air, yolo mix between mie and rayleigh for water droplets
|
||||
vec3 rL = rC*airCoef.x;
|
||||
|
||||
@@ -41,14 +41,26 @@ vec3 toWorldSpaceCamera(vec3 p3){
|
||||
|
||||
vec3 toShadowSpace(vec3 p3){
|
||||
p3 = mat3(gbufferModelViewInverse) * p3 + gbufferModelViewInverse[3].xyz;
|
||||
p3 = mat3(shadowModelView) * p3 + shadowModelView[3].xyz;
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
p3 = mat3(customShadowMatrixSSBO) * p3 + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
p3 = mat3(shadowModelView) * p3 + shadowModelView[3].xyz;
|
||||
#endif
|
||||
return p3;
|
||||
}
|
||||
|
||||
vec3 toShadowSpaceProjected(vec3 p3){
|
||||
p3 = mat3(gbufferModelViewInverse) * p3 + gbufferModelViewInverse[3].xyz;
|
||||
p3 = mat3(shadowModelView) * p3 + shadowModelView[3].xyz;
|
||||
p3 = diagonal3(shadowProjection) * p3 + shadowProjection[3].xyz;
|
||||
#if (defined CUSTOM_MOON_ROTATION && defined OVERWORLD_SHADER) || (defined END_ISLAND_LIGHT && defined END_SHADER)
|
||||
p3 = mat3(customShadowMatrixSSBO) * p3 + customShadowMatrixSSBO[3].xyz;
|
||||
#else
|
||||
p3 = mat3(shadowModelView) * p3 + shadowModelView[3].xyz;
|
||||
#endif
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
p3 = diagonal3(customShadowPerspectiveSSBO) * p3 + customShadowPerspectiveSSBO[3].xyz;
|
||||
#else
|
||||
p3 = diagonal3(shadowProjection) * p3 + shadowProjection[3].xyz;
|
||||
#endif
|
||||
|
||||
return p3;
|
||||
}
|
||||
+53
-10
@@ -130,7 +130,7 @@ const float ambientOcclusionLevel = 1.0; // this controls vanilla minecrafts amb
|
||||
|
||||
const float sunPathRotation = -35; //[-90 -89 -88 -87 -86 -85 -84 -83 -82 -81 -80 -79 -78 -77 -76 -75 -74 -73 -72 -71 -70 -69 -68 -67 -66 -65 -64 -63 -62 -61 -60 -59 -58 -57 -56 -55 -54 -53 -52 -51 -50 -49 -48 -47 -46 -45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33 -32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 ]
|
||||
|
||||
const int shadowMapResolution = 1536; // [512 768 1024 1536 2048 3172 4096 8192]
|
||||
const int shadowMapResolution = 2048; // [512 768 1024 1536 2048 3172 4096 8192]
|
||||
const float shadowDistance = 128.0; // [32.0 48.0 64.0 80.0 96.0 112.0 128.0 144.0 160.0 176.0 192.0 208.0 224.0 240.0 256.0 272.0 288.0 304.0 320.0 336.0 352.0 368.0 384.0 512.0 768.0 1024.0 1536.0 2048.0 4096.0 8192.0]
|
||||
|
||||
const float shadowDistanceRenderMul = 1.0;
|
||||
@@ -139,12 +139,18 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
|
||||
#define RENDER_ENTITY_SHADOWS
|
||||
#define RENDER_PLAYER_SHADOWS
|
||||
|
||||
#define LIGHTNING_SHADOWS 1 // [0 1 2]
|
||||
#define CUSTOM_SHADOWS_QUALITY 1 // [0 1]
|
||||
|
||||
#define SCREENSPACE_CONTACT_SHADOWS
|
||||
#define Variable_Penumbra_Shadows
|
||||
#define VPS_Search_Samples 4 // [4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
|
||||
#define Min_Shadow_Filter_Radius 5.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
||||
#define Min_Shadow_Filter_Radius_END 50.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
||||
#define Max_Shadow_Filter_Radius 30.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
||||
#define Max_Filter_Depth 15.0 // [0.1 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 220.0]
|
||||
#define Max_Filter_Depth_END 200.0 // [0.1 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 220.0]
|
||||
|
||||
|
||||
#define BASIC_SHADOW_FILTER
|
||||
#define SHADOW_FILTER_SAMPLE_COUNT 13 // [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 ]
|
||||
@@ -157,6 +163,9 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
|
||||
#undef Stochastic_Transparent_Shadows
|
||||
#endif
|
||||
|
||||
#ifdef SCREENSPACE_CONTACT_SHADOWS
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////
|
||||
// ----- FOG RELATED SETTINGS ----- //
|
||||
//////////////////////////////////////
|
||||
@@ -188,7 +197,7 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
|
||||
#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 0.1 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||
#define RainFog_amount 0.15 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||
|
||||
#define BLOOMY_FOG 1.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 1.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 50.0 75.0 100.0]
|
||||
@@ -335,10 +344,29 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
|
||||
#define moonColorB 0.8948 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||
|
||||
#define REALMOON
|
||||
#define MOON_SIZE_SETTING 4.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]
|
||||
#define MOON_SIZE 0.999 + (10.0 - MOON_SIZE_SETTING) * 0.0001
|
||||
#define MOON_LATITUDE 40.0 // [-89.0 -88.0 -87.0 -86.0 -85.0 -84.0 -83.0 -82.0 -81.0 -80.0 -79.0 -78.0 -77.0 -76.0 -75.0 -74.0 -73.0 -72.0 -71.0 -70.0 -69.0 -68.0 -67.0 -66.0 -65.0 -64.0 -63.0 -62.0 -61.0 -60.0 -59.0 -58.0 -57.0 -56.0 -55.0 -54.0 -53.0 -52.0 -51.0 -50.0 -49.0 -48.0 -47.0 -46.0 -45.0 -44.0 -43.0 -42.0 -41.0 -40.0 -39.0 -38.0 -37.0 -36.0 -35.0 -34.0 -33.0 -32.0 -31.0 -30.0 -29.0 -28.0 -27.0 -26.0 -25.0 -24.0 -23.0 -22.0 -21.0 -20.0 -19.0 -18.0 -17.0 -16.0 -15.0 -14.0 -13.0 -12.0 -11.0 -10.0 -9.0 -8.0 -7.0 -6.0 -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0]
|
||||
#define MONTH_LENGTH 8 // [6 7 8 9 10 11 12 13 14 15 16]
|
||||
#define CUSTOM_MOON_ROTATION
|
||||
#define EARTH_ROTATION_TILT 14.0 // [-45.0 -44.0 -43.0 -42.0 -41.0 -40.0 -39.0 -38.0 -37.0 -36.0 -35.0 -34.0 -33.0 -32.0 -31.0 -30.0 -29.0 -28.0 -27.0 -26.0 -25.0 -24.0 -23.0 -22.0 -21.0 -20.0 -19.0 -18.0 -17.0 -16.0 -15.0 -14.0 -13.0 -12.0 -11.0 -10.0 -9.0 -8.0 -7.0 -6.0 -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0]
|
||||
#define MOON_TIME_OFFSET 1000.0 // [0.0 500.0 1000.0 1500.0 2000.0 2500.0 3000.0 3500.0 4000.0 4500.0 5000.0 5500.0 6000.0 6500.0 7000.0 7500.0 8000.0 8500.0 9000.0 9500.0 10000.0 10500.0 11000.0 11500.0 12000.0 12500.0 13000.0 13500.0 14000.0 14500.0 15000.0 15500.0 16000.0 16500.0 17000.0 17500.0 18000.0 18500.0 19000.0 19500.0 20000.0 20500.0 21000.0 21500.0 22000.0 22500.0 23000.0 23500.0]
|
||||
#define STARS_AMOUNT 1.0 // [0.5 0.75 1.0 1.25 1.5 1.75 2.0]
|
||||
#define STARS_BRIGHTNESS 1.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
||||
#define MOONPHASE_BASED_MOONLIGHT
|
||||
uniform int moonPhase;
|
||||
// #define CAELUM_SUPPORT
|
||||
|
||||
#define END_LIGHT_POS vec3(0.0, 190.0, 0.0)
|
||||
#define END_LIGHT_FOV 77.0
|
||||
#define END_ISLAND_LIGHT
|
||||
|
||||
// const float shadowMapFov = 90.0;
|
||||
// const float shadowIntervalSize = 0.0;
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
#undef MOONPHASE_BASED_MOONLIGHT
|
||||
#endif
|
||||
|
||||
#if colortype == 1
|
||||
#define sunColorBase vec3(sunColorR,sunColorG,sunColorB) * sun_illuminance
|
||||
@@ -356,7 +384,8 @@ uniform int moonPhase;
|
||||
#define moonColorBase2 blackbody(Moon_temp) * moon_illuminance
|
||||
#define moonColorBase moonColorBase2 * moonlightbrightness
|
||||
#else
|
||||
#define moonColorBase blackbody(Moon_temp) * moon_illuminance
|
||||
#define moonColorBase2 blackbody(Moon_temp) * moon_illuminance
|
||||
#define moonColorBase moonColorBase2
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -594,8 +623,10 @@ uniform int moonPhase;
|
||||
|
||||
#define REMOVE_HAND_BLUR
|
||||
//#define FAR_BLUR_ONLY
|
||||
#define focal 2.4 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
||||
#define aperture 0.8 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
||||
#define focal 2.4 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95]
|
||||
#define fstop 2.8 // [1.0 1.4 1.8 2.0 2.2 2.5 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0 9.0 10.0 11.0 13.0 14.0 16.0 18.0 20.0 22.0]
|
||||
const float aperture = focal/fstop;
|
||||
// #define aperture 0.8 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95]
|
||||
#define MANUAL_FOCUS -2 // [-2 -1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 20 21 22 24 25 26 28 29 30 32 33 35 36 38 40 41 43 45 47 48 50 52 54 56 58 60 63 65 67 70 72 75 77 80 83 85 88 91 94 98 101 104 108 111 115 119 123 127 132 136 141 146 151 156 161 167 173 179 186 193 200 207 215 224 232 242 251 262 273 284 297 310 324 339 355 372 391 411 433 457 483 512]
|
||||
#define DoF_Adaptation_Speed 1.00 // [0.20 0.21 0.23 0.24 0.25 0.27 0.29 0.30 0.32 0.34 0.36 0.39 0.41 0.43 0.46 0.49 0.52 0.55 0.59 0.62 0.66 0.70 0.74 0.79 0.84 0.89 0.94 1.00 1.06 1.13 1.20 1.27 1.35 1.43 1.52 1.61 1.71 1.82 1.93 2.05 2.18 2.31 2.45 2.60 2.76 2.93 3.11 3.30 3.51 3.72 3.95 4.19 4.45 4.73 5.02 5.33 5.65 6.00]
|
||||
|
||||
@@ -901,12 +932,15 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
// Fix for making nether/end work until next Iris release to fix shadow matrices
|
||||
//#define LPV_NOSHADOW_HACK
|
||||
|
||||
#ifdef LPV_ENABLED
|
||||
#ifdef IRIS_FEATURE_CUSTOM_IMAGES
|
||||
#define IS_LPV_ENABLED
|
||||
#if defined LPV_ENABLED && defined IRIS_FEATURE_CUSTOM_IMAGES
|
||||
#define IS_LPV_ENABLED
|
||||
#endif
|
||||
|
||||
const float voxelDistance = 64.0;
|
||||
#endif
|
||||
#ifdef LPV_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION || defined IS_LPV_ENABLED
|
||||
const float voxelDistance = 64.0;
|
||||
#endif
|
||||
|
||||
// ruining parts of the effect to make it more like vanilla floodfill
|
||||
@@ -986,10 +1020,19 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#ifdef CUMULONIMBUS_LIGHTNING
|
||||
#endif
|
||||
|
||||
|
||||
// undefine every feature that won't work on mac
|
||||
#ifdef MC_OS_MAC
|
||||
#undef CUMULONIMBUS_LIGHTNING
|
||||
#undef REALMOON
|
||||
#define ShaderSnow 0
|
||||
#undef Puddles
|
||||
#undef DEFERRED_SPECULAR
|
||||
#undef CUSTOM_MOON_ROTATION
|
||||
#define LIGHTNING_SHADOWS 0
|
||||
#undef END_ISLAND_LIGHT
|
||||
#endif
|
||||
|
||||
#if CUMULONIMBUS == 0 && !defined CloudLayer0 && !defined CloudLayer1 && !defined CloudLayer2 && !defined CloudLayer3
|
||||
#undef VOLUMETRIC_CLOUDS
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@ vec3 drawMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeSt
|
||||
|
||||
float Shape = min(max(dot(WorldSunVec,PlayerPos)-0.9994,0.0)/(1.0-0.9994),1.0);// * clamp(-dot(WorldSunVec,PlayerPos),0,1);
|
||||
|
||||
occludeStars *= max(1.0-Shape*5,0.0);
|
||||
occludeStars *= max(1.0-Shape*5.0, 0.0);
|
||||
|
||||
return Shape * Color * 40.0;
|
||||
/*
|
||||
@@ -55,11 +55,11 @@ vec3 drawMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeSt
|
||||
return Shape * pow(clamp(dot(sunNormal,LightDir)/5,0.0,1.5),5) * Color * 10.0 + clamp(Shape * 4.0 * pow(shape2/200,2.0),0.0,1.0)*0.004;
|
||||
*/
|
||||
}
|
||||
vec3 drawRealMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeStars){
|
||||
vec3 drawRealMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeStars, float size){
|
||||
|
||||
float Shape = min(max(dot(WorldSunVec,PlayerPos)-0.9992,0.0)/(1.0-0.9992),1.0);// * clamp(-dot(WorldSunVec,PlayerPos),0,1);
|
||||
float Shape = min(max(dot(WorldSunVec,PlayerPos)-size,0.0)/(1.0-size),1.0);
|
||||
|
||||
occludeStars *= max(1.0-Shape*50,0.0);
|
||||
occludeStars *= max(1.0-Shape*50.0, 0.0);
|
||||
|
||||
return Shape * Color/4000 * 3.0;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
float invLinZ (float lindepth){
|
||||
return -((2.0*near/lindepth)-far-near)/(far-near);
|
||||
}
|
||||
float invLinZ (float lindepth){
|
||||
return -((2.0*near/lindepth)-far-near)/(far-near);
|
||||
}
|
||||
|
||||
float linZ(float depth) {
|
||||
return (2.0 * near) / (far + near - depth * (far - near));
|
||||
@@ -102,6 +102,26 @@ float shlickFresnelRoughness(float XdotN, float roughness){
|
||||
|
||||
return shlickFresnel;
|
||||
}
|
||||
|
||||
//vec2 directionToSphericalUV(vec3 direction) {
|
||||
// vec3 dir = normalize(direction);
|
||||
//
|
||||
// float phi = atan(dir.z, dir.x);
|
||||
// float theta = acos(clamp(dir.y, -1.0, 1.0));
|
||||
//
|
||||
// float u = (phi + 3.1415926535) / (2.0 * 3.1415926535);
|
||||
// float v = theta / 3.1415926535;
|
||||
// v = 1.0 - v;
|
||||
//
|
||||
// return vec2(clamp(u, 0.0, 1.0), clamp(v, 0.0, 1.0));
|
||||
//}
|
||||
//
|
||||
//#extension GL_NV_gpu_shader5 : enable
|
||||
//#extension GL_ARB_shader_image_load_store : enable
|
||||
//#extension GL_EXT_shader_image_load_store : enable
|
||||
//
|
||||
//layout (rgba32f) uniform image2D reflectionSphere;
|
||||
//
|
||||
#if defined DISTANT_HORIZONS && defined DH_SCREENSPACE_REFLECTIONS
|
||||
uniform vec4 combined_projection_matrix_0;
|
||||
uniform vec4 combined_projection_matrix_1;
|
||||
@@ -166,8 +186,8 @@ vec3 rayTraceSpeculars(vec3 dir, vec3 position, float dither, float quality, boo
|
||||
float sampleDepth = texelFetch2D(colortex12, ivec2(spos.xy/texelSize/div),0).a/65000.0;
|
||||
float sp = invertLinearizeDepthFast(sqrt(sampleDepth)*dhFarPlane);
|
||||
#else
|
||||
float sampleDepth = texelFetch2D(colortex4, ivec2(spos.xy/texelSize/4.0),0).a/65000.0;
|
||||
float sp = invLinZ(sqrt(sampleDepth));
|
||||
float sampleDepth = texelFetch2D(colortex4, ivec2(spos.xy/texelSize/4.0),0).a/65000.0;
|
||||
float sp = invLinZ(sqrt(sampleDepth));
|
||||
#endif
|
||||
|
||||
if(sp < max(minZ, maxZ) && sp > min(minZ, maxZ)) {
|
||||
@@ -222,7 +242,7 @@ vec4 screenSpaceReflections(
|
||||
#if defined OVERWORLD_SHADER
|
||||
reflection.a = raytracePos.z > 0.9999999 ? (isHand || isEyeInWater == 1 ? 1.0 : 0.0) : 1.0;
|
||||
#else
|
||||
reflection.a = 1.0;
|
||||
reflection.a = 1.0;
|
||||
#endif
|
||||
|
||||
#ifdef FORWARD_RENDERED_SPECULAR
|
||||
@@ -393,7 +413,9 @@ vec3 specularReflections(
|
||||
#if !defined OVERWORLD_SHADER && !defined FORWARD_SPECULAR
|
||||
vec3 backgroundReflection = volumetricsFromTex(reflectedVector_L, colortex4, roughness).rgb / 1200.0;
|
||||
#else
|
||||
//vec2 p = sphereToCarte(reflectedVector_L);
|
||||
vec3 backgroundReflection = skyCloudsFromTex(reflectedVector_L, colortex4).rgb / 1200.0;
|
||||
//vec3 backgroundReflection = imageLoad(reflectionSphere, ivec2(p)).rgb;
|
||||
|
||||
if(isEyeInWater == 1) backgroundReflection *= exp(-vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B) * 15.0)*2;
|
||||
#endif
|
||||
|
||||
@@ -44,5 +44,5 @@ float StableStarField( in vec3 vSamplePos, float fThreshhold )
|
||||
float stars(vec3 viewPos){
|
||||
|
||||
float stars = max(1.0 - StableStarField(viewPos*300.0 , 0.99),0.0);
|
||||
return STARS_BRIGHTNESS * exp( stars * -20.0 * (1/STARS_AMOUNT));
|
||||
return STARS_BRIGHTNESS * exp( stars * -20.0 * (1.0/STARS_AMOUNT));
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ uniform float thunderStrength;
|
||||
uniform int entityId;
|
||||
uniform int worldDay;
|
||||
uniform int worldTime;
|
||||
uniform float moonElevation;
|
||||
|
||||
#if CLOUD_MOVEMENT_TYPE == 0
|
||||
float cloud_movement = (worldTime + mod(worldDay,100)*24000.0) / 24.0 * Cloud_Speed;
|
||||
@@ -42,7 +43,7 @@ float lightningFlash = mix(0.1, 2.5, randomSeed);
|
||||
#endif
|
||||
|
||||
float rand(float co){
|
||||
vec2 co2 = vec2(co, co*2);
|
||||
vec2 co2 = vec2(co, co*2.0);
|
||||
|
||||
return fract(sin(dot(co2 ,vec2(12.9898,78.233))) * 43758.5453);
|
||||
}
|
||||
@@ -120,13 +121,13 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
if(LayerIndex == CIRRUS_LAYER){
|
||||
coverage = parameters.cirrus.x;
|
||||
|
||||
vec2 coord = position.zx + 6*cloud_movement;
|
||||
vec2 coord = position.zx + 6.0*cloud_movement;
|
||||
|
||||
vec2 curl = curl2D(0.00002 * coord) * 0.5
|
||||
+ curl2D(0.00005 * coord) * 0.25
|
||||
+ curl2D(0.00018 * coord) * 0.125;
|
||||
|
||||
largeCloud = texture2D(noisetex, (position.xz + cloud_movement*2)/80000. * CloudLayer3_scale).b;
|
||||
largeCloud = texture2D(noisetex, (position.xz + cloud_movement*2.0)/80000. * CloudLayer3_scale).b;
|
||||
smallCloud = texture2D(noisetex, (0.000005 / CloudLayer3_scale) * coord).r;
|
||||
|
||||
float detail_amplitude = 0.3;
|
||||
@@ -383,6 +384,18 @@ float getPlanetShadow(vec3 playerPos, vec3 WsunVec){
|
||||
|
||||
float GetCloudShadow(vec3 playerPos, vec3 sunVector){
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION && LIGHTNING_SHADOWS > 0
|
||||
#if LIGHTNING_SHADOWS < 2
|
||||
if (lightningBoltPosition.w > 0.0 && sunElevation < 0.0)
|
||||
#else
|
||||
if (lightningBoltPosition.w > 0.0)
|
||||
#endif
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
float totalShadow = getPlanetShadow(playerPos, sunVector);
|
||||
|
||||
vec3 startPosition = playerPos;
|
||||
@@ -421,9 +434,15 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){
|
||||
|
||||
#ifndef CLOUDSHADOWSONLY
|
||||
|
||||
// Henyey-Greenstein
|
||||
// float phaseCloud(float x, float g){
|
||||
// float gg = g * g;
|
||||
// return (gg * -0.25 + 0.25) * pow(-2.0 * (g * x) + (gg + 1.0), -1.5);
|
||||
// }
|
||||
|
||||
// Cornette-Shanks
|
||||
float phaseCloud(float x, float g){
|
||||
float gg = g * g;
|
||||
return (gg * -0.25 + 0.25) * pow(-2.0 * (g * x) + (gg + 1.0), -1.5) / 3.14;
|
||||
return (3.0 * (1.0 - g * g) * (1.0 + x * x)) / (4.0 * 3.14159265359 * 2.0 * (2.0 + g * g) * pow(1.0 + g * g - 2.0 * g * x, 3.0/2.0));
|
||||
}
|
||||
|
||||
float getCloudScattering(
|
||||
@@ -448,7 +467,11 @@ float getCloudScattering(
|
||||
|
||||
float sunVis = smoothstep(-0.06, 0.01, sunElevation);
|
||||
sunVis = sunVis * sunVis;
|
||||
float moonVis = smoothstep(-0.04, 0.015, -sunElevation);
|
||||
#if defined CAELUM_SUPPORT || !defined CUSTOM_MOON_ROTATION
|
||||
float moonVis = smoothstep(-0.04, 0.015, -moonElevation);
|
||||
#else
|
||||
float moonVis = smoothstep(0.08, -0.03, -moonVector.y);
|
||||
#endif
|
||||
moonVis = moonVis * moonVis;
|
||||
|
||||
float isLarge = 80;
|
||||
@@ -631,7 +654,7 @@ vec4 raymarchCloud(
|
||||
|
||||
if(LayerIndex == CUMULONIMBUS_LAYER) density = 0.8;
|
||||
|
||||
if (density == 0.0) return vec4(color, totalAbsorbance);
|
||||
if (density < 0.01) return vec4(color, totalAbsorbance);
|
||||
|
||||
float skylightOcclusion = 1.0;
|
||||
#if defined CloudLayer1 && defined CloudLayer0
|
||||
@@ -851,7 +874,7 @@ vec4 GetVolumetricClouds(
|
||||
NormPlayerPos.y += 0.03 * heightRelativeToClouds;
|
||||
#endif
|
||||
|
||||
float maxSamples = 25.0;
|
||||
float maxSamples = 20.0;
|
||||
float minSamples = 12.0;
|
||||
int samples = int(clamp(maxSamples / exp2(abs(NormPlayerPos.y)), minSamples, maxSamples));
|
||||
// int samples = 30;
|
||||
@@ -861,7 +884,7 @@ vec4 GetVolumetricClouds(
|
||||
vec3 cloudDist = vec3(1.0);
|
||||
|
||||
float cloudMix = clamp(smoothstep(minHeight - 400.0, minHeight + 45.0, cameraPosition.y),0.0,clamp(smoothstep(maxHeight + 300.0, maxHeight - 60.0, cameraPosition.y) ,0.0,1.0));
|
||||
cloudDist.xz = mix(vec2(255.0), vec2(12.0), cloudMix);
|
||||
cloudDist.xz = mix(vec2(255.0), vec2(5.5), cloudMix);
|
||||
|
||||
// vec3 rayDirection = NormPlayerPos.xyz * (cloudheight/abs(NormPlayerPos.y)/samples);
|
||||
vec3 rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)/samples);
|
||||
@@ -889,7 +912,11 @@ vec4 GetVolumetricClouds(
|
||||
|
||||
float sunVis = smoothstep(-0.06, 0.1, sunElevation);
|
||||
sunVis = sunVis * sunVis;
|
||||
float moonVis = smoothstep(-0.04, 0.015, -sunElevation);
|
||||
#if defined CAELUM_SUPPORT || !defined CUSTOM_MOON_ROTATION
|
||||
float moonVis = smoothstep(-0.04, 0.015, -moonElevation);
|
||||
#else
|
||||
float moonVis = smoothstep(0.08, -0.03, -moonVector.y);
|
||||
#endif
|
||||
|
||||
#if defined EXCLUDE_WRITE_TO_LUT && defined USE_CUSTOM_CLOUD_LIGHTING_COLORS
|
||||
directLightCol = dot(directLightCol,vec3(0.21, 0.72, 0.07)) * vec3(DIRECTLIGHT_CLOUDS_R,DIRECTLIGHT_CLOUDS_G,DIRECTLIGHT_CLOUDS_B);
|
||||
@@ -898,9 +925,9 @@ vec4 GetVolumetricClouds(
|
||||
#endif
|
||||
|
||||
///------- do color stuff outside of the raymarcher loop
|
||||
vec3 sunScattering = directLightCol * (phaseCloud(SdotV, 0.85) + phaseCloud(SdotV, 0.75)) * 3.14;
|
||||
vec3 sunScattering = directLightCol * (phaseCloud(SdotV, 0.85) + phaseCloud(SdotV, 0.75));
|
||||
vec3 sunMultiScattering = directLightCol;
|
||||
vec3 moonScattering = directLightCol2 * (phaseCloud(SdotV2, 0.85) + phaseCloud(SdotV2, 0.75)) * 3.14;
|
||||
vec3 moonScattering = directLightCol2 * (phaseCloud(SdotV2, 0.85) + phaseCloud(SdotV2, 0.75));
|
||||
vec3 moonMultiScattering = directLightCol2;
|
||||
vec3 skyScattering = indirectLightCol * (1.0 + sunVis);
|
||||
|
||||
@@ -933,7 +960,7 @@ vec4 GetVolumetricClouds(
|
||||
maxHeight = cloudheight + minHeight;
|
||||
|
||||
cloudMix = clamp(smoothstep(minHeight - 400.0, minHeight + 45.0, cameraPosition.y),0.0,clamp(smoothstep(maxHeight + 300.0, maxHeight - 60.0, cameraPosition.y) ,0.0,1.0));
|
||||
cloudDist.xz = mix(vec2(255.0), vec2(6.2), cloudMix);
|
||||
cloudDist.xz = mix(vec2(255.0), vec2(5.0), cloudMix);
|
||||
rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)/samples);
|
||||
rayPosition = getRayOrigin(rayDirection, cameraPosition, dither.y, minHeight, maxHeight);
|
||||
|
||||
@@ -951,17 +978,23 @@ vec4 GetVolumetricClouds(
|
||||
cloudheight = 4000;
|
||||
minHeight = 600;
|
||||
maxHeight = cloudheight + minHeight;
|
||||
int cumulonimbusSamples = int(1.5*samples);
|
||||
|
||||
cloudDist.xz = vec2(8.0);
|
||||
rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)/samples);
|
||||
rayDirection = NormPlayerPos.xyz * (cloudheight/length(NormPlayerPos.xyz/cloudDist)/cumulonimbusSamples);
|
||||
rayPosition = getRayOrigin(rayDirection, cameraPosition, dither.y, minHeight, maxHeight);
|
||||
|
||||
cumulonimbusClouds = raymarchCloud(CUMULONIMBUS_LAYER, samples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering2, sunMultiScattering2, moonScattering2, moonMultiScattering2, skyScattering, lViewPosM, sampledSkyCol, cloudLayer4_Distance);
|
||||
cumulonimbusClouds = raymarchCloud(CUMULONIMBUS_LAYER, cumulonimbusSamples, rayPosition, rayDirection, dither.x, minHeight, maxHeight, unsignedSunVec, unsignedMoonVec, sunScattering2, sunMultiScattering2, moonScattering2, moonMultiScattering2, skyScattering, lViewPosM, sampledSkyCol, cloudLayer4_Distance);
|
||||
}
|
||||
float cumulonimbusDistance = length(rayPosition - cameraPosition);
|
||||
#endif
|
||||
|
||||
moonVis = smoothstep(-0.04, 0.015, -sunElevation);
|
||||
#if defined CAELUM_SUPPORT || !defined CUSTOM_MOON_ROTATION
|
||||
moonVis = smoothstep(-0.04, 0.015, -moonElevation);
|
||||
#else
|
||||
moonVis = smoothstep(0.08, -0.03, -moonVector.y);
|
||||
#endif
|
||||
|
||||
moonScattering2 = moonScattering * moonVis;
|
||||
moonMultiScattering2 = moonMultiScattering * moonVis;
|
||||
|
||||
|
||||
+110
-62
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 4.3 MiB |
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define OVERWORLD_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define OVERWORLD_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 330 compatibility
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 330 compatibility
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 330 compatibility
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 330 compatibility
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENCHANT_GLINT
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENCHANT_GLINT
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define LINES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define LINES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BEACON_BEAM
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BEACON_BEAM
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define BLOCKENTITIES
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define BLOCKENTITIES
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BLOCKENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BLOCKENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define DAMAGE_BLOCK_EFFECT
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define DAMAGE_BLOCK_EFFECT
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define ENTITIES
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
|
||||
// #define WORLD
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define GLOWING
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define GLOWING
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define HAND
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define HAND
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define HAND
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define HAND
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#version 120
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define NETHER_SHADER
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user