Browse Source

Fixed sprite line rendering shader

BearishSun 8 years ago
parent
commit
cd0fb1257c
1 changed files with 11 additions and 14 deletions
  1. 11 14
      Data/Raw/Engine/Shaders/SpriteLine.bsl

+ 11 - 14
Data/Raw/Engine/Shaders/SpriteLine.bsl

@@ -29,12 +29,14 @@ technique SpriteLine
 			float4 position : SV_POSITION;
 			float4 position : SV_POSITION;
 		};
 		};
 
 
-		cbuffer VertParams
+		cbuffer GUIParams
 		{
 		{
-			float invViewportWidth;
-			float invViewportHeight;
-			float4x4 worldTransform;
-		};
+			float4x4 gWorldTransform;
+			float gInvViewportWidth;
+			float gInvViewportHeight;
+			float gViewportYFlip;
+			float4 gTint;
+		}	
 		
 		
 		struct VertexInput
 		struct VertexInput
 		{
 		{
@@ -43,10 +45,10 @@ technique SpriteLine
 		
 		
 		VStoFS vsmain(VertexInput input)
 		VStoFS vsmain(VertexInput input)
 		{
 		{
-			float4 tfrmdPos = mul(worldTransform, float4(input.position, 0, 1));
+			float4 tfrmdPos = mul(gWorldTransform, float4(input.position, 0, 1));
 			
 			
-			float tfrmdX = -1.0f + (tfrmdPos.x * invViewportWidth);
-			float tfrmdY = 1.0f - (tfrmdPos.y * invViewportHeight);
+			float tfrmdX = -1.0f + (tfrmdPos.x * gInvViewportWidth);
+			float tfrmdY = 1.0f - (tfrmdPos.y * gInvViewportHeight);
 
 
 			VStoFS output;
 			VStoFS output;
 			output.position = float4(tfrmdX, tfrmdY, 0, 1);
 			output.position = float4(tfrmdX, tfrmdY, 0, 1);
@@ -54,14 +56,9 @@ technique SpriteLine
 			return output;
 			return output;
 		}
 		}
 
 
-		cbuffer VertParams
-		{
-			float4 tint;
-		};
-		
 		float4 fsmain(VStoFS input) : SV_Target
 		float4 fsmain(VStoFS input) : SV_Target
 		{
 		{
-			return tint;
+			return gTint;
 		}
 		}
 	};
 	};
 };
 };