From c7c8e0046d66580a610176faf17e060fc8196dfb Mon Sep 17 00:00:00 2001 From: Brandon Mak Date: Sat, 4 Mar 2023 15:49:41 +0800 Subject: [PATCH] Updated shiny effect shader --- Assets/Shaders/ShinyHighlight_FS.glsl | 10 ++++++++-- Assets/Shaders/ShinyHighlight_FS.shshaderb | Bin 5273 -> 5445 bytes 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Shaders/ShinyHighlight_FS.glsl b/Assets/Shaders/ShinyHighlight_FS.glsl index 8d7f4a90..bb41a0fb 100644 --- a/Assets/Shaders/ShinyHighlight_FS.glsl +++ b/Assets/Shaders/ShinyHighlight_FS.glsl @@ -78,8 +78,14 @@ void main() outEntityID = In2.eid; lightLayerIndices = In2.lightLayerIndex; - float vpHeight = float (In2.screenSpacePos.y) - MatProp.data[In2.materialIndex].highlightPosition; - vpHeight = float (int (vpHeight) % genericDataBuffer.data.viewportHeight); + // float vpHeight = float (In2.screenSpacePos.y) - MatProp.data[In2.materialIndex].highlightPosition; + // bring the frame of reference to the object's screen space pos + int scale = 470; + float vpHeight = float (In2.screenSpacePos.y); + float relativePos = float(int (-MatProp.data[In2.materialIndex].highlightPosition) % scale) - float (scale / 2); + vpHeight += relativePos; + + // vpHeight = float (int (vpHeight) % genericDataBuffer.data.viewportHeight); float scanlineScale = MatProp.data[In2.materialIndex].thickness * (1.0f - In2.screenSpacePos.z) * 100.0f; float lowerLimit = vpHeight - scanlineScale; diff --git a/Assets/Shaders/ShinyHighlight_FS.shshaderb b/Assets/Shaders/ShinyHighlight_FS.shshaderb index 408bba83d06bbbc37f21629ca6e54476d96e147a..dc59dbdee9e87c59e4108ace9d6b1613704880e9 100644 GIT binary patch literal 5445 zcmZ9O`F9*g5y!`oR4&%g*9Lp<#f<(^*CzxE2aFcN3i^D)T0*?p3@e}_LkK;Xfd_TQi(rDYRSM~i?b#--h_pG)(yd!X< z@21^@L9i|u3N{CCcd6j!;3hGF(|_FF)qnE(uhK)o`e1tMbU60psjwNh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