SHARE
TWEET

vertexShader

a guest May 1st, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top