diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index b551401..e27198f 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -670,15 +670,13 @@ void main() { normal = applyBump(tbnMatrix, NormalTex.xyz); - vec2 lightmap = clamp(lmtexcoord.zw,0.0,1.0); + vec2 lightmap = clamp(lmtexcoord.zw,0.0,0.97); vec4 data1 = vec4(encodeNormal(normal), lightmap); Albedo = clamp(vec4(Albedo.rgb,0.85),0.0,1.0); data1 = clamp(data1,0.0,1.0); - if(tangent.x == 0.0 && tangent.y == 0.0 && tangent.z == 0.0) discard; - OutAlbedo = vec4( encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), diff --git a/shaders/dimensions/all_solid.fsh b/shaders/dimensions/all_solid.fsh index 795eade..0eddfbf 100644 --- a/shaders/dimensions/all_solid.fsh +++ b/shaders/dimensions/all_solid.fsh @@ -339,6 +339,56 @@ float getTrimEmission(vec3 Albedo) { return sqrt(hsv.z); } +#if defined BLOCKENTITIES && !defined COLORWHEEL && (MC_VERSION >= 260100 || !defined SHADER_END_PORTAL) + mat2 mat2_rotate_z(float radians) { + return mat2( + cos(radians), -sin(radians), + sin(radians), cos(radians) + ); + } + + const vec3[] COLORS = vec3[]( + vec3(0.022087, 0.098399, 0.110818), + vec3(0.011892, 0.095924, 0.089485), + vec3(0.027636, 0.101689, 0.100326), + vec3(0.046564, 0.109883, 0.114838), + vec3(0.064901, 0.117696, 0.097189), + vec3(0.063761, 0.086895, 0.123646), + vec3(0.084817, 0.111994, 0.166380), + vec3(0.097489, 0.154120, 0.091064), + vec3(0.106152, 0.131144, 0.195191), + vec3(0.097721, 0.110188, 0.187229), + vec3(0.133516, 0.138278, 0.148582), + vec3(0.070006, 0.243332, 0.235792), + vec3(0.196766, 0.142899, 0.214696), + vec3(0.047281, 0.315338, 0.321970), + vec3(0.204675, 0.390010, 0.302066), + vec3(0.080955, 0.314821, 0.661491) + ); + + const mat4 SCALE_TRANSLATE = mat4( + 0.5, 0.0, 0.0, 0.25, + 0.0, 0.5, 0.0, 0.25, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + ); + + mat4 end_portal_layer(float layer) { + mat4 translate = mat4( + 1.0, 0.0, 0.0, 17.0 / layer, + 0.0, 1.0, 0.0, (2.0 + layer / 1.5) * (frameTimeCounter * 0.0011), + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + ); + + mat2 rotate = mat2_rotate_z(radians((layer * layer * 4321.0 + layer * 9.0) * 2.0)); + + mat2 scale = mat2((4.5 - layer / 4.0) * 2.0); + + return mat4(scale * rotate) * translate * SCALE_TRANSLATE; + } +#endif + uniform float alphaTestRef; //////////////////////////////VOID MAIN////////////////////////////// @@ -616,61 +666,75 @@ void main() { #endif #if defined WORLD && !defined ENTITIES && !defined HAND && defined BLOCKENTITIES && !defined COLORWHEEL && !defined CUTOUT - bool PORTAL = data_in.blockID == BLOCK_END_PORTAL || data_in.blockID == 187; + bool PORTAL = data_in.blockID == BLOCK_END_PORTAL || data_in.blockID == BLOCK_END_GATEWAY; float endPortalEmission = 0.0; if(PORTAL) { - const float steps = 20.0; + #if MC_VERSION < 260100 && defined SHADER_END_PORTAL + const float steps = 20.0; - vec3 color = vec3(0.0); - float absorbance = 1.0; + vec3 color = vec3(0.0); + float absorbance = 1.0; - vec3 worldSpaceNormal = flatNormals; + vec3 worldSpaceNormal = flatNormals; - vec3 viewVec = normalize(tbnMatrix*fragpos); - vec3 correctedViewVec = viewVec; - - correctedViewVec.xy = mix(correctedViewVec.xy, vec2( viewVec.y,-viewVec.x), clamp( worldSpaceNormal.y,0,1)); - correctedViewVec.xy = mix(correctedViewVec.xy, vec2(-viewVec.y, viewVec.x), clamp(-worldSpaceNormal.x,0,1)); - correctedViewVec.xy = mix(correctedViewVec.xy, vec2(-viewVec.y, viewVec.x), clamp(-worldSpaceNormal.z,0,1)); - - correctedViewVec.z = mix(correctedViewVec.z, -correctedViewVec.z, clamp(length(vec3(worldSpaceNormal.xz, clamp(-worldSpaceNormal.y,0,1))),0,1)); - - vec2 correctedWorldPos = playerpos.xz + cameraPosition.xz; - correctedWorldPos = mix(correctedWorldPos, vec2(-playerpos.x,playerpos.z) + vec2(-cameraPosition.x,cameraPosition.z), clamp(-worldSpaceNormal.y,0,1)); - correctedWorldPos = mix(correctedWorldPos, vec2( playerpos.z,playerpos.y) + vec2( cameraPosition.z,cameraPosition.y), clamp( worldSpaceNormal.x,0,1)); - correctedWorldPos = mix(correctedWorldPos, vec2(-playerpos.z,playerpos.y) + vec2(-cameraPosition.z,cameraPosition.y), clamp(-worldSpaceNormal.x,0,1)); - correctedWorldPos = mix(correctedWorldPos, vec2( playerpos.x,playerpos.y) + vec2( cameraPosition.x,cameraPosition.y), clamp(-worldSpaceNormal.z,0,1)); - correctedWorldPos = mix(correctedWorldPos, vec2(-playerpos.x,playerpos.y) + vec2(-cameraPosition.x,cameraPosition.y), clamp( worldSpaceNormal.z,0,1)); - - - vec2 rayDir = ((correctedViewVec.xy) / -correctedViewVec.z) / steps * 5.0 ; - - vec2 uv = correctedWorldPos + rayDir * BN; - uv += rayDir * 10.0; - - vec2 animation = vec2(frameTimeCounter, -frameTimeCounter)*0.01; - - for (int i = 0; i < int(steps); i++) { + vec3 viewVec = normalize(tbnMatrix*fragpos); + vec3 correctedViewVec = viewVec; - float verticalGradient = (i + BN)/steps ; - float verticalGradient2 = exp(-7*(1-verticalGradient*verticalGradient)); - - float density = max(max(verticalGradient - texture(noisetex, uv/256.0 + animation.xy).b*0.5,0.0) - (1.0-texture(noisetex, uv/32.0 + animation.xx).r) * (0.4 + 0.1 * (texture(noisetex, uv/10.0 - animation.yy).b)),0.0); - - float volumeCoeff = exp(-density*(i+1)); + correctedViewVec.xy = mix(correctedViewVec.xy, vec2( viewVec.y,-viewVec.x), clamp( worldSpaceNormal.y,0,1)); + correctedViewVec.xy = mix(correctedViewVec.xy, vec2(-viewVec.y, viewVec.x), clamp(-worldSpaceNormal.x,0,1)); + correctedViewVec.xy = mix(correctedViewVec.xy, vec2(-viewVec.y, viewVec.x), clamp(-worldSpaceNormal.z,0,1)); - vec3 lighting = vec3(0.5,0.75,1.0) * 0.1 * exp(-10*density) + vec3(0.8,0.3,1.0) * verticalGradient2 * 1.7; - color += (lighting - lighting * volumeCoeff) * absorbance;; + correctedViewVec.z = mix(correctedViewVec.z, -correctedViewVec.z, clamp(length(vec3(worldSpaceNormal.xz, clamp(-worldSpaceNormal.y,0,1))),0,1)); + + vec2 correctedWorldPos = playerpos.xz + cameraPosition.xz; + correctedWorldPos = mix(correctedWorldPos, vec2(-playerpos.x,playerpos.z) + vec2(-cameraPosition.x,cameraPosition.z), clamp(-worldSpaceNormal.y,0,1)); + correctedWorldPos = mix(correctedWorldPos, vec2( playerpos.z,playerpos.y) + vec2( cameraPosition.z,cameraPosition.y), clamp( worldSpaceNormal.x,0,1)); + correctedWorldPos = mix(correctedWorldPos, vec2(-playerpos.z,playerpos.y) + vec2(-cameraPosition.z,cameraPosition.y), clamp(-worldSpaceNormal.x,0,1)); + correctedWorldPos = mix(correctedWorldPos, vec2( playerpos.x,playerpos.y) + vec2( cameraPosition.x,cameraPosition.y), clamp(-worldSpaceNormal.z,0,1)); + correctedWorldPos = mix(correctedWorldPos, vec2(-playerpos.x,playerpos.y) + vec2(-cameraPosition.x,cameraPosition.y), clamp( worldSpaceNormal.z,0,1)); - absorbance *= volumeCoeff; - endPortalEmission += verticalGradient*verticalGradient ; - uv += rayDir; - } - Albedo.rgb = clamp(color,0,1); - endPortalEmission = clamp(endPortalEmission/steps * 1.0,0.0,254.0/255.0); + vec2 rayDir = ((correctedViewVec.xy) / -correctedViewVec.z) / steps * 5.0 ; + vec2 uv = correctedWorldPos + rayDir * BN; + uv += rayDir * 10.0; + + vec2 animation = vec2(frameTimeCounter, -frameTimeCounter)*0.01; + + for (int i = 0; i < int(steps); i++) { + + float verticalGradient = (i + BN)/steps ; + float verticalGradient2 = exp(-7*(1-verticalGradient*verticalGradient)); + + float density = max(max(verticalGradient - texture(noisetex, uv/256.0 + animation.xy).b*0.5,0.0) - (1.0-texture(noisetex, uv/32.0 + animation.xx).r) * (0.4 + 0.1 * (texture(noisetex, uv/10.0 - animation.yy).b)),0.0); + + float volumeCoeff = exp(-density*(i+1)); + + vec3 lighting = vec3(0.5,0.75,1.0) * 0.1 * exp(-10*density) + vec3(0.8,0.3,1.0) * verticalGradient2 * 1.7; + color += (lighting - lighting * volumeCoeff) * absorbance;; + + absorbance *= volumeCoeff; + endPortalEmission += verticalGradient*verticalGradient ; + uv += rayDir; + } + + Albedo.rgb = clamp(color,0,1); + endPortalEmission = clamp(endPortalEmission/steps * 1.0,0.0,254.0/255.0); + + #else + int PORTAL_STEPS = 16; + if(data_in.blockID == BLOCK_END_PORTAL) PORTAL_STEPS = 15; + + Albedo.rgb = textureProj(gtexture, data_in.lmtexcoord).rgb * COLORS[0]; + for (int i = 0; i < PORTAL_STEPS; i++) { + Albedo.rgb += textureProj(gtexture, data_in.lmtexcoord * end_portal_layer(float(i + 1))).rgb * COLORS[i]; + } + Albedo.rgb *= 0.3; + torchlightmap = 0.0; + lmcoord.y = 0.0; + endPortalEmission = 0.9; + #endif } #endif diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index 2009652..0a9e1bd 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -232,6 +232,15 @@ vec3 viewToWorld(vec3 viewPos) { uniform float caveDetection; #endif +#if defined BLOCKENTITIES && !defined COLORWHEEL && (MC_VERSION >= 260100 || !defined SHADER_END_PORTAL) + vec4 projection_from_position(vec4 position) { + vec4 projection = position * 0.5; + projection.xy = vec2(projection.x + projection.w, projection.y + projection.w); + projection.zw = position.zw; + return projection; + } +#endif + //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// @@ -295,7 +304,7 @@ void main() { #if defined WORLD && !defined HAND #ifdef BLOCKENTITIES - if(blockEntityId == BLOCK_END_PORTAL || blockEntityId == 187) { + if(blockEntityId == BLOCK_END_PORTAL || blockEntityId == BLOCK_END_GATEWAY) { data_out.lmtexcoord.w = 0.0; } #endif @@ -500,4 +509,8 @@ void main() { if(blockBelow == 85) gl_Position.z -= 10000.0; } #endif + + #if defined BLOCKENTITIES && !defined COLORWHEEL && (MC_VERSION >= 260100 || !defined SHADER_END_PORTAL) + if(data_out.blockID == BLOCK_END_PORTAL || data_out.blockID == BLOCK_END_GATEWAY)data_out.lmtexcoord = projection_from_position(gl_Position); + #endif } diff --git a/shaders/dimensions/setup.csh b/shaders/dimensions/setup.csh index e2ca655..f4a0a46 100644 --- a/shaders/dimensions/setup.csh +++ b/shaders/dimensions/setup.csh @@ -496,10 +496,10 @@ void main() { lightRange = 10.0; } - if (blockId == BLOCK_END_GATEWAY) { - lightColor = vec3(1.0); - lightRange = 15.0; - } + // if (blockId == BLOCK_END_GATEWAY) { + // lightColor = vec3(1.0); + // lightRange = 15.0; + // } if (blockId == BLOCK_END_ROD || blockId == ITEM_END_ROD) { lightColor = vec3(0.957, 0.929, 0.875); diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index e4547dd..0b19905 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -1,6 +1,6 @@ option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - A Bliss Edit prefix.SHADER_VERSION_LABEL = V - value.SHADER_VERSION_LABEL.482 = 8.1.1 + value.SHADER_VERSION_LABEL.482 = 8.2.0 iris_extension.keybind.key0.name=Flashlight @@ -964,6 +964,8 @@ option.EMISSIVE_TRIMS_STRENGTH = Emissive Trims Brightness option.PLANET_CURVATURE = Planet Curvature §c(VOXY NOT SUPPORTED!) option.CURVATURE_AMOUNT = Curvature Amount +option.SHADER_END_PORTAL = Shader End Portal Effect §c(1.21.11 and below!) + option.VANILLA_CHUNK_FADING = Chunks Fade In §c(Iris 1.10.3+) value.VANILLA_CHUNK_FADING.0 = Off value.VANILLA_CHUNK_FADING.1 = Fade In diff --git a/shaders/lang/zh_cn.lang b/shaders/lang/zh_cn.lang index c50fa94..bdf16f9 100644 --- a/shaders/lang/zh_cn.lang +++ b/shaders/lang/zh_cn.lang @@ -1,6 +1,6 @@ option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - Bliss 编辑版 prefix.SHADER_VERSION_LABEL = 版本 - value.SHADER_VERSION_LABEL.482 = 8.1.1 + value.SHADER_VERSION_LABEL.482 = 8.2.0 # 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名 profile.POTATO=§4土豆 (极低配置) diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index f7bb602..3572a29 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -1072,6 +1072,11 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #ifdef WAVING_MULTIPART_GRASS #endif +#define SHADER_END_PORTAL + +#ifdef SHADER_END_PORTAL +#endif + /////////////////////////////////////////// // ----- DISTANT HORIZONS SETTINGS ----- // /////////////////////////////////////////// diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 2989ccf..6d09557 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -375,7 +375,7 @@ SHADER_VERSION_LABEL \ ######## WORLD screen.World.columns=1 - screen.World = [Water] [Foliage] [Weather_Effects] [AURORA_SETTINGS] PLANET_CURVATURE CURVATURE_AMOUNT VANILLA_CHUNK_FADING [Sky_coefficients] SKY_GROUND STARS_AMOUNT STARS_BRIGHTNESS EMISSIVE_ORES EMISSIVE_ORES_STRENGTH + screen.World = [Water] [Foliage] [Weather_Effects] [AURORA_SETTINGS] PLANET_CURVATURE CURVATURE_AMOUNT VANILLA_CHUNK_FADING SHADER_END_PORTAL [Sky_coefficients] SKY_GROUND STARS_AMOUNT STARS_BRIGHTNESS EMISSIVE_ORES EMISSIVE_ORES_STRENGTH ### WAVING STUFF screen.Foliage.columns=2