Updated shiny effect shader

This commit is contained in:
Brandon Mak 2023-03-04 15:49:41 +08:00
parent c6f49e45e4
commit c7c8e0046d
2 changed files with 8 additions and 2 deletions

View File

@ -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;