mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-10 04:53:07 +08:00
Fix Voxy with cumulonimbus clouds, fix Voxy TAA upscaling, add rainbow selection box outline
This commit is contained in:
@@ -171,7 +171,7 @@ float invLdFast(float linearDepth) {
|
||||
|
||||
vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
|
||||
float biasAmount = 0.0000015;
|
||||
const float biasAmount = 0.0000015;
|
||||
|
||||
float quality = float(FORWARD_SSR_QUALITY);
|
||||
vec3 clipPosition = DH_toClipSpace3(position);
|
||||
@@ -180,12 +180,7 @@ vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
(-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);
|
||||
|
||||
@@ -109,8 +109,11 @@ uniform vec3 relativeEyePosition;
|
||||
uniform int heldItemId;
|
||||
uniform int heldItemId2;
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#if defined IS_LPV_ENABLED || RAINBOW_SELECT_BOX > 0
|
||||
#include "/lib/hsv.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef IS_LPV_ENABLED
|
||||
#include "/lib/lpv_common.glsl"
|
||||
#include "/lib/lpv_render.glsl"
|
||||
#endif
|
||||
@@ -527,7 +530,19 @@ void main() {
|
||||
#ifdef LINES
|
||||
gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * toLinear(color.rgb);
|
||||
|
||||
if(SELECTION_BOX > 0) gl_FragData[0].rgba = vec4(toLinear(vec3(SELECT_BOX_COL_R, SELECT_BOX_COL_G, SELECT_BOX_COL_B)), 1.0);
|
||||
#if RAINBOW_SELECT_BOX > 0
|
||||
|
||||
#if RAINBOW_SELECT_BOX == 1
|
||||
float selectBoxHue = length(sin(mod(1.4*(feetPlayerPos+cameraPosition), 3.14159)));
|
||||
#else
|
||||
float selectBoxHue = length(sin(mod(1.4*(feetPlayerPos+cameraPosition)+0.7*frameTimeCounter, 3.14159)));
|
||||
#endif
|
||||
|
||||
vec3 selectBoxColor = HsvToRgb(vec3(selectBoxHue, 1.0, 1.0));
|
||||
if(SELECTION_BOX > 0) gl_FragData[0].rgba = vec4(toLinear(selectBoxColor), 1.0);
|
||||
#else
|
||||
if(SELECTION_BOX > 0) gl_FragData[0].rgba = vec4(toLinear(vec3(SELECT_BOX_COL_R, SELECT_BOX_COL_G, SELECT_BOX_COL_B)), 1.0);
|
||||
#endif
|
||||
|
||||
// float LITEMATICA_SCHEMATIC_THING_MASK = 0.0;
|
||||
// if (renderStage == MC_RENDER_STAGE_NONE){
|
||||
|
||||
@@ -55,6 +55,12 @@ uniform sampler2D depthtex0;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#define dhVoxyDepthTex1 dhDepthTex1
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex7;
|
||||
|
||||
@@ -952,22 +952,16 @@ void main() {
|
||||
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);
|
||||
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
float dhDepthOpaque = DH_depth1;
|
||||
float dhDepthOpaqueL = linearizeDepthFast(dhDepthOpaque, dhVoxyNearPlane, dhVoxyFarPlane);
|
||||
float dhDepthOpaque = DH_depth1;
|
||||
float dhDepthOpaqueL = linearizeDepthFast(dhDepthOpaque, dhVoxyNearPlane, dhVoxyFarPlane);
|
||||
|
||||
if (depthOpaque >= 1.0 || (dhDepthOpaqueL < depthOpaqueL && dhDepthOpaque > 0.0)){
|
||||
depthOpaque = dhDepthOpaque;
|
||||
depthOpaqueL = dhDepthOpaqueL;
|
||||
}
|
||||
#endif
|
||||
if (depthOpaque >= 1.0 || (dhDepthOpaqueL < depthOpaqueL && dhDepthOpaque > 0.0)){
|
||||
depthOpaque = dhDepthOpaque;
|
||||
depthOpaqueL = dhDepthOpaqueL;
|
||||
}
|
||||
|
||||
swappedDepth = depthOpaque;
|
||||
#else
|
||||
|
||||
@@ -68,8 +68,8 @@ float ld(float depth) {
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#endif
|
||||
uniform float dhVoxyNearPlane;
|
||||
uniform float dhVoxyFarPlane;
|
||||
|
||||
@@ -526,10 +526,6 @@ void main() {
|
||||
|
||||
#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
|
||||
|
||||
@@ -16,16 +16,12 @@ 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;
|
||||
@@ -553,10 +549,7 @@ void main() {
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
@@ -137,8 +137,8 @@ float convertHandDepth2( float depth) {
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#endif
|
||||
|
||||
uniform float near;
|
||||
|
||||
@@ -18,8 +18,8 @@ uniform sampler2D depthtex1;
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
#define dhVoxyDepthTex1 vxDepthTexTrans
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#define dhVoxyDepthTex1 vxDepthTexOpaque
|
||||
#endif
|
||||
uniform float near;
|
||||
uniform float far;
|
||||
|
||||
@@ -7,8 +7,8 @@ uniform sampler2D depthtex0;
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
uniform sampler2D vxDepthTexOpaque;
|
||||
#define dhVoxyDepthTex vxDepthTexOpaque
|
||||
uniform sampler2D vxDepthTexTrans;
|
||||
#define dhVoxyDepthTex vxDepthTexTrans
|
||||
#endif
|
||||
uniform sampler2D colortex1;
|
||||
uniform sampler2D colortex2;
|
||||
|
||||
@@ -316,9 +316,6 @@ void main() {
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
// float DH_z = texture2D(dhDepthTex1,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
|
||||
|
||||
@@ -58,7 +58,15 @@
|
||||
bool noSimOngoingCheck;
|
||||
|
||||
}"},
|
||||
"useViewportDims": true,
|
||||
"uniforms": [
|
||||
"worldDay",
|
||||
"worldTime",
|
||||
"moonElevation",
|
||||
"worldTimeSmooth",
|
||||
#if CUMULONIMBUS > 0
|
||||
"cumulonimbusStrength",
|
||||
#endif
|
||||
"framemod4_DH",
|
||||
"vxModelView",
|
||||
"vxModelViewPrev",
|
||||
@@ -89,6 +97,7 @@
|
||||
"sunPosition",
|
||||
"sunElevation",
|
||||
"lightningBoltPosition",
|
||||
"thunderStrength",
|
||||
"rainStrength",
|
||||
"unsigned_WsunVecSmooth",
|
||||
"unsigned_WmoonVecSmooth",
|
||||
|
||||
@@ -121,7 +121,7 @@ float DH_ld(float dist) {
|
||||
|
||||
vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
|
||||
float biasAmount = 0.000015;
|
||||
const float biasAmount = 0.000015;
|
||||
|
||||
float quality = float(FORWARD_SSR_QUALITY);
|
||||
vec3 clipPosition = DH_toClipSpace3(position);
|
||||
@@ -131,11 +131,6 @@ vec3 rayTrace(vec3 dir, vec3 position, float dither, float fresnel) {
|
||||
|
||||
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);
|
||||
|
||||
+12
-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 = 5.1.0
|
||||
value.SHADER_VERSION_LABEL.482 = 5.1.1
|
||||
|
||||
# if you're here to translate, this is not a joke, these do what they say
|
||||
profile.POTATO=§4Potato
|
||||
@@ -912,6 +912,17 @@ option.EMISSIVE_ORES_STRENGTH = Emissive Ores Brightness
|
||||
option.PLANET_CURVATURE = Planet Curvature §c(Voxy not supported!)
|
||||
option.CURVATURE_AMOUNT = Curvature Amount
|
||||
|
||||
screen.selection_box_outline = Selection Box Outline
|
||||
option.SELECT_BOX = Selection Box
|
||||
option.RAINBOW_SELECT_BOX = Rainbow Selection Box
|
||||
value.RAINBOW_SELECT_BOX.0 = Off
|
||||
value.RAINBOW_SELECT_BOX.1 = Static
|
||||
value.RAINBOW_SELECT_BOX.2 = Animated
|
||||
|
||||
option.SELECT_BOX_COL_R = Selection Box Red
|
||||
option.SELECT_BOX_COL_G = Selection Box Green
|
||||
option.SELECT_BOX_COL_B = Selection Box Blue
|
||||
|
||||
option.USE_CUSTOM_DIFFUSE_LIGHTING_COLORS = Custom Diffuse Colors
|
||||
option.DIRECTLIGHT_DIFFUSE_R = Sun R
|
||||
option.DIRECTLIGHT_DIFFUSE_G = Sun G
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - Bliss 编辑版
|
||||
prefix.SHADER_VERSION_LABEL = 版本
|
||||
value.SHADER_VERSION_LABEL.482 = 5.1.0
|
||||
value.SHADER_VERSION_LABEL.482 = 5.1.1
|
||||
|
||||
# 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名
|
||||
profile.POTATO=§4土豆 (极低配置)
|
||||
|
||||
@@ -234,7 +234,7 @@ vec4 GetVolumetricFog(
|
||||
float verticalFactor = abs(normalize(dVWorld).y);
|
||||
verticalFactor = pow(verticalFactor, 2.0);
|
||||
|
||||
#if defined DISTANT_HORIZONS
|
||||
#if defined DISTANT_HORIZONS || defined VOXY
|
||||
int SAMPLECOUNT = 19;
|
||||
float expFactor = 33.0;
|
||||
float maxDist = mix(800.0, 300.0, verticalFactor);
|
||||
|
||||
@@ -98,7 +98,7 @@ vec4 BilateralUpscale_SSAO(sampler2D tex, sampler2D depth, vec2 coord, float ref
|
||||
|
||||
vec3 rayTrace_GI(vec3 dir,vec3 position,float dither, float quality){
|
||||
|
||||
float biasAmount = 0.0001;
|
||||
const float biasAmount = 0.0001;
|
||||
|
||||
vec3 clipPosition = toClipSpace3(position);
|
||||
|
||||
@@ -154,7 +154,7 @@ vec3 RT_alternate(vec3 dir, vec3 position, float noise, float stepsizes, bool ha
|
||||
|
||||
vec3 worldpos = mat3(gbufferModelViewInverse) * position;
|
||||
|
||||
float biasamount = 0.00005;
|
||||
const float biasamount = 0.00005;
|
||||
vec2 screenEdges = 2.0/vec2(viewWidth, viewHeight);
|
||||
|
||||
float dist = 1.0 + length(worldpos)/far; // step length as distance increases
|
||||
|
||||
@@ -990,6 +990,8 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#define GRASS_NOISE1_SCALE 0.75 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25]
|
||||
#define GRASS_NOISE2_SCALE 0.35 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25]
|
||||
|
||||
#define RAINBOW_SELECT_BOX 0 // [0 1 2]
|
||||
|
||||
///////////////////////////////////////////
|
||||
// ----- DISTANT HORIZONS SETTINGS ----- //
|
||||
///////////////////////////////////////////
|
||||
@@ -1178,3 +1180,6 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
|
||||
#undef CLOUDS_SHADOWS
|
||||
#endif
|
||||
|
||||
#ifdef VOXY
|
||||
#undef DISTANT_HORIZONS
|
||||
#endif
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
#define LARGECUMULUS_LAYER 1
|
||||
#define SMALLCUMULUS_LAYER 0
|
||||
|
||||
#ifndef VOXY_PROGRAM
|
||||
uniform float thunderStrength;
|
||||
uniform int entityId;
|
||||
uniform int worldDay;
|
||||
uniform int worldTime;
|
||||
uniform float moonElevation;
|
||||
uniform float worldTimeSmooth;
|
||||
#endif
|
||||
|
||||
|
||||
#if CLOUD_MOVEMENT_TYPE == 0
|
||||
@@ -29,18 +30,20 @@ float lightningFlash = mix(0.1, 2.5, randomSeed);
|
||||
float lightningFade = smoothstep(0.6, 0.22, timeInLightning);
|
||||
#endif
|
||||
|
||||
#if CUMULONIMBUS == 1
|
||||
#if CUMULONIMBUS == 1 && !defined VOXY_PROGRAM
|
||||
uniform float cumulonimbusStrength;
|
||||
#endif
|
||||
|
||||
#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0
|
||||
#ifndef COLORWHEEL
|
||||
#if !defined COLORWHEEL && !defined VOXY_PROGRAM
|
||||
#extension GL_NV_gpu_shader5 : enable
|
||||
#extension GL_ARB_shader_image_load_store : enable
|
||||
#extension GL_EXT_shader_image_load_store : enable
|
||||
#endif
|
||||
|
||||
#ifndef VOXY_PROGRAM
|
||||
layout (rgba16f) uniform image2D cloudDepthTex;
|
||||
#endif
|
||||
|
||||
float lightningStart = mix(20.0, 1.0, smoothstep(0.0, 0.085, timeInLightning));
|
||||
float lightningMid = smoothstep(0.0, 0.05, timeInLightning) * smoothstep(0.15, 0.066, timeInLightning);
|
||||
@@ -129,6 +132,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
switch (LayerIndex){
|
||||
default : { break; }
|
||||
|
||||
#ifdef CloudLayer3
|
||||
case CIRRUS_LAYER: {
|
||||
coverage = SC_parameters.cirrus.x;
|
||||
|
||||
@@ -163,8 +167,10 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
if (position.y < (-0.0001 * minHeight + 0.8)*minHeight) shape = 0.0;
|
||||
|
||||
return shape;
|
||||
break; }
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CloudLayer2
|
||||
case ALTOSTRATUS_LAYER: {
|
||||
coverage = SC_parameters.altostratus.x;
|
||||
coverage += Rain_coverage * rainStrength;
|
||||
@@ -182,8 +188,10 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
if (position.y < (-0.0001 * minHeight + 0.8)*minHeight) shape = 0.0;
|
||||
|
||||
return shape;
|
||||
break; }
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CloudLayer1
|
||||
case LARGECUMULUS_LAYER: {
|
||||
coverage = SC_parameters.largeCumulus.x;
|
||||
coverage += Rain_coverage * rainStrength;
|
||||
@@ -199,7 +207,9 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
shape = min(max(val - smallCloud,0.0)/sqrt(val),1.0);
|
||||
|
||||
break; }
|
||||
#endif
|
||||
|
||||
#ifdef CloudLayer0
|
||||
case SMALLCUMULUS_LAYER: {
|
||||
coverage = SC_parameters.smallCumulus.x;
|
||||
coverage += Rain_coverage * rainStrength;
|
||||
@@ -215,6 +225,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
|
||||
// shape = abs(largeCloud*2.0 - 1.2)*0.5 - (1.0-smallCloud);
|
||||
break; }
|
||||
#endif
|
||||
}
|
||||
|
||||
// clamp density of the cloud within its upper/lower bounds
|
||||
@@ -248,6 +259,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
switch (LayerIndex){
|
||||
default : { break; }
|
||||
|
||||
#ifdef CloudLayer0
|
||||
case SMALLCUMULUS_LAYER: {
|
||||
erosion += (1.0-densityAtPos(samplePos * CloudLayer0_detail * CloudLayer0_scale / 3.0)) * sqrt(omShape);
|
||||
|
||||
@@ -256,6 +268,9 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
|
||||
erosion = erosion*erosion*erosion*erosion;
|
||||
break; }
|
||||
#endif
|
||||
|
||||
#ifdef CloudLayer1
|
||||
case LARGECUMULUS_LAYER: {
|
||||
erosion += (1.0 - densityAtPos(samplePos * CloudLayer1_detail * CloudLayer1_scale / 4.5)) * sqrt(omShape);
|
||||
|
||||
@@ -264,6 +279,7 @@ float getCloudShape(int LayerIndex, int LOD, in vec3 position, float minHeight,
|
||||
|
||||
erosion = erosion*erosion*erosion*erosion;
|
||||
break; }
|
||||
#endif
|
||||
}
|
||||
|
||||
return max(shape - erosion*erodeAmount,0.0);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user