diff options
| author | Miles Macklin <[email protected]> | 2017-03-10 14:51:31 +1300 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2017-03-10 14:51:31 +1300 |
| commit | ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f (patch) | |
| tree | 4cc6f3288363889d7342f7f8407c0251e6904819 /demo/d3d11/shaders/diffuseVS.hlsl | |
| download | flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.tar.xz flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.zip | |
Initial 1.1.0 binary release
Diffstat (limited to 'demo/d3d11/shaders/diffuseVS.hlsl')
| -rw-r--r-- | demo/d3d11/shaders/diffuseVS.hlsl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/demo/d3d11/shaders/diffuseVS.hlsl b/demo/d3d11/shaders/diffuseVS.hlsl new file mode 100644 index 0000000..afca738 --- /dev/null +++ b/demo/d3d11/shaders/diffuseVS.hlsl @@ -0,0 +1,26 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + DiffuseShaderConst gParams; +}; + +DiffuseVertexOut diffuseVS(DiffuseVertexIn input) +{ + float3 worldPos = input.position.xyz; + float4 eyePos = mul(gParams.modelView, float4(worldPos, 1.0)); + + DiffuseVertexOut output; + + output.worldPos = input.position; // lifetime in w + output.viewPos = eyePos; + output.viewVel = mul(gParams.modelView, float4(input.velocity.xyz, 0.0)); + output.color = gParams.color; + + // compute ndc pos for frustrum culling in GS + float4 ndcPos = mul(gParams.modelViewProjection, float4(worldPos.xyz, 1.0)); + output.ndcPos = ndcPos / ndcPos.w; + + return output; + +} |