aboutsummaryrefslogtreecommitdiff
path: root/demo/d3d/shaders/pointThicknessVS.hlsl
diff options
context:
space:
mode:
authorMiles Macklin <[email protected]>2018-03-19 15:10:24 +1300
committerMiles Macklin <[email protected]>2018-03-19 15:10:24 +1300
commit8ee05c79ae1748ef132a12e4fb0af284899faec6 (patch)
tree82bd5aa1892e28ce7886b6cfeafe66a47ff38e67 /demo/d3d/shaders/pointThicknessVS.hlsl
parentFlex 1.2 (beta 2) (diff)
downloadflex-8ee05c79ae1748ef132a12e4fb0af284899faec6.tar.xz
flex-8ee05c79ae1748ef132a12e4fb0af284899faec6.zip
Flex 1.2.0 release
Diffstat (limited to 'demo/d3d/shaders/pointThicknessVS.hlsl')
-rw-r--r--demo/d3d/shaders/pointThicknessVS.hlsl23
1 files changed, 23 insertions, 0 deletions
diff --git a/demo/d3d/shaders/pointThicknessVS.hlsl b/demo/d3d/shaders/pointThicknessVS.hlsl
new file mode 100644
index 0000000..5c8eab1
--- /dev/null
+++ b/demo/d3d/shaders/pointThicknessVS.hlsl
@@ -0,0 +1,23 @@
+#include "shaderCommon.h"
+
+#pragma warning (disable : 3578)
+
+cbuffer constBuf : register(b0)
+{
+ FluidShaderConst gParams;
+};
+
+FluidVertexOut pointThicknessVS(FluidVertexIn input, uint instance : SV_VertexID)
+{
+ const float4 gl_Vertex = input.position;
+ const float4x4 gl_ModelViewMatrix = gParams.modelView;
+
+ // calculate window-space point size
+ float4 viewPos = mul(gl_ModelViewMatrix, float4(gl_Vertex.xyz, 1.0));
+
+ FluidVertexOut output;
+ output.position = viewPos;
+ output.bounds = gl_Vertex; // store gl_Vertex in bounds
+
+ return output;
+}