diff options
Diffstat (limited to 'demo/d3d11/shaders/pointVS.hlsl')
| -rw-r--r-- | demo/d3d11/shaders/pointVS.hlsl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/demo/d3d11/shaders/pointVS.hlsl b/demo/d3d11/shaders/pointVS.hlsl new file mode 100644 index 0000000..6ab4b6c --- /dev/null +++ b/demo/d3d11/shaders/pointVS.hlsl @@ -0,0 +1,26 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + PointShaderConst gParams; +}; + +PointVertexOut pointVS(PointVertexIn input, uint instance : SV_VertexID) +{ + const float4 gl_Vertex = input.position; + const float4x4 gl_ModelViewMatrix = gParams.modelview; + + float density = input.density; + int phase = input.phase; + + // calculate window-space point size + float4 viewPos = mul(gl_ModelViewMatrix, float4(gl_Vertex.xyz, 1.0)); + + PointVertexOut output; + output.position = viewPos; + output.density = density; + output.phase = phase; + output.vertex = gl_Vertex; + + return output; +} |