Advertisement
Guest User

vertexShader

a guest
May 1st, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. cbuffer MatrixBuffer : register(b0) {
  2.     matrix worldMatrix;
  3.     matrix viewMatrix;
  4.     matrix projectionMatrix;
  5. };
  6.  
  7. struct VertexShaderInput {
  8.     float4 position: POSITION0;
  9.     float4 normal: NORMAL0;
  10.     float2 texCoord: TEXCOORD0;
  11. };
  12.  
  13. struct PixelShaderInput {
  14.     float4 position: SV_POSITION;
  15.     float4 normal: NORMAL;
  16.     float2 texCoord: TEXCOORD;
  17. };
  18.  
  19. PixelShaderInput vsEntryPoint(VertexShaderInput input) {
  20.     PixelShaderInput output;
  21.     output.position = mul(input.position, worldMatrix);
  22.     output.position = mul(output.position, viewMatrix);
  23.     output.position = mul(output.position, projectionMatrix);
  24.     output.normal = input.normal;
  25.     output.texCoord = input.texCoord;
  26.     return output;
  27. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement