Merge remote-tracking branch 'origin/PlayerControllerWIthNewPhysics' into PlayerControllerWIthNewPhysics

This commit is contained in:
Glence 2023-03-04 17:30:14 +08:00
commit ab4a874bb1
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;