mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-10 04:53:07 +08:00
Add voxy support (WIP), add smoother shader grass normals, fix https://github.com/Merlin1809/Eclipse-Shader/issues/32 , update chinese translation https://github.com/Merlin1809/Eclipse-Shader/issues/34
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ Credit to the translators:
|
||||
Ruri / nakiriruri (discord)
|
||||
YurgenS / yurgens (discord)
|
||||
CReepa / _CReepa_ (discord)
|
||||
|
||||
Huagege
|
||||
|
||||
|
||||
Credit to the people who inspired many changes and ideas, that you NEED to know about:
|
||||
|
||||
@@ -6,7 +6,7 @@ block.8=minecraft:water minecraft:flowing_water tfc:flowing_spring_water tfc:spr
|
||||
|
||||
block.11=bamboo bamboo_sapling
|
||||
|
||||
block.12=minecraft:short_grass
|
||||
block.12=minecraft:short_grass minecraft:grass
|
||||
|
||||
block.13=minecraft:small_dripleaf:half=lower minecraft:pitcher_plant:half=lower minecraft:tall_grass:half=lower minecraft:sunflower:half=lower minecraft:large_fern:half=lower minecraft:peony:half=lower minecraft:rose_bush:half=lower minecraft:lilac:half=lower minecraft:tall_seagrass:half=lower \
|
||||
biomesoplenty:sea_oats:half=lower biomesoplenty:tall_lavender:half=lower biomesoplenty:tall_white_lavender:half=lower biomesoplenty:watergrass:half=lower biomesoplenty:reed:half=lower biomesoplenty:cattail:half=lower biomesoplenty:barley:half=lower biomesoplenty:icy_iris:half=lower biomesoplenty:goldenrod:half=lower biomesoplenty:eyebulb:half=lower biomesoplenty:blue_hydrangea:half=lower \
|
||||
|
||||
@@ -48,8 +48,8 @@ varying vec2 lightmapCoords;
|
||||
flat varying int isWater;
|
||||
|
||||
// uniform float far;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
uniform vec3 previousCameraPosition;
|
||||
// uniform vec3 cameraPosition;
|
||||
@@ -102,17 +102,17 @@ float ld(float dist) {
|
||||
}
|
||||
|
||||
// float DH_ld(float dist) {
|
||||
// return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
// return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
// }
|
||||
// float DH_invLinZ (float lindepth){
|
||||
// return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
// return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
// }
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * near) / (dhFarPlane + near - dist * (dhFarPlane - near));
|
||||
return (2.0 * near) / (dhVoxyFarPlane + near - dist * (dhVoxyFarPlane - near));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -164,7 +164,7 @@ uniform int framemod8;
|
||||
#include "/lib/TAA_jitter.glsl"
|
||||
|
||||
float invLdFast(float linearDepth) {
|
||||
return (dhFarPlane * (dhNearPlane - linearDepth)) / ((dhNearPlane - dhFarPlane) * linearDepth);
|
||||
return (dhVoxyFarPlane * (dhVoxyNearPlane - linearDepth)) / ((dhVoxyNearPlane - dhVoxyFarPlane) * linearDepth);
|
||||
}
|
||||
|
||||
#define FORWARD_SSR_QUALITY 30 // [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 200 300 400 500]
|
||||
@@ -176,11 +176,16 @@ vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
float quality = float(FORWARD_SSR_QUALITY);
|
||||
vec3 clipPosition = DH_toClipSpace3(position);
|
||||
|
||||
float rayLength = ((position.z + dir.z * dhFarPlane*sqrt(3.)) > -dhNearPlane) ?
|
||||
(-dhNearPlane - position.z) / dir.z : dhFarPlane*sqrt(3.);
|
||||
float rayLength = ((position.z + dir.z * dhVoxyFarPlane*sqrt(3.)) > -dhVoxyNearPlane) ?
|
||||
(-dhVoxyNearPlane - position.z) / dir.z : dhVoxyFarPlane*sqrt(3.);
|
||||
|
||||
vec3 direction = DH_toClipSpace3(position + dir * rayLength) - clipPosition; //convert to clip space
|
||||
|
||||
#if FORWARD_SSR_QUALITY == 1
|
||||
vec3 reflectedTC = vec3((direction.xy + clipPosition.xy) * RENDER_SCALE, 0.999999);
|
||||
return reflectedTC;
|
||||
#endif
|
||||
|
||||
//get at which length the ray intersects with the edge of the screen
|
||||
vec3 maxLengths = (step(0.0, direction) - clipPosition) / direction;
|
||||
float mult = min(min(maxLengths.x, maxLengths.y), maxLengths.z);
|
||||
@@ -201,7 +206,7 @@ vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
#endif
|
||||
|
||||
float sampleDepth = sqrt(texelFetch2D(colortex12, ivec2(spos.xy / (texelSize * 4.0)), 0).a / 65000.0);
|
||||
float sp = invLdFast(sampleDepth*dhFarPlane);
|
||||
float sp = invLdFast(sampleDepth*dhVoxyFarPlane);
|
||||
|
||||
if (sp < max(minZ, maxZ) && sp > min(minZ, maxZ)) {
|
||||
return vec3(spos.xy / RENDER_SCALE, sp);
|
||||
@@ -290,7 +295,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
vec3 viewPos = pos.xyz;
|
||||
vec3 playerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz;
|
||||
float viewDist = length(playerPos);
|
||||
float transition = exp(-25* pow(clamp(1.0 - viewDist/(far-8),0.0,1.0),2));
|
||||
// float transition = exp(-25* pow(clamp(1.0 - viewDist/(far-8),0.0,1.0),2));
|
||||
|
||||
#if DH_CHUNK_FADING > 0
|
||||
if (!iswater){
|
||||
|
||||
@@ -105,7 +105,7 @@ void main() {
|
||||
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
|
||||
@@ -101,13 +101,10 @@ void main() {
|
||||
vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz;
|
||||
|
||||
#ifdef WEATHER
|
||||
worldpos += cameraPosition;
|
||||
bool istopv = worldpos.y > cameraPosition.y + 5.0 && lmtexcoord.w > 0.99;
|
||||
bool istopv = worldpos.y > 5.0 && lmtexcoord.w > 0.99;
|
||||
|
||||
if(!istopv){
|
||||
worldpos.xyz -= cameraPosition - vec3(2.0,0.0,2.0) * min(max(clamp(eyeBrightnessSmooth.y/240.0,0,1)-0.95,0)/0.05,1);
|
||||
}else{
|
||||
worldpos.xyz -= cameraPosition;
|
||||
worldpos += vec3(2.0,0.0,2.0) * min(max(clamp(eyeBrightnessSmooth.y/240.0,0,1)-0.95,0)/0.05,1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -145,7 +142,7 @@ void main() {
|
||||
WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||
#endif
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -385,8 +385,12 @@ void main() {
|
||||
if(!ifPOM) maxdist = 0.0;
|
||||
|
||||
gl_FragDepth = gl_FragCoord.z;
|
||||
if (falloff > 0.0 && ISSHADERGRASS == 0) {
|
||||
|
||||
#ifdef SHADER_GRASS
|
||||
if (falloff > 0.0 && ISSHADERGRASS == 0)
|
||||
#else
|
||||
if (falloff > 0.0)
|
||||
#endif
|
||||
{
|
||||
float depthmap = readNormal(texcoord.st).a;
|
||||
float used_POM_DEPTH = 1.0;
|
||||
float pomdepth = POM_DEPTH*falloff;
|
||||
@@ -437,7 +441,12 @@ void main() {
|
||||
|
||||
#ifndef COLORWHEEL
|
||||
vec4 Albedo = color;
|
||||
if (ISSHADERGRASS < 1) Albedo *= texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD);
|
||||
#ifdef SHADER_GRASS
|
||||
if (ISSHADERGRASS < 1)
|
||||
#endif
|
||||
{
|
||||
Albedo *= texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD);
|
||||
}
|
||||
#else
|
||||
vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD);
|
||||
vec4 overlayColor;
|
||||
@@ -504,7 +513,7 @@ void main() {
|
||||
#if defined WORLD && !defined ENTITIES && !defined HAND
|
||||
float endPortalEmission = 0.0;
|
||||
if(PORTAL > 0) {
|
||||
float steps = 20;
|
||||
const float steps = 20;
|
||||
|
||||
vec3 color = vec3(0.0);
|
||||
float absorbance = 1.0;
|
||||
@@ -619,7 +628,10 @@ void main() {
|
||||
//////////////////////////////// ////////////////////////////////
|
||||
|
||||
#if defined WORLD && defined MC_NORMAL_MAP
|
||||
if(ISSHADERGRASS < 1) {
|
||||
#ifdef SHADER_GRASS
|
||||
if(ISSHADERGRASS < 1)
|
||||
#endif
|
||||
{
|
||||
vec4 NormalTex = texture2D_POMSwitch(normals, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM,textureLOD).xyzw;
|
||||
|
||||
#ifdef MATERIAL_AO
|
||||
@@ -641,9 +653,13 @@ void main() {
|
||||
|
||||
#ifdef WORLD
|
||||
vec4 SpecularTex = vec4(0.0);
|
||||
#ifdef SHADER_GRASS
|
||||
if (ISSHADERGRASS > 0) {
|
||||
SpecularTex = vec4(0.15, 0.025, 1.0, 0.0);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
SpecularTex = texture2D_POMSwitch(specular, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM,textureLOD);
|
||||
}
|
||||
|
||||
@@ -711,7 +727,10 @@ void main() {
|
||||
normal = viewToWorld(normal);
|
||||
|
||||
vec3 flatNormals = viewToWorld(FlatNormals);
|
||||
|
||||
#ifdef SHADER_GRASS
|
||||
if (ISSHADERGRASS > 0) {flatNormals = FlatNormals; normal = GrassNormals;}
|
||||
#endif
|
||||
|
||||
vec4 data1 = clamp( encode(normal, PackLightmaps), 0.0, 1.0);
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
layout(triangles) in;
|
||||
#if !defined ENTITIES && !defined HAND
|
||||
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
#if !defined ENTITIES && !defined HAND && defined SHADER_GRASS && !defined COLORWHEEL
|
||||
layout(triangle_strip, max_vertices = 24) out;
|
||||
#else
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
@@ -71,7 +74,6 @@ uniform int hideGUI;
|
||||
uniform float aspectRatio;
|
||||
uniform float screenBrightness;
|
||||
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/TAA_jitter.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
#include "/lib/bokeh.glsl"
|
||||
@@ -285,7 +287,11 @@ void main() {
|
||||
|
||||
worldUp *= heightMult;
|
||||
|
||||
originalVertex -= right*0.25*GRASS_BASE_THICKNESS;
|
||||
originalVertex -= right*0.0625*GRASS_BASE_THICKNESS;
|
||||
|
||||
vec3 verticies[21];
|
||||
float grassHeights[21];
|
||||
vec3 GrassNormal[7];
|
||||
|
||||
for (j = 0; j < triangle_count; j++) {
|
||||
|
||||
@@ -312,17 +318,10 @@ void main() {
|
||||
worldOffset2
|
||||
);
|
||||
|
||||
float grassHeight0 = 0.125 * worldOffset0.y;
|
||||
float grassHeight1 = 0.125 * worldOffset1.y;
|
||||
float grassHeight2 = 0.125 * worldOffset2.y;
|
||||
grassHeights[3*j] = 0.125 * worldOffset0.y;
|
||||
grassHeights[3*j+1] = 0.125 * worldOffset1.y;
|
||||
grassHeights[3*j+2] = 0.125 * worldOffset2.y;
|
||||
|
||||
float grassHeights[3] = float[](
|
||||
grassHeight0,
|
||||
grassHeight1,
|
||||
grassHeight2
|
||||
);
|
||||
|
||||
vec3 verticies[3];
|
||||
|
||||
vec2 totalRandBend = GRASS_RANDOMNESS*randomDir + edgeBlend;
|
||||
|
||||
@@ -331,7 +330,7 @@ void main() {
|
||||
vec3 worldOffset = worldOffsets[i];
|
||||
vertex = originalVertex;
|
||||
|
||||
float grassCurvature = smoothstep(0.0, 1.0, grassHeights[i]);
|
||||
float grassCurvature = smoothstep(0.0, 1.0, grassHeights[3*j+i]);
|
||||
|
||||
vertex.xz += 0.7*playerDist*vec2(dir2)*grassCurvature;
|
||||
|
||||
@@ -339,16 +338,19 @@ void main() {
|
||||
|
||||
vertex += 1.6*calcMovePlants(vertex + cameraPosition)*grassCurvature*grassCurvature;
|
||||
|
||||
verticies[i] = vertex + 0.125 * worldOffset;
|
||||
verticies[3*j+i] = vertex + 0.125 * worldOffset;
|
||||
}
|
||||
|
||||
vec3 GrassNormal = calculateNormal(verticies[0], verticies[1], verticies[2]);
|
||||
GrassNormal[j] = calculateNormal(verticies[3*j], verticies[3*j+1], verticies[3*j+2]);
|
||||
|
||||
}
|
||||
|
||||
for (j = 0; j < triangle_count; j++) {
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
||||
|
||||
gl_Position = toClipSpace3(mat3(gbufferModelView) * (verticies[i]) + gbufferModelView[3].xyz);
|
||||
gl_Position = toClipSpace3(mat3(gbufferModelView) * (verticies[3*j+i]) + gbufferModelView[3].xyz);
|
||||
|
||||
#ifdef TAA_UPSCALING
|
||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
||||
@@ -382,7 +384,7 @@ void main() {
|
||||
gl_Position.xy += hideGUI >= 1 ? totalOffset : vec2(0);
|
||||
#endif
|
||||
|
||||
float heightfade = smoothstep(-0.35, 1.0, grassHeights[i]);
|
||||
float heightfade = smoothstep(-0.35, 1.0, grassHeights[3*j+i]);
|
||||
|
||||
// vec3 podzolColor = mix(vec3(0.15, 0.26, 0.01), vec3(168, 158, 91)/255., heightfade);
|
||||
|
||||
@@ -402,12 +404,15 @@ void main() {
|
||||
tangent = vtangent[i];
|
||||
// FlatNormals = vFlatNormals[i];
|
||||
|
||||
FlatNormals = GrassNormal;
|
||||
FlatNormals = GrassNormal[j];
|
||||
|
||||
// TODO: MAKE SMOOTH NORMALS
|
||||
GrassNormals = GrassNormal;
|
||||
heightfade = smoothstep(0.1, grassHeights[triangle_count], grassHeights[3*j+i]);
|
||||
GrassNormals = normalize(mix(GrassNormal[0], GrassNormal[triangle_count-1], vec3(heightfade)));
|
||||
#endif
|
||||
|
||||
|
||||
normalize(mix(GrassNormal[0], GrassNormal[triangle_count-1], vec3(heightfade)));
|
||||
|
||||
blockID = vblockID[i];
|
||||
NameTags = vNameTags[i];
|
||||
SSSAMOUNT = 1.0;
|
||||
|
||||
@@ -134,8 +134,8 @@ uniform float waterEnteredAltitude;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
#include "/lib/Shadow_Params.glsl"
|
||||
|
||||
@@ -270,7 +270,7 @@ void main() {
|
||||
|
||||
WsunVec = mix(WmoonVec, WsunVec, clamp(lightCol.a,0,1));
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,12 +44,11 @@ const ivec3 workGroups = ivec3(1, 1, 1);
|
||||
#include "/lib/SSBOs.glsl"
|
||||
uniform vec3 cameraPosition;
|
||||
#if defined END_ISLAND_LIGHT && defined END_SHADER
|
||||
float NEAR = 15.0;
|
||||
float FAR = 256.0;
|
||||
const float NEAR = 15.0;
|
||||
const float FAR = 256.0;
|
||||
|
||||
mat4 createPerspectiveMatrix() {
|
||||
float fov = END_LIGHT_FOV;
|
||||
float yScale = 1.0 / tan(radians(fov) * 0.5);
|
||||
float yScale = 1.0 / tan(radians(END_LIGHT_FOV) * 0.5);
|
||||
|
||||
return mat4(
|
||||
yScale, 0.0, 0.0, 0.0,
|
||||
|
||||
@@ -17,6 +17,15 @@ uniform sampler2D depthtex1;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex1;
|
||||
@@ -68,8 +77,8 @@ uniform float viewHeight;
|
||||
|
||||
// uniform float far;
|
||||
uniform float near;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
#include "/lib/Shadows.glsl"
|
||||
|
||||
@@ -230,10 +239,10 @@ vec2 CleanSample(
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -286,8 +295,8 @@ vec2 SSAO(
|
||||
|
||||
float sampleDepth = convertHandDepth_2(texelFetch2D(depthtex1, offsetUV, 0).x, hand);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float sampleDHDepth = texelFetch2D(dhDepthTex1, offsetUV, 0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float sampleDHDepth = texelFetch2D(dhVoxyDepthTex1, offsetUV, 0).x;
|
||||
vec3 offsetViewPos = toScreenSpace_DH((offsetUV*texelSize - jitterOffsets) * (1.0/RENDER_SCALE), sampleDepth, sampleDHDepth);
|
||||
#else
|
||||
vec3 offsetViewPos = toScreenSpace(vec3((offsetUV*texelSize - jitterOffsets) * (1.0/RENDER_SCALE), sampleDepth));
|
||||
@@ -377,9 +386,12 @@ void main() {
|
||||
float z = texelFetch2D(depthtex1,ivec2(gl_FragCoord.xy),0).x;
|
||||
float z0 = texelFetch2D(depthtex0,ivec2(gl_FragCoord.xy),0).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_depth1 = texelFetch2D(dhDepthTex1,ivec2(gl_FragCoord.xy),0).x;
|
||||
float DH_depth0 = texelFetch2D(dhDepthTex,ivec2(gl_FragCoord.xy),0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_depth1 = texelFetch2D(dhVoxyDepthTex1,ivec2(gl_FragCoord.xy),0).x;
|
||||
float DH_depth0 = texelFetch2D(dhVoxyDepthTex,ivec2(gl_FragCoord.xy),0).x;
|
||||
#ifdef VOXY
|
||||
DH_depth0 = min(DH_depth1, DH_depth0);
|
||||
#endif
|
||||
float swappedDepth = z >= 1.0 ? DH_depth1 : z;
|
||||
#else
|
||||
float DH_depth1 = 1.0;
|
||||
@@ -392,29 +404,29 @@ void main() {
|
||||
float depth = z;
|
||||
float depth0 = z0;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float _near = near;
|
||||
float _far = far*4.0;
|
||||
if (depth >= 1.0) {
|
||||
depth = DH_depth1;
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
depth = linearizeDepthFast(depth, _near, _far);
|
||||
depth = depth / dhFarPlane;
|
||||
depth = depth / dhVoxyFarPlane;
|
||||
|
||||
_near = near;
|
||||
_far = far*4.0;
|
||||
|
||||
if (depth0 >= 1.0) {
|
||||
depth0 = DH_depth0;
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
depth0 = linearizeDepthFast(depth0, _near, _far);
|
||||
depth0 = depth0 / dhFarPlane;
|
||||
depth0 = depth0 / dhVoxyFarPlane;
|
||||
#endif
|
||||
|
||||
if(depth < 1.0 || depth0 < 1.0)
|
||||
|
||||
@@ -101,6 +101,15 @@ uniform sampler2D depthtex2;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex0; //clouds
|
||||
@@ -140,8 +149,8 @@ uniform bool firstPersonCamera;
|
||||
// uniform float far;
|
||||
uniform float near;
|
||||
uniform float farPlane;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
flat varying vec3 zMults;
|
||||
|
||||
@@ -252,11 +261,11 @@ vec2 decodeVec2(float a){
|
||||
return fract( a * constant1 ) * constant2 ;
|
||||
}
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -396,8 +405,8 @@ float swapperlinZ(float depth, float _near, float _far) {
|
||||
// float _near = near; float _far = far*4.0;
|
||||
|
||||
// if (depthCheck) {
|
||||
// _near = dhNearPlane;
|
||||
// _far = dhFarPlane;
|
||||
// _near = dhVoxyNearPlane;
|
||||
// _far = dhVoxyFarPlane;
|
||||
// }
|
||||
|
||||
|
||||
@@ -458,8 +467,8 @@ vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, boo
|
||||
float _near = near; float _far = far*4.0;
|
||||
|
||||
if (depthCheck) {
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
vec3 position = toClipSpace3_DH(viewPos, depthCheck) ;
|
||||
@@ -485,8 +494,8 @@ vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, boo
|
||||
|
||||
float sampleDepth = convertHandDepth_2(texelFetch2D(depthtex1, ivec2(newPos.xy/texelSize),0).x,hand);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
if(depthCheck) sampleDepth = texelFetch2D(dhDepthTex1, ivec2(newPos.xy/texelSize),0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
if(depthCheck) sampleDepth = texelFetch2D(dhVoxyDepthTex1, ivec2(newPos.xy/texelSize),0).x;
|
||||
#endif
|
||||
|
||||
if(sampleDepth < newPos.z){
|
||||
@@ -524,8 +533,8 @@ float SSRT_FlashLight_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, floa
|
||||
float _near = near; float _far = far*4.0;
|
||||
|
||||
if (depthCheck) {
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
vec3 position = toClipSpace3_DH(viewPos, depthCheck) ;
|
||||
@@ -549,8 +558,8 @@ float SSRT_FlashLight_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, floa
|
||||
|
||||
float samplePos = texelFetch2D(depthtex2, ivec2(newPos.xy/texelSize).xy,0).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
if(depthCheck) samplePos = texelFetch2D(dhDepthTex1, ivec2(newPos.xy/texelSize),0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
if(depthCheck) samplePos = texelFetch2D(dhVoxyDepthTex1, ivec2(newPos.xy/texelSize),0).x;
|
||||
#endif
|
||||
|
||||
if(samplePos < newPos.z && samplePos > 0.0){// && (samplePos <= max(minZ,maxZ) && samplePos >= min(minZ,maxZ))){
|
||||
@@ -598,7 +607,7 @@ void doEdgeAwareBlur(
|
||||
);
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float offsetDepth = sqrt(texelFetch2D(depth, UV + OFFSET[i] + UV_NOISE,0).z/65000.0);
|
||||
#else
|
||||
float offsetDepth = ld(convertHandDepth_2(texelFetch2D(depth, UV + OFFSET[i] + UV_NOISE, 0).r,hand));
|
||||
@@ -632,7 +641,7 @@ vec4 BilateralUpscale_VLFOG(sampler2D tex, sampler2D depth, float referenceDepth
|
||||
vec4 colorSum = vec4(0.0);
|
||||
float edgeSum = 0.0;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float threshold = referenceDepth * mix(0.5, 0.05, min(max(0.1 - referenceDepth,0)/0.1,1));
|
||||
#else
|
||||
float threshold = referenceDepth * 0.05;
|
||||
@@ -664,7 +673,7 @@ vec4 BilateralUpscale_VLFOG(sampler2D tex, sampler2D depth, float referenceDepth
|
||||
);
|
||||
|
||||
for(int i = 0; i < samples; i++) {
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float offsetDepth = sqrt(texelFetch2D(depth, UV_DEPTH + (OFFSET[i] + UV_NOISE) * SCALE,0).a/65000.0);
|
||||
#else
|
||||
float offsetDepth = ld(texelFetch2D(depth, UV_DEPTH + (OFFSET[i] + UV_NOISE) * SCALE, 0).r);
|
||||
@@ -929,19 +938,25 @@ void main() {
|
||||
float z = texelFetch2D(depthtex1, ivec2(gl_FragCoord.xy), 0).x;
|
||||
float swappedDepth = z;
|
||||
|
||||
|
||||
|
||||
bool isDHrange = z >= 1.0;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_mixedLinearZ = sqrt(texelFetch2D(colortex12,ivec2(gl_FragCoord.xy), 0).z/65000.0);
|
||||
float DH_depth0 = texelFetch2D(dhDepthTex,ivec2(gl_FragCoord.xy), 0).x;
|
||||
float DH_depth1 = texelFetch2D(dhDepthTex1,ivec2(gl_FragCoord.xy), 0).x;
|
||||
float DH_depth0 = texelFetch2D(dhVoxyDepthTex,ivec2(gl_FragCoord.xy), 0).x;
|
||||
float DH_depth1 = texelFetch2D(dhVoxyDepthTex1,ivec2(gl_FragCoord.xy), 0).x;
|
||||
|
||||
#ifdef VOXY
|
||||
DH_depth0 = min(DH_depth0, DH_depth1);
|
||||
#endif
|
||||
|
||||
float depthOpaque = z;
|
||||
float depthOpaqueL = linearizeDepthFast(depthOpaque, near, farPlane);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float dhDepthOpaque = DH_depth1;
|
||||
float dhDepthOpaqueL = linearizeDepthFast(dhDepthOpaque, dhNearPlane, dhFarPlane);
|
||||
float dhDepthOpaqueL = linearizeDepthFast(dhDepthOpaque, dhVoxyNearPlane, dhVoxyFarPlane);
|
||||
|
||||
if (depthOpaque >= 1.0 || (dhDepthOpaqueL < depthOpaqueL && dhDepthOpaque > 0.0)){
|
||||
depthOpaque = dhDepthOpaque;
|
||||
@@ -987,7 +1002,7 @@ void main() {
|
||||
float LabSSS = clamp((-65.0 + SpecularTex.z * 255.0) / 190.0 ,0.0,1.0);
|
||||
// LabSSS = 1;
|
||||
|
||||
vec4 normalAndAO = texture2D(colortex15,texcoord);
|
||||
vec4 normalAndAO = texelFetch2D(colortex15, ivec2(gl_FragCoord.xy), 0);
|
||||
vec3 FlatNormals = normalize(normalAndAO.rgb * 2.0 - 1.0);
|
||||
vec3 slopednormal = normal;
|
||||
|
||||
@@ -1012,7 +1027,7 @@ void main() {
|
||||
// 0.9 = entity mask
|
||||
// 0.8 = reflective entities
|
||||
// 0.7 = reflective blocks
|
||||
float translucentMasks = texture2D(colortex7, texcoord).a;
|
||||
float translucentMasks = texelFetch2D(colortex7, ivec2(gl_FragCoord.xy), 0).a;
|
||||
|
||||
bool isWater = translucentMasks > 0.99;
|
||||
// bool isReflectiveEntity = abs(translucentMasks - 0.8) < 0.01;
|
||||
@@ -1033,7 +1048,7 @@ void main() {
|
||||
convertHandDepth(z0);
|
||||
}
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
vec3 viewPos = toScreenSpace_DH(texcoord/RENDER_SCALE - TAA_Offset*texelSize*0.5, z, DH_depth1);
|
||||
#else
|
||||
vec3 viewPos = toScreenSpace(vec3(texcoord/RENDER_SCALE - TAA_Offset*texelSize*0.5, z));
|
||||
@@ -1127,7 +1142,7 @@ void main() {
|
||||
|
||||
feetPlayerPos += gbufferModelViewInverse[3].xyz;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
vec3 playerPos0 = mat3(gbufferModelViewInverse) * toScreenSpace_DH(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5, z0, DH_depth0) + gbufferModelViewInverse[3].xyz;
|
||||
#else
|
||||
vec3 playerPos0 = mat3(gbufferModelViewInverse) * toScreenSpace(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z0)) + gbufferModelViewInverse[3].xyz;
|
||||
@@ -1178,7 +1193,7 @@ void main() {
|
||||
/////////////////////////////////// FILTER STUFF //////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined DISTANT_HORIZONS && defined DH_AMBIENT_OCCLUSION
|
||||
#if (defined DISTANT_HORIZONS || defined VOXY) && defined DH_AMBIENT_OCCLUSION
|
||||
doEdgeAwareBlur(colortex3, colortex14, colortex12, DH_mixedLinearZ, hand, SSAO_SSS, filteredShadow);
|
||||
#else
|
||||
doEdgeAwareBlur(colortex3, colortex14, depthtex0, ld(z0), hand, SSAO_SSS, filteredShadow);
|
||||
@@ -1280,7 +1295,7 @@ void main() {
|
||||
float sunSSS_density = LabSSS;
|
||||
float SSS_shadow = ShadowAlpha;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance, max(far-32.0,32.0)),0.0)*5.0,1.0));
|
||||
#endif
|
||||
|
||||
@@ -1698,7 +1713,7 @@ void main() {
|
||||
// water absorbtion will impact ALL light coming up from terrain underwater.
|
||||
gl_FragData[0].rgb *= Absorbtion;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_mixedLinearZ = sqrt(texelFetch2D(colortex12,ivec2(gl_FragCoord.xy),0).a/65000.0);
|
||||
vec4 vlBehingTranslucents = BilateralUpscale_VLFOG(colortex13, colortex12, DH_mixedLinearZ);
|
||||
#else
|
||||
|
||||
@@ -94,7 +94,7 @@ void main() {
|
||||
|
||||
// exposure = texelFetch2D(colortex4,ivec2(10,37),0).r;
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
|
||||
#ifdef TAA
|
||||
TAA_Offset = offsets[framemod8];
|
||||
|
||||
@@ -64,9 +64,15 @@ float ld(float depth) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#endif
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhFarPlane;
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
#endif
|
||||
uniform float dhVoxyNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
return (near * far) / (depth * (near - far) + far);
|
||||
@@ -332,14 +338,14 @@ void main() {
|
||||
#endif
|
||||
float depth = texture(depthtex0, texcoord).r;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float _near = near;
|
||||
float _far = far*4.0;
|
||||
|
||||
if (depth >= 1.0) {
|
||||
depth = texture2D(dhDepthTex, texcoord).x;
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
depth = texture2D(dhVoxyDepthTex, texcoord).x;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
depth = linearizeDepthFast(depth, _near, _far);
|
||||
|
||||
@@ -20,6 +20,15 @@ uniform sampler2D depthtex1;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex0;
|
||||
@@ -38,8 +47,8 @@ uniform float sunElevation;
|
||||
|
||||
// uniform float far;
|
||||
uniform float near;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
uniform mat4 gbufferPreviousModelView;
|
||||
uniform vec3 previousCameraPosition;
|
||||
@@ -66,7 +75,7 @@ uniform ivec2 eyeBrightnessSmooth;
|
||||
uniform float eyeAltitude;
|
||||
uniform float caveDetection;
|
||||
|
||||
// uniform int dhRenderDistance;
|
||||
// uniform int dhVoxyRenderDistance;
|
||||
#define DHVLFOG
|
||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
||||
@@ -82,10 +91,10 @@ uniform float caveDetection;
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -418,8 +427,8 @@ vec4 raymarchTest(
|
||||
float minHeight = 250.0;
|
||||
float maxHeight = minHeight + 100.0;
|
||||
|
||||
#if defined DISTANT_HORIZONS
|
||||
float maxdist = dhFarPlane - 16.0;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float maxdist = dhVoxyFarPlane - 16.0;
|
||||
#else
|
||||
float maxdist = far*4;
|
||||
#endif
|
||||
@@ -515,8 +524,12 @@ void main() {
|
||||
|
||||
float z0 = depth < 0.56 ? convertHandDepth(depth) : depth;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, texcoord,0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_z0 = texelFetch2D(dhVoxyDepthTex, texcoord,0).x;
|
||||
#ifdef VOXY
|
||||
float DH_z1= texelFetch2D(dhVoxyDepthTex1, texcoord,0).x;
|
||||
DH_z0 = min(DH_z0, DH_z1);
|
||||
#endif
|
||||
#else
|
||||
float DH_z0 = 0.0;
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,7 @@ void main() {
|
||||
averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
|
||||
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef NETHER_SHADER
|
||||
|
||||
@@ -17,6 +17,15 @@ uniform sampler2D depthtex1;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex0;
|
||||
@@ -48,8 +57,8 @@ uniform int frameCounter;
|
||||
uniform float far;
|
||||
uniform float near;
|
||||
uniform float farPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
|
||||
uniform mat4 gbufferModelViewInverse;
|
||||
uniform mat4 gbufferModelView;
|
||||
@@ -61,7 +70,7 @@ uniform vec3 cameraPosition;
|
||||
uniform vec3 previousCameraPosition;
|
||||
|
||||
uniform int hideGUI;
|
||||
uniform int dhRenderDistance;
|
||||
uniform int dhVoxyRenderDistance;
|
||||
uniform int isEyeInWater;
|
||||
uniform ivec2 eyeBrightnessSmooth;
|
||||
uniform ivec2 eyeBrightness;
|
||||
@@ -130,7 +139,12 @@ float convertHandDepth(float depth) {
|
||||
}
|
||||
|
||||
float linearize(float dist) {
|
||||
return (2.0 * near) / (far + near - dist * (far - near));
|
||||
#ifdef VOXY
|
||||
float _far = far * 3000.0;
|
||||
#else
|
||||
float _far = far;
|
||||
#endif
|
||||
return (2.0 * near) / (_far + near - dist * (_far - near));
|
||||
}
|
||||
|
||||
float luma(vec3 color) {
|
||||
@@ -192,11 +206,11 @@ vec3 normVec (vec3 vec){
|
||||
}
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -314,8 +328,8 @@ vec3 toClipSpace3Prev(vec3 viewSpacePosition) {
|
||||
|
||||
vec3 toClipSpace3Prev_DH( vec3 viewSpacePosition, bool depthCheck ) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
mat4 projectionMatrix = depthCheck ? dhPreviousProjection : gbufferPreviousProjection;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
mat4 projectionMatrix = depthCheck ? dhVoxyProjectionPrev : gbufferPreviousProjection;
|
||||
return projMAD(projectionMatrix, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
#else
|
||||
return projMAD(gbufferPreviousProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
@@ -326,7 +340,7 @@ vec4 bilateralUpsample(out float outerEdgeResults, float referenceDepth, sampler
|
||||
|
||||
vec4 colorSum = vec4(0.0);
|
||||
float edgeSum = 0.0;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float threshold = 0.05;
|
||||
#else
|
||||
float threshold = 0.005;
|
||||
@@ -360,7 +374,7 @@ vec4 bilateralUpsample(out float outerEdgeResults, float referenceDepth, sampler
|
||||
|
||||
for(int i = 0; i < samples; i++) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float offsetDepth = sqrt(texelFetch2D(depth, UV_DEPTH + (OFFSET[i] + UV_NOISE) * SCALE,0).z/65000.0);
|
||||
#else
|
||||
float offsetDepth = linearize(texelFetch2D(depth, UV_DEPTH + (OFFSET[i] + UV_NOISE) * SCALE, 0).r);
|
||||
@@ -511,8 +525,8 @@ 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) );
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float borderFogDensity = smoothstep(1.0, 0.0, min(max(1.0 - linearDistance / dhVoxyRenderDistance,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
|
||||
@@ -542,13 +556,17 @@ void main() {
|
||||
|
||||
float swappedDepth = z;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_depth0 = texelFetch2D(dhDepthTex, ivec2(gl_FragCoord.xy),0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_depth0 = texelFetch2D(dhVoxyDepthTex, ivec2(gl_FragCoord.xy),0).x;
|
||||
#ifdef VOXY
|
||||
float DH_depth1 = texelFetch2D(dhVoxyDepthTex1, ivec2(gl_FragCoord.xy),0).x;
|
||||
DH_depth0 = min(DH_depth0, DH_depth1);
|
||||
#endif
|
||||
float depthOpaque = z;
|
||||
float depthOpaqueL = linearizeDepthFast(depthOpaque, near, farPlane);
|
||||
|
||||
float dhDepthOpaque = DH_depth0;
|
||||
float dhDepthOpaqueL = linearizeDepthFast(dhDepthOpaque, dhNearPlane, dhFarPlane);
|
||||
float dhDepthOpaqueL = linearizeDepthFast(dhDepthOpaque, dhVoxyNearPlane, dhVoxyFarPlane);
|
||||
if (depthOpaque >= 1.0 || (dhDepthOpaqueL < depthOpaqueL && dhDepthOpaque > 0.0)){
|
||||
depthOpaque = dhDepthOpaque;
|
||||
depthOpaqueL = dhDepthOpaqueL;
|
||||
@@ -569,7 +587,7 @@ void main() {
|
||||
float linearDistance_cylinder = length(playerPos.xz);
|
||||
vec3 playerPos_normalized = normalize(playerPos);
|
||||
|
||||
#ifndef DISTANT_HORIZONS
|
||||
#if !defined DISTANT_HORIZONS && !defined VOXY
|
||||
float z2 = texelFetch2D(depthtex1, ivec2(gl_FragCoord.xy),0).x;
|
||||
vec3 viewPos_alt = toScreenSpace(vec3(texcoord/RENDER_SCALE, z2));
|
||||
vec3 playerPos_alt = mat3(gbufferModelViewInverse) * viewPos_alt + gbufferModelViewInverse[3].xyz;
|
||||
@@ -609,7 +627,7 @@ void main() {
|
||||
bool isEntity = abs(translucentMasks - 0.9) < 0.01 || isReflectiveEntity;
|
||||
|
||||
////// --------------- get volumetrics
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_mixedLinearZ = sqrt(texelFetch2D(colortex12,ivec2(gl_FragCoord.xy),0).z/65000.0);
|
||||
vec4 temporallyFilteredVL = VLTemporalFiltering(viewPos, DH_mixedLinearZ, colortex12, hand);
|
||||
#else
|
||||
@@ -648,7 +666,7 @@ void main() {
|
||||
|
||||
float z0 = depth < 0.56 ? convertHandDepth(depth) : depth;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_z0 = DH_depth0;
|
||||
#else
|
||||
float DH_z0 = 1.0;
|
||||
@@ -780,7 +798,7 @@ void main() {
|
||||
borderFog.rgb = skyFromTex(playerPos_normalized, colortex4)/1200.0 * Sky_Brightness;
|
||||
#endif
|
||||
borderFog *= BorderFogIntensity;
|
||||
#if !defined DISTANT_HORIZONS
|
||||
#if !defined DISTANT_HORIZONS && !defined VOXY
|
||||
if(!isWater) color = mix(color, borderFog.rgb, getBorderFogDensity(linearDistance_cylinder_alt, normalize(playerPos_alt), z2 >= 1.0 || TranslucentShader.a <= 0));
|
||||
#endif
|
||||
#else
|
||||
@@ -827,8 +845,8 @@ void main() {
|
||||
|
||||
float cosAngle = dot(-WsunVec, playerPos_normalized);
|
||||
if (isEyeInWater == 0 && rainbowAmount > 0.0 && cosAngle < 0.7431448 && cosAngle > 0.7071068) {
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float clippingDistance = dhFarPlane;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float clippingDistance = dhVoxyFarPlane;
|
||||
#else
|
||||
float clippingDistance = 4.0 * far;
|
||||
#endif
|
||||
|
||||
@@ -21,8 +21,8 @@ flat varying vec3 WmoonVec;
|
||||
|
||||
uniform float far;
|
||||
uniform float near;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
uniform mat4 gbufferModelViewInverse;
|
||||
uniform vec3 sunPosition;
|
||||
@@ -67,7 +67,7 @@ void main() {
|
||||
#endif
|
||||
|
||||
#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -133,11 +133,18 @@ float convertHandDepth2( float depth) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform float near;
|
||||
uniform float far;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
@@ -146,10 +153,10 @@ float ld(float dist) {
|
||||
return (2.0 * near) / (far + near - dist * (far - near));
|
||||
}
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -161,8 +168,8 @@ float invertlinearDepthFast(const in float depth, const in float near, const in
|
||||
|
||||
vec3 toClipSpace3Prev_DH( vec3 viewSpacePosition, bool depthCheck ) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
mat4 projectionMatrix = depthCheck ? dhPreviousProjection : gbufferPreviousProjection;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
mat4 projectionMatrix = depthCheck ? dhVoxyProjectionPrev : gbufferPreviousProjection;
|
||||
return projMAD(projectionMatrix, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
#else
|
||||
return projMAD(gbufferPreviousProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
@@ -174,12 +181,12 @@ 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 defined DISTANT_HORIZONS || defined VOXY
|
||||
if (depthCheck) {
|
||||
iProjDiag = vec4(dhProjectionInverse[0].x, dhProjectionInverse[1].y, dhProjectionInverse[2].zw);
|
||||
iProjDiag = vec4(dhVoxyProjectionInverse[0].x, dhVoxyProjectionInverse[1].y, dhVoxyProjectionInverse[2].zw);
|
||||
|
||||
feetPlayerPos = POS * 2.0 - 1.0;
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + dhProjectionInverse[3];
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + dhVoxyProjectionInverse[3];
|
||||
viewPos.xyz /= viewPos.w;
|
||||
|
||||
} else {
|
||||
@@ -190,7 +197,7 @@ vec3 toScreenSpace_DH_special(vec3 POS, bool depthCheck ) {
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + gbufferProjectionInverse[3];
|
||||
viewPos.xyz /= viewPos.w;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -326,9 +333,9 @@ vec4 computeTAA(vec2 texcoord, bool hand){
|
||||
|
||||
// get previous frames position stuff for UV
|
||||
//use velocity from the nearest texel from camera in a 3x3 box in order to improve edge quality in motion
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
bool depthCheck = texture2D(depthtex0,adjTC).x >= 1.0;
|
||||
vec3 closestToCamera = closestToCamera5taps_DH(adjTC, depthtex0, dhDepthTex, depthCheck);
|
||||
vec3 closestToCamera = closestToCamera5taps_DH(adjTC, depthtex0, dhVoxyDepthTex, depthCheck);
|
||||
vec3 viewPos = toScreenSpace_DH_special(closestToCamera, depthCheck);
|
||||
#else
|
||||
vec3 closestToCamera = closestToCamera5taps(adjTC, depthtex0);
|
||||
@@ -338,7 +345,7 @@ vec4 computeTAA(vec2 texcoord, bool hand){
|
||||
vec3 playerPos = mat3(gbufferModelViewInverse) * viewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition);
|
||||
vec3 previousPosition = mat3(gbufferPreviousModelView) * playerPos + gbufferPreviousModelView[3].xyz;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
previousPosition = toClipSpace3Prev_DH(previousPosition, depthCheck);
|
||||
#else
|
||||
previousPosition = toClipSpace3Prev(previousPosition);
|
||||
|
||||
@@ -126,35 +126,35 @@ vec3 toScreenSpace(vec3 p) {
|
||||
}
|
||||
|
||||
uniform float near;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
vec3 DH_toScreenSpace(vec3 p) {
|
||||
vec4 iProjDiag = vec4(dhProjectionInverse[0].x, dhProjectionInverse[1].y, dhProjectionInverse[2].zw);
|
||||
vec4 iProjDiag = vec4(dhVoxyProjectionInverse[0].x, dhVoxyProjectionInverse[1].y, dhVoxyProjectionInverse[2].zw);
|
||||
vec3 feetPlayerPos = p * 2. - 1.;
|
||||
vec4 viewPos = iProjDiag * feetPlayerPos.xyzz + dhProjectionInverse[3];
|
||||
vec4 viewPos = iProjDiag * feetPlayerPos.xyzz + dhVoxyProjectionInverse[3];
|
||||
return viewPos.xyz / viewPos.w;
|
||||
}
|
||||
|
||||
vec3 DH_toClipSpace3(vec3 viewSpacePosition) {
|
||||
return projMAD(dhProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
return projMAD(dhVoxyProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
// float DH_ld(float dist) {
|
||||
// return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
// return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
// }
|
||||
// float DH_invLinZ (float lindepth){
|
||||
// return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
// return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
// }
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -241,7 +241,7 @@ float mixhistory = 0.06;
|
||||
if (gl_FragCoord.x > 1 && gl_FragCoord.x < 4 && gl_FragCoord.y > 1 && gl_FragCoord.y < 4){
|
||||
mixhistory = 10.0 * frameTime;
|
||||
|
||||
gl_FragData[0].rgb = writeSceneControllerParameters(gl_FragCoord.xy, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
gl_FragData[0].rgb = writeSceneControllerParameters(gl_FragCoord.xy, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
|
||||
// uniform int dhRenderDistance;
|
||||
// uniform int dhVoxyRenderDistance;
|
||||
uniform float frameTimeCounter;
|
||||
#include "/lib/Shadow_Params.glsl"
|
||||
|
||||
@@ -206,11 +206,11 @@ void main() {
|
||||
|
||||
// components are split for readability/user friendliness within this function
|
||||
applySceneControllerParameters(
|
||||
parameters.smallCumulus.x, parameters.smallCumulus.y,
|
||||
parameters.largeCumulus.x, parameters.largeCumulus.y,
|
||||
parameters.altostratus.x, parameters.altostratus.y,
|
||||
parameters.cirrus.x, parameters.cirrus.y,
|
||||
parameters.fog.x, parameters.fog.y
|
||||
SC_parameters.smallCumulus.x, SC_parameters.smallCumulus.y,
|
||||
SC_parameters.largeCumulus.x, SC_parameters.largeCumulus.y,
|
||||
SC_parameters.altostratus.x, SC_parameters.altostratus.y,
|
||||
SC_parameters.cirrus.x, SC_parameters.cirrus.y,
|
||||
SC_parameters.fog.x, SC_parameters.fog.y
|
||||
);
|
||||
|
||||
#ifdef Daily_Weather
|
||||
@@ -251,10 +251,10 @@ void main() {
|
||||
vec4 getWeatherProfile_coverage = weatherProfile_cloudCoverage[dayCounter];
|
||||
vec4 getWeatherProfile_density = weatherProfile_cloudDensity[dayCounter];
|
||||
|
||||
parameters.smallCumulus = vec2(getWeatherProfile_coverage.r, getWeatherProfile_density.r);
|
||||
parameters.largeCumulus = vec2(getWeatherProfile_coverage.g, getWeatherProfile_density.g);
|
||||
parameters.altostratus = vec2(getWeatherProfile_coverage.b, getWeatherProfile_density.b);
|
||||
parameters.cirrus = vec2(getWeatherProfile_coverage.a, getWeatherProfile_density.a);
|
||||
SC_parameters.smallCumulus = vec2(getWeatherProfile_coverage.r, getWeatherProfile_density.r);
|
||||
SC_parameters.largeCumulus = vec2(getWeatherProfile_coverage.g, getWeatherProfile_density.g);
|
||||
SC_parameters.altostratus = vec2(getWeatherProfile_coverage.b, getWeatherProfile_density.b);
|
||||
SC_parameters.cirrus = vec2(getWeatherProfile_coverage.a, getWeatherProfile_density.a);
|
||||
|
||||
//----------- fog density
|
||||
vec2 weatherProfile_fogDensity[10] = vec2[](
|
||||
@@ -270,7 +270,7 @@ void main() {
|
||||
vec2(DAY9_ufog_density, DAY9_cfog_density)
|
||||
);
|
||||
|
||||
parameters.fog = weatherProfile_fogDensity[dayCounter];
|
||||
SC_parameters.fog = weatherProfile_fogDensity[dayCounter];
|
||||
#endif
|
||||
|
||||
//////////////////////////////
|
||||
|
||||
@@ -11,20 +11,29 @@ uniform sampler2D depthtex1;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
#define dhVoxyDepthTex1 vxDepthTexTrans
|
||||
#endif
|
||||
uniform float near;
|
||||
uniform float far;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
|
||||
float linZ(float depth) {
|
||||
return (2.0 * near) / (far + near - depth * (far - near));
|
||||
}
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
float DH_invLinZ (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -57,8 +66,8 @@ void main() {
|
||||
|
||||
if(hand) convertHandDepth(newTex);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float QuarterResDepth = texelFetch2D(dhDepthTex, ivec2(gl_FragCoord.xy*4), 0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float QuarterResDepth = texelFetch2D(dhVoxyDepthTex, ivec2(gl_FragCoord.xy*4), 0).x;
|
||||
if(newTex == 1.0) {
|
||||
float depth = DH_ld(QuarterResDepth);
|
||||
gl_FragData[0] = vec4(oldTex, 650000.0);
|
||||
@@ -77,12 +86,12 @@ void main() {
|
||||
float _far = far*4.0;
|
||||
if (depth >= 1.0) {
|
||||
depth = QuarterResDepth;
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
depth = linearizeDepthFast(depth, _near, _far);
|
||||
depth = depth / dhFarPlane;
|
||||
depth = depth / dhVoxyFarPlane;
|
||||
|
||||
if(depth < 1.0) {
|
||||
gl_FragData[1].a = depth * depth * 65000.0;
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
uniform sampler2D depthtex0;
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
#endif
|
||||
uniform sampler2D colortex1;
|
||||
uniform sampler2D colortex2;
|
||||
uniform vec2 texelSize;
|
||||
@@ -34,8 +42,8 @@ void main() {
|
||||
if(
|
||||
texelFetch2D(depthtex0, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
|| texelFetch2D(dhDepthTex, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
|| texelFetch2D(dhVoxyDepthTex, ivec2(gl_FragCoord.xy), 0).x < 1.0
|
||||
#endif
|
||||
|
||||
) {
|
||||
|
||||
@@ -16,13 +16,23 @@ flat varying vec3 averageSkyCol;
|
||||
flat varying vec3 averageSkyCol_Clouds;
|
||||
// flat varying float exposure;
|
||||
|
||||
// uniform int dhRenderDistance;
|
||||
// uniform int dhVoxyRenderDistance;
|
||||
uniform sampler2D noisetex;
|
||||
uniform sampler2D depthtex0;
|
||||
uniform sampler2D depthtex1;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex dhDepthTex
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex2;
|
||||
@@ -40,8 +50,8 @@ uniform vec3 sunVec;
|
||||
uniform float sunElevation;
|
||||
|
||||
// uniform float far;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
uniform float dhVoxyNearPlane;
|
||||
uniform float near;
|
||||
|
||||
uniform int frameCounter;
|
||||
@@ -75,10 +85,10 @@ uniform vec3 previousCameraPosition;
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * near) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * near) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
return -((2.0*dhVoxyNearPlane/lindepth)-dhVoxyFarPlane-dhVoxyNearPlane)/(dhVoxyFarPlane-dhVoxyNearPlane);
|
||||
}
|
||||
|
||||
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
|
||||
@@ -278,8 +288,10 @@ void main() {
|
||||
|
||||
vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize+0.5*texelSize;
|
||||
|
||||
float alpha = texture2D(colortex7,tc).a ;
|
||||
float blendedAlpha = texture2D(colortex2, tc).a;
|
||||
ivec2 texcoord = ivec2(tc/texelSize);
|
||||
|
||||
float alpha = texelFetch2D(colortex7, texcoord, 0).a ;
|
||||
float blendedAlpha = texelFetch2D(colortex2, texcoord, 0).a;
|
||||
|
||||
|
||||
bool iswater = alpha > 0.99;
|
||||
@@ -292,21 +304,22 @@ void main() {
|
||||
float noise_1 = R2_dither();
|
||||
float noise_2 = blueNoise();
|
||||
|
||||
ivec2 texcoord = ivec2(tc/texelSize);
|
||||
|
||||
float z0 = texelFetch2D(depthtex0, texcoord, 0 ).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, texcoord, 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float DH_z0 = texelFetch2D(dhVoxyDepthTex, texcoord, 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#else
|
||||
float DH_z0 = 0.0;
|
||||
#endif
|
||||
|
||||
float z = texelFetch2D(depthtex1, texcoord, 0 ).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
// float DH_z = texture2D(dhDepthTex1,tc).x;
|
||||
float DH_z = texelFetch2D(dhDepthTex1, texcoord, 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
float DH_z = texelFetch2D(dhVoxyDepthTex1, texcoord, 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#ifdef VOXY
|
||||
DH_z0 = min(DH_z0, DH_z);
|
||||
#endif
|
||||
#else
|
||||
float DH_z = 0.0;
|
||||
#endif
|
||||
|
||||
@@ -62,7 +62,7 @@ void main() {
|
||||
averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
|
||||
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
||||
|
||||
readSceneControllerParameters(colortex4, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.cirrus, parameters.fog);
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef NETHER_SHADER
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"unusedString": "
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
",
|
||||
"version": 1,
|
||||
"opaqueDrawBuffers": [1, 8, 15],
|
||||
"excludeLodsFromVanillaDepth": true,
|
||||
"translucentDrawBuffers": [2, 7, 14],
|
||||
#ifdef TAA
|
||||
"taaOffset": "{
|
||||
const vec2[4] offsets = vec2[4](
|
||||
vec2(-0.125, -0.875),
|
||||
vec2( 0.875, -0.125),
|
||||
vec2( 0.125, 0.875),
|
||||
vec2(-0.875, 0.125)
|
||||
);
|
||||
return offsets[framemod4_DH]*texelSize;
|
||||
}",
|
||||
#endif
|
||||
#ifdef TAA_UPSCALING
|
||||
"renderScale": [SCALE_FACTOR, SCALE_FACTOR],
|
||||
#endif
|
||||
"blending": {-1:"ONE ONE_MINUS_SRC_ALPHA ONE ONE_MINUS_SRC_ALPHA"},
|
||||
"ssbos": {0:"{
|
||||
mat4 customShadowMatrixSSBO;
|
||||
|
||||
vec3 customMoonVecSSBO;
|
||||
|
||||
vec3 customMoonVec2SSBO;
|
||||
|
||||
mat4 customShadowPerspectiveSSBO;
|
||||
|
||||
vec3 customSunVecSSBO;
|
||||
|
||||
bool onWaterSurface;
|
||||
|
||||
bool inBoat;
|
||||
|
||||
bool inBoatCurrentFrame;
|
||||
|
||||
bool inBoatLastFrame;
|
||||
|
||||
bool inShip;
|
||||
|
||||
bool inShipCurrentFrame;
|
||||
|
||||
bool inShipLastFrame;
|
||||
|
||||
float lastFrameTimeCount;
|
||||
|
||||
vec3 previousCameraPositionWave;
|
||||
|
||||
vec3 previousCameraPositionWave2;
|
||||
|
||||
bool noSimOngoing;
|
||||
|
||||
bool noSimOngoingCheck;
|
||||
|
||||
}"},
|
||||
"uniforms": [
|
||||
"framemod4_DH",
|
||||
"vxModelView",
|
||||
"vxModelViewPrev",
|
||||
"vxModelViewInv",
|
||||
"frameCounter",
|
||||
"framemod8",
|
||||
"dhVoxyFarPlane",
|
||||
"dhVoxyNearPlane",
|
||||
"vxProj",
|
||||
"vxProjInv",
|
||||
"vxProjPrev",
|
||||
"gbufferModelView",
|
||||
"gbufferModelViewInverse",
|
||||
"gbufferProjection",
|
||||
"gbufferProjectionInverse",
|
||||
"gbufferPreviousModelView",
|
||||
"gbufferPreviousProjection",
|
||||
"shadowModelView",
|
||||
"shadowModelViewInverse",
|
||||
"shadowProjection",
|
||||
"shadowProjectionInverse",
|
||||
"cameraPosition",
|
||||
"previousCameraPosition",
|
||||
"near",
|
||||
"far",
|
||||
"frameTimeCounter",
|
||||
"texelSize",
|
||||
"sunPosition",
|
||||
"sunElevation",
|
||||
"lightningBoltPosition",
|
||||
"rainStrength",
|
||||
"unsigned_WsunVecSmooth",
|
||||
"unsigned_WmoonVecSmooth",
|
||||
"isEyeInWater"
|
||||
],
|
||||
"samplers": [
|
||||
"vxDepthTexOpaque",
|
||||
"noisetex",
|
||||
"colortex4",
|
||||
"colortex5",
|
||||
"colortex7",
|
||||
"colortex8",
|
||||
"colortex12",
|
||||
"depthtex0",
|
||||
"depthtex1"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
#define VOXY_PROGRAM
|
||||
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/blocks.glsl"
|
||||
|
||||
layout (location = 0) out vec4 gbuffer_data_0;
|
||||
layout (location = 1) out vec4 gbuffer_data_1;
|
||||
layout (location = 2) out vec4 gbuffer_data_2;
|
||||
|
||||
vec4 encode (vec3 n, vec2 lightmaps){
|
||||
n.xy = n.xy / dot(abs(n), vec3(1.0));
|
||||
n.xy = n.z <= 0.0 ? (1.0 - abs(n.yx)) * sign(n.xy) : n.xy;
|
||||
vec2 encn = clamp(n.xy * 0.5 + 0.5,-1.0,1.0);
|
||||
|
||||
return vec4(encn,vec2(lightmaps.x,lightmaps.y));
|
||||
}
|
||||
|
||||
//encoding by jodie
|
||||
float encodeVec2(vec2 a){
|
||||
const vec2 constant1 = vec2( 1., 256.) / 65535.;
|
||||
vec2 temp = floor( a * 255. );
|
||||
return temp.x*constant1.x+temp.y*constant1.y;
|
||||
}
|
||||
float encodeVec2(float x,float y){
|
||||
return encodeVec2(vec2(x,y));
|
||||
}
|
||||
|
||||
|
||||
void voxy_emitFragment(VoxyFragmentParameters parameters) {
|
||||
|
||||
vec4 Albedo;
|
||||
|
||||
Albedo.rgb = parameters.sampledColour.rgb * parameters.tinting.rgb;
|
||||
|
||||
int blockID = int(parameters.customId);
|
||||
|
||||
float SSSAMOUNT = 0.0;
|
||||
|
||||
/////// ----- SSS ON BLOCKS ----- ///////
|
||||
// strong
|
||||
if (
|
||||
blockID == BLOCK_SSS_STRONG || blockID == BLOCK_SAPLING || blockID == BLOCK_AIR_WAVING
|
||||
) {
|
||||
SSSAMOUNT = 1.0;
|
||||
}
|
||||
|
||||
// medium
|
||||
if (
|
||||
blockID == BLOCK_GROUND_WAVING || blockID == BLOCK_GROUND_WAVING_VERTICAL
|
||||
|| blockID == BLOCK_GRASS_SHORT || blockID == BLOCK_GRASS_TALL_UPPER || blockID == BLOCK_GRASS_TALL_LOWER
|
||||
) {
|
||||
SSSAMOUNT = 0.5;
|
||||
}
|
||||
if (
|
||||
blockID == BLOCK_SSS_WEAK || blockID == BLOCK_SSS_WEAK_2 ||
|
||||
blockID == BLOCK_GLOW_LICHEN || blockID == BLOCK_SNOW_LAYERS || blockID == BLOCK_CARPET ||
|
||||
blockID == BLOCK_AMETHYST_BUD_MEDIUM || blockID == BLOCK_AMETHYST_BUD_LARGE || blockID == BLOCK_AMETHYST_CLUSTER ||
|
||||
blockID == BLOCK_BAMBOO || blockID == BLOCK_SAPLING || blockID == BLOCK_VINE
|
||||
) {
|
||||
SSSAMOUNT = 0.5;
|
||||
}
|
||||
|
||||
// low
|
||||
#ifdef MISC_BLOCK_SSS
|
||||
if(
|
||||
blockID == BLOCK_SSS_WEIRD || blockID == BLOCK_GRASS
|
||||
){
|
||||
SSSAMOUNT = 0.5;
|
||||
}
|
||||
#endif
|
||||
|
||||
Albedo.a = 1.0;
|
||||
|
||||
vec3 normal = vec3(uint((parameters.face>>1)==2), uint((parameters.face>>1)==0), uint((parameters.face>>1)==1)) * (float(int(parameters.face)&1)*2-1);
|
||||
|
||||
vec4 data1 = clamp( encode(normal, parameters.lightMap), 0.0, 1.0);
|
||||
|
||||
gbuffer_data_0 = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
|
||||
|
||||
gbuffer_data_1 = vec4(0.0, 0.0, SSSAMOUNT, 0.0);
|
||||
|
||||
gbuffer_data_2 = vec4(normal * 0.5 + 0.5, 0.0);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
#define VOXY_PROGRAM
|
||||
|
||||
layout (location = 0) out vec4 gbuffer_data_0;
|
||||
layout (location = 1) out vec4 gbuffer_data_1;
|
||||
layout (location = 2) out vec4 gbuffer_data_2;
|
||||
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/blocks.glsl"
|
||||
#include "/lib/waterBump.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
#include "/lib/TAA_jitter.glsl"
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#include "/lib/scene_controller.glsl"
|
||||
#define CLOUDSHADOWSONLY
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#define WATER_SUN_SPECULAR
|
||||
#endif
|
||||
|
||||
#ifndef OVERWORLD_SHADER
|
||||
#undef WATER_SUN_SPECULAR
|
||||
#endif
|
||||
|
||||
float GGX(vec3 n, vec3 v, vec3 l, float r, float f0) {
|
||||
r = max(pow(r,2.5), 0.0001);
|
||||
|
||||
vec3 h = l + v;
|
||||
float hn = inversesqrt(dot(h, h));
|
||||
|
||||
float dotLH = clamp(dot(h,l)*hn,0.,1.);
|
||||
float dotNH = clamp(dot(h,n)*hn,0.,1.) ;
|
||||
float dotNL = clamp(dot(n,l),0.,1.);
|
||||
float dotNHsq = dotNH*dotNH;
|
||||
|
||||
float denom = dotNHsq * r - dotNHsq + 1.;
|
||||
float D = r / (3.141592653589793 * denom * denom);
|
||||
|
||||
float F = f0 + (1. - f0) * exp2((-5.55473*dotLH-6.98316)*dotLH);
|
||||
float k2 = .25 * r;
|
||||
|
||||
return dotNL * D * F / (dotLH*dotLH*(1.0-k2)+k2);
|
||||
}
|
||||
|
||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
||||
|
||||
vec4 encode (vec3 n, vec2 lightmaps){
|
||||
n.xy = n.xy / dot(abs(n), vec3(1.0));
|
||||
n.xy = n.z <= 0.0 ? (1.0 - abs(n.yx)) * sign(n.xy) : n.xy;
|
||||
vec2 encn = clamp(n.xy * 0.5 + 0.5,-1.0,1.0);
|
||||
|
||||
return vec4(encn,vec2(lightmaps.x,lightmaps.y));
|
||||
}
|
||||
|
||||
|
||||
//encoding by jodie
|
||||
float encodeVec2(vec2 a){
|
||||
const vec2 constant1 = vec2( 1., 256.) / 65535.;
|
||||
vec2 temp = floor( a * 255. );
|
||||
return temp.x*constant1.x+temp.y*constant1.y;
|
||||
}
|
||||
float encodeVec2(float x,float y){
|
||||
return encodeVec2(vec2(x,y));
|
||||
}
|
||||
|
||||
vec3 toLinear(vec3 sRGB){
|
||||
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
||||
}
|
||||
|
||||
float luma(vec3 color) {
|
||||
return dot(color,vec3(0.21, 0.72, 0.07));
|
||||
}
|
||||
|
||||
vec3 worldToView(vec3 worldPos) {
|
||||
vec4 pos = vec4(worldPos, 0.0);
|
||||
pos = vxModelView * pos;
|
||||
return pos.xyz;
|
||||
}
|
||||
|
||||
vec3 DH_toScreenSpace(vec3 p) {
|
||||
vec4 iProjDiag = vec4(vxProjInv[0].x, vxProjInv[1].y, vxProjInv[2].zw);
|
||||
vec3 feetPlayerPos = p * 2. - 1.;
|
||||
vec4 viewPos = iProjDiag * feetPlayerPos.xyzz + vxProjInv[3];
|
||||
return viewPos.xyz / viewPos.w;
|
||||
}
|
||||
|
||||
float interleaved_gradientNoise_temporal(){
|
||||
#ifdef TAA
|
||||
return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y ) + 1.0/1.6180339887 * frameCounter);
|
||||
#else
|
||||
return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y ) + 1.0/1.6180339887);
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "/lib/sky_gradient.glsl"
|
||||
#include "/lib/Shadow_Params.glsl"
|
||||
|
||||
#define FORWARD_SSR_QUALITY 30 // [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 200 300 400 500]
|
||||
|
||||
#define FORWARD_SPECULAR
|
||||
#define FORWARD_BACKGROUND_REFLECTION
|
||||
// #define FORWARD_ROUGH_REFLECTION
|
||||
|
||||
#ifdef FORWARD_ROUGH_REFLECTION
|
||||
#endif
|
||||
|
||||
vec3 DH_toClipSpace3(vec3 viewSpacePosition) {
|
||||
return projMAD(vxProj, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
float invLdFast(float linearDepth) {
|
||||
return (dhVoxyFarPlane * (dhVoxyNearPlane - linearDepth)) / ((dhVoxyNearPlane - dhVoxyFarPlane) * linearDepth);
|
||||
}
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhVoxyNearPlane) / (dhVoxyFarPlane + dhVoxyNearPlane - dist * (dhVoxyFarPlane - dhVoxyNearPlane));
|
||||
}
|
||||
|
||||
vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
|
||||
float biasAmount = 0.000015;
|
||||
|
||||
float quality = float(FORWARD_SSR_QUALITY);
|
||||
vec3 clipPosition = DH_toClipSpace3(position);
|
||||
|
||||
float rayLength = ((position.z + dir.z * dhVoxyFarPlane*sqrt(3.)) > -dhVoxyNearPlane) ?
|
||||
(-dhVoxyNearPlane - position.z) / dir.z : dhVoxyFarPlane*sqrt(3.);
|
||||
|
||||
vec3 direction = DH_toClipSpace3(position + dir * rayLength) - clipPosition; //convert to clip space
|
||||
|
||||
#if FORWARD_SSR_QUALITY == 1
|
||||
vec3 reflectedTC = vec3((direction.xy + clipPosition.xy) * RENDER_SCALE, 0.999999);
|
||||
return reflectedTC;
|
||||
#endif
|
||||
|
||||
//get at which length the ray intersects with the edge of the screen
|
||||
vec3 maxLengths = (step(0.0, direction) - clipPosition) / direction;
|
||||
float mult = min(min(maxLengths.x, maxLengths.y), maxLengths.z);
|
||||
vec3 stepv = direction * mult / quality;
|
||||
|
||||
clipPosition.xy *= RENDER_SCALE;
|
||||
stepv.xy *= RENDER_SCALE;
|
||||
|
||||
vec3 spos = clipPosition + stepv * dither;
|
||||
spos.xy += offsets[framemod8] * texelSize * 0.5 / RENDER_SCALE;
|
||||
|
||||
float minZ = spos.z - 0.00025 / DH_ld(spos.z);
|
||||
float maxZ = spos.z;
|
||||
|
||||
for (int i = 0; i <= int(quality); i++) {
|
||||
#if DEFERRED_SSR_QUALITY != 1
|
||||
if(spos.x < 0 || spos.x > 1 || spos.y < 0 || spos.y > 1) return vec3(1.1);
|
||||
#endif
|
||||
|
||||
float sp = texelFetch(vxDepthTexOpaque, ivec2(spos.xy / texelSize), 0).r;
|
||||
|
||||
if (sp < max(minZ, maxZ) && sp > min(minZ, maxZ)) {
|
||||
return vec3(spos.xy / RENDER_SCALE, sp);
|
||||
}
|
||||
|
||||
minZ = maxZ - biasAmount / DH_ld(spos.z);
|
||||
maxZ += stepv.z;
|
||||
|
||||
spos += stepv;
|
||||
}
|
||||
return vec3(1.1);
|
||||
}
|
||||
|
||||
void voxy_emitFragment(VoxyFragmentParameters parameters) {
|
||||
if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) {
|
||||
vec3 viewPos = DH_toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0));
|
||||
|
||||
vec3 feetPlayerPos = mat3(vxModelViewInv) * viewPos + vxModelViewInv[3].xyz;;
|
||||
|
||||
gbuffer_data_0 = parameters.sampledColour * parameters.tinting;
|
||||
|
||||
vec3 Albedo = toLinear(gbuffer_data_0.rgb);
|
||||
float UnchangedAlpha = gbuffer_data_0.a;
|
||||
|
||||
int blockID = int(parameters.customId);
|
||||
bool isWater = blockID == 8;
|
||||
|
||||
#ifndef WhiteWorld
|
||||
#ifdef Vanilla_like_water
|
||||
if (isWater) Albedo *= sqrt(luma(Albedo));
|
||||
#else
|
||||
if (isWater){
|
||||
Albedo = vec3(0.0);
|
||||
gbuffer_data_0.a = 1.0/255.0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vec3 normal = vec3(uint((parameters.face>>1)==2), uint((parameters.face>>1)==0), uint((parameters.face>>1)==1)) * (float(int(parameters.face)&1)*2-1);
|
||||
|
||||
vec4 lightCol;
|
||||
vec3 WsunVec;
|
||||
vec3 WsunVec2;
|
||||
|
||||
lightCol.rgb = texelFetch(colortex4,ivec2(6,37),0).rgb;
|
||||
|
||||
vec3 averageSkyCol_Clouds = texelFetch(colortex4,ivec2(0,37),0).rgb;
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
readSceneControllerParameters(colortex4, SC_parameters.smallCumulus, SC_parameters.largeCumulus, SC_parameters.altostratus, SC_parameters.cirrus, SC_parameters.fog);
|
||||
#endif
|
||||
|
||||
#ifdef CUSTOM_MOON_ROTATION
|
||||
vec3 WmoonVec = customMoonVecSSBO;
|
||||
|
||||
#ifdef SMOOTH_SUN_ROTATION
|
||||
WsunVec = WsunVecSmooth;
|
||||
#else
|
||||
WsunVec = normalize(mat3(vxModelViewInv) * sunPosition);
|
||||
#endif
|
||||
WsunVec2 = normalize(sunPosition);
|
||||
|
||||
WsunVec = mix(WmoonVec, WsunVec, float(sunElevation > 1e-5));
|
||||
WsunVec2 = mix(normalize(mat3(vxModelView)*WmoonVec), WsunVec2, float(sunElevation > 1e-5));
|
||||
#else
|
||||
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
||||
#ifdef SMOOTH_SUN_ROTATION
|
||||
WsunVec = lightCol.a * WsunVecSmooth;
|
||||
#else
|
||||
WsunVec = lightCol.a * normalize(mat3(vxModelViewInv) * sunPosition);
|
||||
#endif
|
||||
WsunVec2 = lightCol.a * normalize(sunPosition);
|
||||
#endif
|
||||
|
||||
// diffuse
|
||||
vec3 Indirect_lighting = vec3(0.0);
|
||||
// vec3 MinimumLightColor = vec3(1.0);
|
||||
vec3 Direct_lighting = vec3(0.0);
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
vec3 DirectLightColor = lightCol.rgb/2400.0;
|
||||
|
||||
float NdotL = clamp(dot(normal, WsunVec),0.0,1.0);
|
||||
NdotL = clamp((-15 + NdotL*255.0) / 240.0 ,0.0,1.0);
|
||||
|
||||
float Shadows = 1.0;
|
||||
|
||||
Shadows *= GetCloudShadow(feetPlayerPos + cameraPosition, WsunVec);
|
||||
|
||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||
|
||||
vec3 AmbientLightColor = averageSkyCol_Clouds/900.0 ;
|
||||
|
||||
vec3 ambientcoefs = normal.xyz / dot(abs(normal.xyz), vec3(1.0));
|
||||
float SkylightDir = ambientcoefs.y*1.5;
|
||||
|
||||
float skylight = max(pow(normal.y*0.5+0.5,0.1) + SkylightDir, 0.2);
|
||||
AmbientLightColor *= skylight;
|
||||
#endif
|
||||
|
||||
#ifndef OVERWORLD_SHADER
|
||||
vec3 AmbientLightColor = vec3(0.5);
|
||||
#endif
|
||||
|
||||
Indirect_lighting = AmbientLightColor;
|
||||
float indoors = min(max(parameters.lightMap.y-0.5,0.0)/0.4,1.0);
|
||||
vec3 FinalColor = (Indirect_lighting + Direct_lighting*indoors) * Albedo;
|
||||
|
||||
#ifndef Vanilla_like_water
|
||||
if(isWater && abs(normal.y) > 0.1){
|
||||
vec3 waterPos = (feetPlayerPos+cameraPosition).xzy;
|
||||
|
||||
vec3 bump = normalize(getWaveNormal(waterPos, feetPlayerPos));
|
||||
|
||||
float bumpmult = WATER_WAVE_STRENGTH;
|
||||
|
||||
bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult);
|
||||
|
||||
normal.xz = bump.xy;
|
||||
}
|
||||
#endif
|
||||
|
||||
vec3 normals = worldToView(normal);
|
||||
#if defined FORWARD_SPECULAR
|
||||
vec3 Reflections_Final = vec3(0.0);
|
||||
vec4 Reflections = vec4(0.0);
|
||||
vec3 BackgroundReflection = FinalColor;
|
||||
vec3 SunReflection = vec3(0.0);
|
||||
float SSR_HIT_SKY_MASK = indoors;
|
||||
|
||||
float roughness = 0.0;
|
||||
float f0 = 0.02;
|
||||
// f0 = 0.9;
|
||||
|
||||
vec3 reflectedVector = reflect(normalize(viewPos), normals);
|
||||
float normalDotEye = dot(normals, normalize(viewPos));
|
||||
|
||||
float fresnel = pow(clamp(1.0 + normalDotEye, 0.0, 1.0),5.0);
|
||||
|
||||
fresnel = mix(f0, 1.0, fresnel);
|
||||
|
||||
#ifdef SNELLS_WINDOW
|
||||
if(isEyeInWater == 1) fresnel = pow(clamp(1.5 + normalDotEye,0.0,1.0), 25.0);
|
||||
#endif
|
||||
#if FORWARD_SSR_QUALITY > 0 && defined VOXY_REFLECTIONS
|
||||
vec3 rtPos = rayTrace(reflectedVector, viewPos, interleaved_gradientNoise_temporal(), fresnel);
|
||||
if (rtPos.z < 0.99999){
|
||||
vec3 previousPosition = mat3(gbufferModelViewInverse) * DH_toScreenSpace(rtPos) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||
previousPosition.xy = projMAD(vxProjPrev, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.y < 1.0) {
|
||||
Reflections.a = 1.0;
|
||||
Reflections.rgb = texture2D(colortex5, previousPosition.xy).rgb;
|
||||
}
|
||||
}else{
|
||||
if (rtPos.x > 0.0 && rtPos.y > 0.0 && rtPos.x < 1.0 && rtPos.y < 1.0) SSR_HIT_SKY_MASK = 1.0;
|
||||
}
|
||||
#endif
|
||||
#if defined FORWARD_BACKGROUND_REFLECTION
|
||||
BackgroundReflection = skyCloudsFromTex(mat3(gbufferModelViewInverse) * reflectedVector, colortex4).rgb / 1200.0;
|
||||
#endif
|
||||
#ifdef WATER_SUN_SPECULAR
|
||||
SunReflection = (DirectLightColor * Shadows) * GGX(normalize(normals), -normalize(viewPos), normalize(WsunVec2), roughness, f0) * (1.0-Reflections.a);
|
||||
#endif
|
||||
|
||||
Reflections_Final = mix(FinalColor, mix(BackgroundReflection*SSR_HIT_SKY_MASK, Reflections.rgb, Reflections.a), fresnel);
|
||||
Reflections_Final += SunReflection*indoors;
|
||||
|
||||
gbuffer_data_0.a = gbuffer_data_0.a + (1.0-gbuffer_data_0.a) * fresnel;
|
||||
|
||||
gbuffer_data_0.rgb = 0.1*clamp((Reflections_Final/gbuffer_data_0.a) * 0.1,0.0,65000.0);
|
||||
|
||||
if (gbuffer_data_0.r > 65000.) gbuffer_data_0.rgba = vec4(0.0);
|
||||
#else
|
||||
gbuffer_data_0.rgb = FinalColor*0.1;
|
||||
#endif
|
||||
|
||||
float material = 0.7;
|
||||
if(isWater) material = 1.0;
|
||||
|
||||
//gbuffer_data_0.rgb = Albedo;
|
||||
|
||||
gbuffer_data_1 = vec4(Albedo, material);
|
||||
|
||||
gbuffer_data_2 = vec4(encodeVec2(parameters.lightMap), 1, 1, 1);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - A Bliss Edit
|
||||
prefix.SHADER_VERSION_LABEL = V
|
||||
value.SHADER_VERSION_LABEL.482 = 4.3.0
|
||||
value.SHADER_VERSION_LABEL.482 = 5.0.0
|
||||
|
||||
# if you're here to translate, this is not a joke, these do what they say
|
||||
profile.POTATO=§4Potato
|
||||
@@ -96,7 +96,7 @@ screen.DEBUG_STUFF = §cDebug Settings§r
|
||||
screen.LEGACY_STUFF = Legacy Settings
|
||||
screen.Mod_support = Settings For Supported Mods
|
||||
|
||||
option.RESOURCEPACK_SKY = Resource Pack Sky §c(slightly bugged)
|
||||
option.RESOURCEPACK_SKY = Resource Pack Sky - §cWARNING:§r read the description!
|
||||
value.RESOURCEPACK_SKY.0 = Do not use
|
||||
value.RESOURCEPACK_SKY.1 = Sky + Shader sun/moon
|
||||
value.RESOURCEPACK_SKY.2 = Full sky
|
||||
@@ -1127,7 +1127,7 @@ screen.Post_Processing.comment = Configure settings for all post processing effe
|
||||
option.LUMINANCE_CURVE.comment = Enable the tone curve. This is independent from color grading and is applied first.
|
||||
option.COLOR_GRADING_ENABLED.comment = Enable color grading. The RGB sliders will not affect the brightness. This is applied after the tone curve
|
||||
|
||||
option.RESOURCEPACK_SKY.comment = Toggle resourcepack sky support. Configure settings to use the whole resourcepack sky, or keep the shader's sun and moon. §aPERFORMANCE COST:§r very low
|
||||
option.RESOURCEPACK_SKY.comment =§cWARNING: This setting, IF USED, will cause broken rendering for: lead ropes, fishing lines, and possibly some modded entities!§r. Toggle resourcepack sky support. Configure settings to use the whole resourcepack sky, or keep the shader's sun and moon. §aPERFORMANCE COST:§r very low
|
||||
option.SKY_GROUND = Atmosphere Ground
|
||||
|
||||
option.MATERIAL_AO.comment = Toggle the use of ambient occlusion based on what the resourcepack provides. §aPERFORMANCE COST:§r very low
|
||||
|
||||
+1077
-620
File diff suppressed because it is too large
Load Diff
@@ -4,13 +4,27 @@ uniform mat4 dhPreviousProjection;
|
||||
uniform mat4 dhProjectionInverse;
|
||||
uniform mat4 dhProjection;
|
||||
|
||||
uniform mat4 vxProj;
|
||||
uniform mat4 vxProjInv;
|
||||
uniform mat4 vxProjPrev;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#define dhVoxyProjection dhProjection
|
||||
#define dhVoxyProjectionInverse dhProjectionInverse
|
||||
#define dhVoxyProjectionPrev dhPreviousProjection
|
||||
#else
|
||||
#define dhVoxyProjection vxProj
|
||||
#define dhVoxyProjectionInverse vxProjInv
|
||||
#define dhVoxyProjectionPrev vxProjPrev
|
||||
#endif
|
||||
|
||||
vec3 toScreenSpace_DH( vec2 texcoord, float depth, float DHdepth ) {
|
||||
|
||||
vec4 viewPos = vec4(0.0);
|
||||
vec3 feetPlayerPos = vec3(0.0);
|
||||
vec4 iProjDiag = vec4(0.0);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
if (depth < 1.0) {
|
||||
#endif
|
||||
iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw);
|
||||
@@ -19,12 +33,12 @@ vec3 toScreenSpace_DH( vec2 texcoord, float depth, float DHdepth ) {
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + gbufferProjectionInverse[3];
|
||||
viewPos.xyz /= viewPos.w;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
} else {
|
||||
iProjDiag = vec4(dhProjectionInverse[0].x, dhProjectionInverse[1].y, dhProjectionInverse[2].zw);
|
||||
iProjDiag = vec4(dhVoxyProjectionInverse[0].x, dhVoxyProjectionInverse[1].y, dhVoxyProjectionInverse[2].zw);
|
||||
|
||||
feetPlayerPos = vec3(texcoord, DHdepth) * 2.0 - 1.0;
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + dhProjectionInverse[3];
|
||||
viewPos = iProjDiag * feetPlayerPos.xyzz + dhVoxyProjectionInverse[3];
|
||||
viewPos.xyz /= viewPos.w;
|
||||
}
|
||||
#endif
|
||||
@@ -33,8 +47,8 @@ vec3 toScreenSpace_DH( vec2 texcoord, float depth, float DHdepth ) {
|
||||
}
|
||||
vec3 toClipSpace3_DH( vec3 viewSpacePosition, bool depthCheck ) {
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
mat4 projectionMatrix = depthCheck ? dhProjection : gbufferProjection;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
mat4 projectionMatrix = depthCheck ? dhVoxyProjection : gbufferProjection;
|
||||
return projMAD(projectionMatrix, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
#else
|
||||
return projMAD(gbufferProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
||||
@@ -48,8 +62,8 @@ mat4 DH_shadowProjectionTweak( in mat4 projection){
|
||||
|
||||
float _far = (3.0 * far);
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
_far = 2.0 * dhFarPlane;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
_far = 2.0 * dhVoxyFarPlane;
|
||||
#endif
|
||||
|
||||
mat4 newProjection = projection;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#ifndef VOXY_PROGRAM
|
||||
uniform float far;
|
||||
uniform int dhRenderDistance;
|
||||
uniform int dhVoxyRenderDistance;
|
||||
#endif
|
||||
|
||||
const float k = 1.8;
|
||||
const float d0 = 0.04 + (1.0-clamp(shadowDistance-64.0, 0.0,1.0)) * 0.1;
|
||||
@@ -9,7 +11,7 @@ float b = (exp(d1)-a)*150./128.0;
|
||||
|
||||
// thank you Espen
|
||||
// #ifdef DISTANT_HORIZONS_SHADOWMAP
|
||||
// float b = (exp(d1)-a)*min(dhRenderDistance, shadowDistance)/shadowDistance;
|
||||
// float b = (exp(d1)-a)*min(dhVoxyRenderDistance, shadowDistance)/shadowDistance;
|
||||
// #else
|
||||
// float b = (exp(d1)-a)*min(far+16.0*3.5, shadowDistance)/shadowDistance;
|
||||
// #endif
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
float _near = near; float _far = far*4.0;
|
||||
|
||||
if (depthCheck) {
|
||||
_near = dhNearPlane;
|
||||
_far = dhFarPlane;
|
||||
_near = dhVoxyNearPlane;
|
||||
_far = dhVoxyFarPlane;
|
||||
}
|
||||
|
||||
vec3 position = toClipSpace3_DH(viewPos, depthCheck) ;
|
||||
@@ -49,8 +49,8 @@
|
||||
|
||||
float samplePos = texelFetch2D(depthtex2, ivec2(newPos.xy/texelSize).xy,0).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
if(depthCheck) samplePos = texelFetch2D(dhDepthTex1, ivec2(newPos.xy/texelSize),0).x;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
if(depthCheck) samplePos = texelFetch2D(dhVoxyDepthTex1, ivec2(newPos.xy/texelSize),0).x;
|
||||
#endif
|
||||
|
||||
if(samplePos < newPos.z && samplePos > 0.0){// && (samplePos <= max(minZ,maxZ) && samplePos >= min(minZ,maxZ))){
|
||||
|
||||
@@ -62,7 +62,7 @@ vec4 BilateralUpscale_SSAO(sampler2D tex, sampler2D depth, vec2 coord, float ref
|
||||
// ivec2(0,-1),
|
||||
// ivec2(-1,0)
|
||||
// );
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float diffThreshold = 0.0005 ;
|
||||
#else
|
||||
float diffThreshold = 0.005;
|
||||
@@ -74,7 +74,7 @@ vec4 BilateralUpscale_SSAO(sampler2D tex, sampler2D depth, vec2 coord, float ref
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
||||
ivec2 radius = getRadius[i];
|
||||
#ifdef DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float offsetDepth = sqrt(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling,0).a/65000.0);
|
||||
#else
|
||||
float offsetDepth = ld(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling, 0).r);
|
||||
|
||||
@@ -42,7 +42,7 @@ float cloudVol(in vec3 pos, float maxDistance ){
|
||||
medium_gradientFog = mix(medium_gradientFog, 1.0, sandStorm+snowStorm);
|
||||
}
|
||||
|
||||
FogDensities(medium_gradientFog, cloudyFog, rainyFog, maxDistance, parameters.fog.x, parameters.fog.y);
|
||||
FogDensities(medium_gradientFog, cloudyFog, rainyFog, maxDistance, SC_parameters.fog.x, SC_parameters.fog.y);
|
||||
|
||||
return uniformFog + medium_gradientFog + cloudyFog + rainyFog;
|
||||
}
|
||||
@@ -105,8 +105,8 @@ vec4 GetVolumetricFog(
|
||||
vec3 dV = fragposition - start;
|
||||
vec3 dVWorld = wpos - gbufferModelViewInverse[3].xyz;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float maxLength = min(length(dVWorld), max(far, dhRenderDistance))/length(dVWorld);
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float maxLength = min(length(dVWorld), max(far, dhVoxyRenderDistance))/length(dVWorld);
|
||||
#else
|
||||
float maxLength = min(length(dVWorld), far)/length(dVWorld);
|
||||
#endif
|
||||
|
||||
@@ -190,13 +190,23 @@ void applySceneControllerParameters(
|
||||
// fog = (uniform fog density, cloudy fog density)
|
||||
// ... and more, eventually
|
||||
|
||||
#ifndef VOXY_PROGRAM
|
||||
flat varying struct sceneController {
|
||||
vec2 smallCumulus;
|
||||
vec2 largeCumulus;
|
||||
vec2 altostratus;
|
||||
vec2 cirrus;
|
||||
vec2 fog;
|
||||
} parameters;
|
||||
} SC_parameters;
|
||||
#else
|
||||
struct sceneController {
|
||||
vec2 smallCumulus;
|
||||
vec2 largeCumulus;
|
||||
vec2 altostratus;
|
||||
vec2 cirrus;
|
||||
vec2 fog;
|
||||
} SC_parameters;
|
||||
#endif
|
||||
|
||||
vec3 writeSceneControllerParameters(
|
||||
vec2 uv,
|
||||
@@ -250,10 +260,10 @@ void readSceneControllerParameters(
|
||||
|
||||
// in colortex4, read the data stored within the 3 components of the sampled pixels, and pass it to the fragment stage
|
||||
// 4th compnent/alpha is storing 1/4 res depth so i cant store there lol
|
||||
vec3 data1 = texelFetch2D(colortex,ivec2(1,3),0).rgb/150.0;
|
||||
vec3 data2 = texelFetch2D(colortex,ivec2(2,3),0).rgb/150.0;
|
||||
vec3 data3 = texelFetch2D(colortex,ivec2(3,3),0).rgb/150.0;
|
||||
vec3 data4 = texelFetch2D(colortex,ivec2(2,1),0).rgb/150.0;
|
||||
vec3 data1 = texelFetch(colortex,ivec2(1,3),0).rgb/150.0;
|
||||
vec3 data2 = texelFetch(colortex,ivec2(2,3),0).rgb/150.0;
|
||||
vec3 data3 = texelFetch(colortex,ivec2(3,3),0).rgb/150.0;
|
||||
vec3 data4 = texelFetch(colortex,ivec2(2,1),0).rgb/150.0;
|
||||
|
||||
smallCumulus = vec2(data1.x,data1.y);
|
||||
largeCumulus = vec2(data1.z,data2.x);
|
||||
|
||||
@@ -420,10 +420,13 @@ uniform int moonPhase;
|
||||
#define daySpeed 1.0 // [0.1 0.125 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.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.5 3.0 3.5 4.0 4.5 5.0]
|
||||
#define nightSpeed 1.0 // [0.1 0.125 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.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.5 3.0 3.5 4.0 4.5 5.0]
|
||||
|
||||
#ifndef VOXY_PROGRAM
|
||||
uniform vec3 unsigned_WsunVecSmooth;
|
||||
uniform vec3 unsigned_WmoonVecSmooth;
|
||||
#endif
|
||||
|
||||
#define WsunVecSmooth normalize(unsigned_WsunVecSmooth)
|
||||
|
||||
uniform vec3 unsigned_WmoonVecSmooth;
|
||||
#define WmoonVecSmooth normalize(unsigned_WmoonVecSmooth)
|
||||
|
||||
#define SKY_GROUND
|
||||
@@ -1055,6 +1058,17 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#ifdef LPV_HANDHELD_SHADOWS
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// ----- VOXY SETTINGS ----- //
|
||||
//////////////////////////////////
|
||||
|
||||
#define VOXY_REFLECTIONS
|
||||
|
||||
#ifdef VOXY_REFLECTIONS
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
// ----- DEBUG SETTINGS ----- //
|
||||
////////////////////////////////
|
||||
@@ -1156,3 +1170,4 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#undef VOLUMETRIC_CLOUDS
|
||||
#undef CLOUDS_SHADOWS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -175,11 +175,11 @@ vec3 skyFromTex(vec3 pos,sampler2D sampler){
|
||||
|
||||
return texture2D(sampler,p*texelSize*256.+vec2(18.5,1.5)*texelSize).rgb;
|
||||
}
|
||||
vec3 skyFromTexLOD(vec3 pos,sampler2D sampler, float LOD){
|
||||
vec2 p = sphereToCarte(pos);
|
||||
|
||||
return texture2DLod(sampler,p*texelSize*256.+vec2(18.5,1.5)*texelSize,LOD).rgb;
|
||||
}
|
||||
// vec3 skyFromTexLOD(vec3 pos,sampler2D sampler, float LOD){
|
||||
// vec2 p = sphereToCarte(pos);
|
||||
//
|
||||
// return texture2DLod(sampler,p*texelSize*256.+vec2(18.5,1.5)*texelSize,LOD).rgb;
|
||||
// }
|
||||
|
||||
vec4 skyCloudsFromTex(vec3 pos,sampler2D sampler){
|
||||
|
||||
@@ -231,5 +231,5 @@ vec4 volumetricsFromTex(vec3 pos,sampler2D sampler, float LOD){
|
||||
|
||||
vec2 uv = p*texelSize*256. + vec2(256.0 - 256.0*0.12,1.5)*texelSize;
|
||||
|
||||
return texture2DLod(sampler, uv, LOD);
|
||||
return texture2D(sampler, uv, LOD);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#if defined DISTANT_HORIZONS && defined DH_SCREENSPACE_REFLECTIONS
|
||||
float invLinZ_DH (float lindepth){
|
||||
return -((2.0*near/lindepth)-dhFarPlane-near)/(dhFarPlane-near);
|
||||
return -((2.0*near/lindepth)-dhVoxyFarPlane-near)/(dhVoxyFarPlane-near);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -103,22 +103,6 @@ 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));
|
||||
//}
|
||||
//
|
||||
//
|
||||
//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;
|
||||
@@ -127,7 +111,7 @@ float shlickFresnelRoughness(float XdotN, float roughness){
|
||||
#define combined_projection_matrix mat4(combined_projection_matrix_0, combined_projection_matrix_1, combined_projection_matrix_2, combined_projection_matrix_3)
|
||||
|
||||
float invertLinearizeDepthFast(const in float z) {
|
||||
return (dhFarPlane * (z - near)) / (z * (dhFarPlane - near));
|
||||
return (dhVoxyFarPlane * (z - near)) / (z * (dhVoxyFarPlane - near));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -187,7 +171,7 @@ vec3 rayTraceSpeculars(vec3 dir, vec3 position, float dither, float quality, boo
|
||||
float sampleDepth = texelFetch2D(colortex12, ivec2(spos.xy/texelSize/4.0),0).a/65000.0;
|
||||
#endif
|
||||
|
||||
float sp = invertLinearizeDepthFast(sqrt(sampleDepth)*dhFarPlane);
|
||||
float sp = invertLinearizeDepthFast(sqrt(sampleDepth)*dhVoxyFarPlane);
|
||||
#else
|
||||
float sampleDepth = texelFetch2D(colortex4, ivec2(spos.xy/texelSize/4.0),0).a/65000.0;
|
||||
float sp = invLinZ(sqrt(sampleDepth));
|
||||
|
||||
@@ -130,7 +130,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
default : { break; }
|
||||
|
||||
case CIRRUS_LAYER: {
|
||||
coverage = parameters.cirrus.x;
|
||||
coverage = SC_parameters.cirrus.x;
|
||||
|
||||
vec2 coord = position.zx + 6.0*cloud_movement;
|
||||
|
||||
@@ -166,7 +166,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
break; }
|
||||
|
||||
case ALTOSTRATUS_LAYER: {
|
||||
coverage = parameters.altostratus.x;
|
||||
coverage = SC_parameters.altostratus.x;
|
||||
coverage += Rain_coverage * rainStrength;
|
||||
coverage += Thunder_coverage * thunderStrength;
|
||||
|
||||
@@ -185,7 +185,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
break; }
|
||||
|
||||
case LARGECUMULUS_LAYER: {
|
||||
coverage = parameters.largeCumulus.x;
|
||||
coverage = SC_parameters.largeCumulus.x;
|
||||
coverage += Rain_coverage * rainStrength;
|
||||
coverage += Thunder_coverage * thunderStrength;
|
||||
|
||||
@@ -201,7 +201,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
break; }
|
||||
|
||||
case SMALLCUMULUS_LAYER: {
|
||||
coverage = parameters.smallCumulus.x;
|
||||
coverage = SC_parameters.smallCumulus.x;
|
||||
coverage += Rain_coverage * rainStrength;
|
||||
coverage += Thunder_coverage * thunderStrength;
|
||||
|
||||
@@ -420,15 +420,15 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){
|
||||
|
||||
#ifdef CloudLayer0
|
||||
startPosition = playerPos + startOffset * max((CloudLayer0_height + 20.0) - playerPos.y, 0.0);
|
||||
cloudShadows = getCloudShape(SMALLCUMULUS_LAYER, 0, startPosition, CloudLayer0_height, CloudLayer0_height + CloudLayer0_tallness/CloudLayer0_scale)*(getRainDensity(parameters.smallCumulus.y));
|
||||
cloudShadows = getCloudShape(SMALLCUMULUS_LAYER, 0, startPosition, CloudLayer0_height, CloudLayer0_height + CloudLayer0_tallness/CloudLayer0_scale)*(getRainDensity(SC_parameters.smallCumulus.y));
|
||||
#endif
|
||||
#ifdef CloudLayer1
|
||||
startPosition = playerPos + startOffset * max((CloudLayer1_height + 30.0) - playerPos.y, 0.0);
|
||||
cloudShadows += getCloudShape(LARGECUMULUS_LAYER, 0, startPosition, CloudLayer1_height, CloudLayer1_height + CloudLayer1_tallness/CloudLayer1_scale)*(getRainDensity(parameters.largeCumulus.y));
|
||||
cloudShadows += getCloudShape(LARGECUMULUS_LAYER, 0, startPosition, CloudLayer1_height, CloudLayer1_height + CloudLayer1_tallness/CloudLayer1_scale)*(getRainDensity(SC_parameters.largeCumulus.y));
|
||||
#endif
|
||||
#ifdef CloudLayer2
|
||||
startPosition = playerPos + startOffset * max(CloudLayer2_height - playerPos.y, 0.0);
|
||||
cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height + 5.0)*parameters.altostratus.y * (1.0-abs(WsunVec.y));
|
||||
cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height + 5.0)*SC_parameters.altostratus.y * (1.0-abs(sunVector.y));
|
||||
#endif
|
||||
#if CUMULONIMBUS > 0
|
||||
float distanceFactor = clamp(degrees(acos(dot(vec3(0.0, 1.0, 0.0), sunVector))), 45.0, 90.0) - 45.0;
|
||||
@@ -656,10 +656,10 @@ vec4 raymarchCloud(
|
||||
vec3 newPos = rayPosition - cameraPosition;
|
||||
|
||||
if(LayerIndex == ALTOSTRATUS_LAYER) {
|
||||
density = parameters.altostratus.y;
|
||||
density = SC_parameters.altostratus.y;
|
||||
density *= smoothstep(CloudLayer2_distance, CloudLayer2_distance*0.5, length(newPos));
|
||||
} else {
|
||||
density = parameters.cirrus.y;
|
||||
density = SC_parameters.cirrus.y;
|
||||
density *= smoothstep(CloudLayer3_distance, CloudLayer3_distance*0.5, length(newPos));
|
||||
}
|
||||
if (density == 0.0) return vec4(color, totalAbsorbance);
|
||||
@@ -713,13 +713,13 @@ vec4 raymarchCloud(
|
||||
|
||||
vec3 newPos = rayPosition - cameraPosition;
|
||||
|
||||
float densityLarge = getRainDensity(parameters.largeCumulus.y);
|
||||
float densityLarge = getRainDensity(SC_parameters.largeCumulus.y);
|
||||
|
||||
float density = 0.0;
|
||||
|
||||
if(LayerIndex == SMALLCUMULUS_LAYER) density = getRainDensity(parameters.smallCumulus.y) * smoothstep(CloudLayer0_distance, CloudLayer0_distance*0.5, length(newPos));
|
||||
if(LayerIndex == SMALLCUMULUS_LAYER) density = getRainDensity(SC_parameters.smallCumulus.y) * smoothstep(CloudLayer0_distance, CloudLayer0_distance*0.5, length(newPos));
|
||||
|
||||
if(LayerIndex == LARGECUMULUS_LAYER) density = getRainDensity(parameters.largeCumulus.y) * smoothstep(CloudLayer1_distance, CloudLayer1_distance*0.5, length(newPos));
|
||||
if(LayerIndex == LARGECUMULUS_LAYER) density = getRainDensity(SC_parameters.largeCumulus.y) * smoothstep(CloudLayer1_distance, CloudLayer1_distance*0.5, length(newPos));
|
||||
|
||||
if(LayerIndex == CUMULONIMBUS_LAYER) density = 0.8;
|
||||
|
||||
@@ -818,7 +818,7 @@ vec4 raymarchCloud(
|
||||
// altostratus layer -> all cumulus layers
|
||||
#ifdef CloudLayer2
|
||||
shadowStartPos = rayPosition + mainLightVec / abs(mainLightVec.y) * max(CloudLayer2_height - rayPosition.y, 0.0);
|
||||
sunShadowMask += getCloudShape(ALTOSTRATUS_LAYER, 0, shadowStartPos, CloudLayer2_height, CloudLayer2_height) * parameters.altostratus.y * (1.0-abs(mainLightVec.y));
|
||||
sunShadowMask += getCloudShape(ALTOSTRATUS_LAYER, 0, shadowStartPos, CloudLayer2_height, CloudLayer2_height) * SC_parameters.altostratus.y * (1.0-abs(mainLightVec.y));
|
||||
#endif
|
||||
|
||||
vec3 lighting = getCloudLighting(LayerIndex, shapeWithDensity, shapeWithDensityFaded, sunShadowMask, sunScattering, moonScattering, indirectShadowMask, skyScattering*skylightOcclusion, rayPosition, backScatterPhase, phaseLevels, backScatterPhase2, phaseLevels2);
|
||||
@@ -937,8 +937,8 @@ vec4 GetVolumetricClouds(
|
||||
|
||||
float heightRelativeToClouds = clamp(1.0 - max(cameraPosition.y - minHeight,0.0) / 100.0 ,0.0,1.0);
|
||||
|
||||
#if defined DISTANT_HORIZONS
|
||||
float maxdist = dhFarPlane - 16.0;
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float maxdist = dhVoxyFarPlane - 16.0;
|
||||
#else
|
||||
float maxdist = far + 16.0*5.0;
|
||||
#endif
|
||||
@@ -985,8 +985,8 @@ vec4 GetVolumetricClouds(
|
||||
// setup for getting distance
|
||||
vec3 playerPos = mat3(gbufferModelViewInverse) * viewPos;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float maxLength = min(length(playerPos), max(far, dhRenderDistance))/length(playerPos);
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float maxLength = min(length(playerPos), max(far, dhVoxyRenderDistance))/length(playerPos);
|
||||
#else
|
||||
float maxLength = min(length(playerPos), far)/length(playerPos);
|
||||
#endif
|
||||
|
||||
+37
-13
@@ -29,14 +29,6 @@ beacon.beam.depth = true
|
||||
|
||||
iris.features.optional = ENTITY_TRANSLUCENT REVERSED_CULLING COMPUTE_SHADERS CUSTOM_IMAGES BLOCK_EMISSION_ATTRIBUTE SSBO TESSELLATION_SHADERS
|
||||
|
||||
#if RESOURCEPACK_SKY == 2 || RESOURCEPACK_SKY == 3
|
||||
sun=true
|
||||
moon=true
|
||||
#else
|
||||
sun=false
|
||||
moon=false
|
||||
#endif
|
||||
|
||||
#ifdef REALMOON
|
||||
customTexture.moon = texture/moon.png
|
||||
#ifdef MOON_NORMALS
|
||||
@@ -101,6 +93,19 @@ iris.features.optional = ENTITY_TRANSLUCENT REVERSED_CULLING COMPUTE_SHADERS CUS
|
||||
separateEntityDraws = false
|
||||
#endif
|
||||
|
||||
#if RESOURCEPACK_SKY == 2 || RESOURCEPACK_SKY == 3
|
||||
sun=true
|
||||
moon=true
|
||||
#else
|
||||
sun=false
|
||||
moon=false
|
||||
#endif
|
||||
|
||||
#if RESOURCEPACK_SKY != 0
|
||||
particles.before.deferred=false
|
||||
particles.ordering=after
|
||||
#endif
|
||||
|
||||
program.world0/gbuffers_entities_translucent.enabled = TRANSLUCENT_ENTITIES && IS_IRIS
|
||||
program.world0/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES && IS_IRIS
|
||||
|
||||
@@ -144,6 +149,12 @@ program.world0/composite5.enabled = TAA_UPSCALING
|
||||
program.world1/composite5.enabled = TAA_UPSCALING
|
||||
program.world-1/composite5.enabled = TAA_UPSCALING
|
||||
|
||||
#if RESOURCEPACK_SKY == 0
|
||||
program.world0/deferred2.enabled = false
|
||||
program.world1/deferred2.enabled = false
|
||||
program.world-1/deferred2.enabled = false
|
||||
#endif
|
||||
|
||||
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
|
||||
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
||||
#Get the correct alpha value : S_A*(1-DST_A)+DST_A
|
||||
@@ -502,11 +513,12 @@ SHADER_VERSION_LABEL <profile> \
|
||||
|
||||
|
||||
######## MOD SUPPORT SETTINGS
|
||||
screen.Mod_support = [DISTANT_HORIZONS_SETTINGS] [PHYSICS_MOD_OCEAN] CAELUM_SUPPORT
|
||||
screen.Mod_support = [DISTANT_HORIZONS_SETTINGS] [PHYSICS_MOD_OCEAN] [VOXY_SETTINGS] CAELUM_SUPPORT
|
||||
|
||||
screen.DISTANT_HORIZONS_SETTINGS.columns = 1
|
||||
screen.DISTANT_HORIZONS_SETTINGS = DH_OVERDRAW_PREVENTION OVERDRAW_MAX_DISTANCE DH_CHUNK_FADING <empty> DH_AMBIENT_OCCLUSION DH_SUBSURFACE_SCATTERING DH_SCREENSPACE_REFLECTIONS DH_TAA_JITTER DH_NOISE_TEXTURE NOISE_RESOLUTION NOISE_INTENSITY NOISE_DROPOFF <empty> DISTANT_HORIZONS_SHADOWMAP shadowDistance shadowMapResolution <empty> TOGGLE_VL_FOG VOLUMETRIC_CLOUDS
|
||||
|
||||
screen.VOXY_SETTINGS = VOXY_REFLECTIONS
|
||||
|
||||
######## MISC SETTINGS
|
||||
screen.Misc_Settings.columns = 2
|
||||
@@ -800,7 +812,7 @@ uniform.vec2.texelSize = vec2(texelSizeX,texelSizeY)
|
||||
uniform.int.framemod8 = frameCounter%8
|
||||
#endif
|
||||
|
||||
#if defined DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
uniform.int.framemod4_DH = frameCounter%4
|
||||
#endif
|
||||
|
||||
@@ -913,6 +925,18 @@ uniform.float.worldTimeSmooth = if(worldTime > 200 || worldDayTime > 0, worldTim
|
||||
#
|
||||
# uniform.float.shadowMaxProj = 150.0/abs(sunPosY)
|
||||
|
||||
#ifdef VOXY
|
||||
uniform.float.dhVoxyNearPlane = 16.0
|
||||
uniform.float.dhVoxyFarPlane = 48000.0
|
||||
uniform.int.dhVoxyRenderDistance = vxRenderDistance*16
|
||||
#else
|
||||
uniform.float.dhVoxyNearPlane = dhNearPlane
|
||||
uniform.float.dhVoxyFarPlane = dhFarPlane
|
||||
uniform.int.dhVoxyRenderDistance = dhRenderDistance
|
||||
#endif
|
||||
|
||||
uniform.vec2.taa_offset = vec2(0.0, 0.0)
|
||||
|
||||
|
||||
###############################
|
||||
####### FLOODFILL STUFF #######
|
||||
@@ -956,11 +980,11 @@ uniform.float.worldTimeSmooth = if(worldTime > 200 || worldDayTime > 0, worldTim
|
||||
#endif
|
||||
|
||||
uniform.float.combined_near = near
|
||||
uniform.float.combined_far = dhFarPlane
|
||||
uniform.float.combined_far = 48000
|
||||
uniform.vec4.combined_projection_matrix_0 = vec4(gbufferProjection.0.0, 0.0, 0.0, 0.0)
|
||||
uniform.vec4.combined_projection_matrix_1 = vec4(0.0, gbufferProjection.1.1, 0.0, 0.0)
|
||||
uniform.vec4.combined_projection_matrix_2 = vec4(gbufferProjection.2.0, gbufferProjection.2.1, -((near + dhFarPlane) / (dhFarPlane - near)), 0.0)
|
||||
uniform.vec4.combined_projection_matrix_3 = vec4(0.0, 0.0, -((2.0 * dhFarPlane * near) / (dhFarPlane - near)), 0.0)
|
||||
uniform.vec4.combined_projection_matrix_2 = vec4(gbufferProjection.2.0, gbufferProjection.2.1, -((near + combined_far) / (combined_far - near)), 0.0)
|
||||
uniform.vec4.combined_projection_matrix_3 = vec4(0.0, 0.0, -((2.0 * combined_far * near) / (combined_far - near)), 0.0)
|
||||
|
||||
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT
|
||||
bufferObject.0 = 512
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 330 compatibility
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define NETHER_SHADER
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENCHANT_GLINT
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENCHANT_GLINT
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define LINES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define LINES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BEACON_BEAM
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BEACON_BEAM
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define BLOCKENTITIES
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define BLOCKENTITIES
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BLOCKENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define BLOCKENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define DAMAGE_BLOCK_EFFECT
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define DAMAGE_BLOCK_EFFECT
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define ENTITIES
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
|
||||
// #define WORLD
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define GLOWING
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define GLOWING
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define ENTITIES
|
||||
#define NETHER_SHADER
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define HAND
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define WORLD
|
||||
#define HAND
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef MC_OS_MAC
|
||||
#version 430 compatibility
|
||||
#else
|
||||
#version 120
|
||||
#endif
|
||||
|
||||
#define HAND
|
||||
#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