diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index bf476ed..140c956 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -1706,7 +1706,7 @@ void main() { vec4 reflections = vec4(0.0,0.0,0.0,1.0); float SunReflectionAlpha = 0.0; - FINAL_COLOR = specularReflections(viewPos, feetPlayerPos, feetPlayerPos_normalized, WsunVec, specularNoises, FlatNormals, specularNormal, SpecularTex.r, SpecularTex.g, albedo, FINAL_COLOR, DirectLightColor*shadowColor*shadowColor, lightmap.y, hand, reflections, SunReflectionAlpha, flashLightSpecularData); + FINAL_COLOR = specularReflections(viewPos, feetPlayerPos, feetPlayerPos_normalized, WsunVec, specularNoises, FlatNormals, specularNormal, SpecularTex.r, SpecularTex.g, albedo, FINAL_COLOR, DirectLightColor*shadowColor*shadowColor, lightmap.y, hand, reflections, SunReflectionAlpha, isShaderGrass, flashLightSpecularData); #if defined DEFERRED_SPECULAR && defined DENOISED_REFLECTIONS gl_FragData[1] = reflections; diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index 9165235..65d6936 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -460,6 +460,11 @@ void main() { float opaqueMasks = dataUnpacked1.w; bool hand = abs(opaqueMasks-0.75) < 0.01; bool entities = abs(opaqueMasks-0.45) < 0.01; + #ifdef SHADER_GRASS + bool isShaderGrass = abs(opaqueMasks-0.80) < 0.01; + #else + const bool isShaderGrass = false; + #endif vec3 viewPos = toScreenSpace(vec3(texcoord/RENDER_SCALE, z)); @@ -543,7 +548,7 @@ void main() { #endif #if defined Hand_Held_lights && defined IS_LPV_ENABLED - if(!hand && firstPersonCamera) { + if(!hand && firstPersonCamera && !isShaderGrass) { if (heldItemId > 0){ vec3 shiftedViewPos = viewPos + vec3(-0.25, 0.2, 0.0); vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition); diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 4da843d..2ebef74 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -2306,6 +2306,7 @@ vec3 specularReflections( #ifdef DEFERRED_SPECULAR , inout vec4 specularOut , inout float SunReflectionAlpha + , in bool isShaderGrass #endif ,in vec4 flashLight_stuff @@ -2456,7 +2457,11 @@ vec3 specularReflections( #endif #if defined Hand_Held_lights && defined IS_LPV_ENABLED - if(!isHand && firstPersonCamera) { + if(!isHand && firstPersonCamera + #ifdef DEFERRED_SPECULAR + && !isShaderGrass + #endif + ) { if (heldItemId > 0){ vec3 shiftedViewPos = viewPos + vec3(-0.25, 0.2, 0.0); vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition);