diff --git a/shaders/dimensions/all_solid.fsh b/shaders/dimensions/all_solid.fsh index 9bd806d..bed9190 100644 --- a/shaders/dimensions/all_solid.fsh +++ b/shaders/dimensions/all_solid.fsh @@ -526,7 +526,7 @@ void main() { #if REPLACE_SHORT_GRASS < 2 && !defined BLOCKENTITIES && !defined ENTITIES && !defined HAND && defined SHADER_GRASS && !defined COLORWHEEL && defined WORLD // darken the top of grass blocks a bit - if(data_in.blockID == 85 && flatNormals.y > abs(0.9) && !ShaderGrass) Albedo *= smoothstep(-30.0, 25.0, length(playerpos)); + if(data_in.blockID == 85 && flatNormals.y > abs(0.9) && !ShaderGrass) Albedo.rgb *= smoothstep(-30.0, 25.0, length(playerpos)); #endif #if defined DISTANT_HORIZONS && DH_CHUNK_FADING > 0 diff --git a/shaders/dimensions/composite.fsh b/shaders/dimensions/composite.fsh index decaa7a..d0310dd 100644 --- a/shaders/dimensions/composite.fsh +++ b/shaders/dimensions/composite.fsh @@ -262,6 +262,35 @@ float convertHandDepth_2(in float depth, bool hand) { ndcDepth /= MC_HAND_DEPTH; return ndcDepth * 0.5 + 0.5; } +#if defined DISTANT_HORIZONS || defined VOXY + + vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw); + + vec4 iProjDiag_DH = vec4(dhVoxyProjectionInverse[0].x, dhVoxyProjectionInverse[1].y, dhVoxyProjectionInverse[2].zw); + + vec3 toScreenSpace_DH_SSAO(vec2 texcoord, ivec2 samplecoord, bool hand) { + + vec4 viewPos = vec4(0.0); + vec3 feetPlayerPos = vec3(0.0); + + float depth = convertHandDepth_2(texelFetch2D(depthtex1, samplecoord, 0).x, hand); + + if (depth < 1.0) { + feetPlayerPos = vec3(texcoord, depth) * 2.0 - 1.0; + viewPos = iProjDiag * feetPlayerPos.xyzz + gbufferProjectionInverse[3]; + viewPos.xyz /= viewPos.w; + + } else { + depth = texelFetch2D(dhVoxyDepthTex1, samplecoord, 0).x; + + feetPlayerPos = vec3(texcoord, depth) * 2.0 - 1.0; + viewPos = iProjDiag_DH * feetPlayerPos.xyzz + dhVoxyProjectionInverse[3]; + viewPos.xyz /= viewPos.w; + } + + return viewPos.xyz; + } +#endif vec2 SSAO( vec3 viewPos, vec3 normal, vec3 flatnormal, bool hand, float noise @@ -292,13 +321,11 @@ vec2 SSAO( ivec2 offsetUV = ivec2(clamp((gl_FragCoord.xy + offsets*vec2(viewWidth, viewHeight*aspectRatio)*RENDER_SCALE)*texelSize,screenEdges,1.0-screenEdges)/texelSize); if (offsetUV.x >= 0 && offsetUV.y >= 0 && offsetUV.x < viewWidth*RENDER_SCALE.x && offsetUV.y < viewHeight*RENDER_SCALE.y ) { - - float sampleDepth = convertHandDepth_2(texelFetch2D(depthtex1, offsetUV, 0).x, hand); #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); + vec3 offsetViewPos = toScreenSpace_DH_SSAO((offsetUV*texelSize - jitterOffsets) * (1.0/RENDER_SCALE), offsetUV, hand); #else + float sampleDepth = convertHandDepth_2(texelFetch2D(depthtex1, offsetUV, 0).x, hand); vec3 offsetViewPos = toScreenSpace(vec3((offsetUV*texelSize - jitterOffsets) * (1.0/RENDER_SCALE), sampleDepth)); #endif diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index 8784143..62cd5b0 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 = 5.4.1 + value.SHADER_VERSION_LABEL.482 = 5.4.2 # if you're here to translate, this is not a joke, these do what they say profile.POTATO=§4Potato diff --git a/shaders/lang/zh_cn.lang b/shaders/lang/zh_cn.lang index cd2b6f6..245ea87 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 = 5.4.1 + value.SHADER_VERSION_LABEL.482 = 5.4.2 # 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名 profile.POTATO=§4土豆 (极低配置) diff --git a/shaders/lib/overworld_fog.glsl b/shaders/lib/overworld_fog.glsl index 81fea5c..10f1970 100644 --- a/shaders/lib/overworld_fog.glsl +++ b/shaders/lib/overworld_fog.glsl @@ -85,7 +85,7 @@ vec4 GetVolumetricFog( //project pixel position into projected shadowmap space vec3 playerPos = mat3(gbufferModelViewInverse) * viewPosition + gbufferModelViewInverse[3].xyz; - vec3 rayStartPos = playerPos - gbufferModelViewInverse[3].xyz; + // vec3 rayStartPos = playerPos - gbufferModelViewInverse[3].xyz; #ifdef CUSTOM_MOON_ROTATION vec3 fragposition = mat3(customShadowMatrixSSBO) * playerPos + customShadowMatrixSSBO[3].xyz; #else