mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-10 04:53:07 +08:00
remove handheld reflections on shader grass
This commit is contained in:
@@ -1706,7 +1706,7 @@ void main() {
|
|||||||
vec4 reflections = vec4(0.0,0.0,0.0,1.0);
|
vec4 reflections = vec4(0.0,0.0,0.0,1.0);
|
||||||
float SunReflectionAlpha = 0.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
|
#if defined DEFERRED_SPECULAR && defined DENOISED_REFLECTIONS
|
||||||
gl_FragData[1] = reflections;
|
gl_FragData[1] = reflections;
|
||||||
|
|||||||
@@ -460,6 +460,11 @@ void main() {
|
|||||||
float opaqueMasks = dataUnpacked1.w;
|
float opaqueMasks = dataUnpacked1.w;
|
||||||
bool hand = abs(opaqueMasks-0.75) < 0.01;
|
bool hand = abs(opaqueMasks-0.75) < 0.01;
|
||||||
bool entities = abs(opaqueMasks-0.45) < 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));
|
vec3 viewPos = toScreenSpace(vec3(texcoord/RENDER_SCALE, z));
|
||||||
|
|
||||||
@@ -543,7 +548,7 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined Hand_Held_lights && defined IS_LPV_ENABLED
|
#if defined Hand_Held_lights && defined IS_LPV_ENABLED
|
||||||
if(!hand && firstPersonCamera) {
|
if(!hand && firstPersonCamera && !isShaderGrass) {
|
||||||
if (heldItemId > 0){
|
if (heldItemId > 0){
|
||||||
vec3 shiftedViewPos = viewPos + vec3(-0.25, 0.2, 0.0);
|
vec3 shiftedViewPos = viewPos + vec3(-0.25, 0.2, 0.0);
|
||||||
vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition);
|
vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition);
|
||||||
|
|||||||
@@ -2306,6 +2306,7 @@ vec3 specularReflections(
|
|||||||
#ifdef DEFERRED_SPECULAR
|
#ifdef DEFERRED_SPECULAR
|
||||||
, inout vec4 specularOut
|
, inout vec4 specularOut
|
||||||
, inout float SunReflectionAlpha
|
, inout float SunReflectionAlpha
|
||||||
|
, in bool isShaderGrass
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
,in vec4 flashLight_stuff
|
,in vec4 flashLight_stuff
|
||||||
@@ -2456,7 +2457,11 @@ vec3 specularReflections(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined Hand_Held_lights && defined IS_LPV_ENABLED
|
#if defined Hand_Held_lights && defined IS_LPV_ENABLED
|
||||||
if(!isHand && firstPersonCamera) {
|
if(!isHand && firstPersonCamera
|
||||||
|
#ifdef DEFERRED_SPECULAR
|
||||||
|
&& !isShaderGrass
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
if (heldItemId > 0){
|
if (heldItemId > 0){
|
||||||
vec3 shiftedViewPos = viewPos + vec3(-0.25, 0.2, 0.0);
|
vec3 shiftedViewPos = viewPos + vec3(-0.25, 0.2, 0.0);
|
||||||
vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition);
|
vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos + gbufferModelViewInverse[3].xyz + (cameraPosition - previousCameraPosition);
|
||||||
|
|||||||
Reference in New Issue
Block a user