Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. // - - - - - - - - - - - - - - - - - - - -
  2. float4x4 gMworld;
  3. float4x4 gMview;
  4. float4x4 gMproj;
  5. // - - - - - - - - - - - - - - - - - - - -
  6. struct VertIn {
  7.  
  8.     float4  P       : POSITION0;
  9.     float3  N       : NORMAL0;
  10.     float2  T       : TEXCOORD0;
  11.  
  12.     int2    Index   : TEXCOORD9;
  13.  
  14. };//struct
  15. // - - - - - - - - - - - - - - - - - - - -
  16. struct VertOut {
  17.     float4 Poutput  : POSITION0;
  18. };//struct
  19. // - - - - - - - - - - - - - - - - - - - -
  20. VertOut VertFn(VertIn Input) {
  21.    
  22.     VertOut Output;
  23.  
  24.     float4 Pobject  = Input.P;
  25.     float4 Pworld   = mul(Pobject   , gMworld);
  26.     float4 Pview    = mul(Pworld    , gMview);
  27.     float4 Poutput  = mul(Pview     , gMproj);
  28.  
  29.     Output.Poutput  = Poutput;
  30.  
  31.     return Output;
  32.  
  33. }//function
  34. // - - - - - - - - - - - - - - - - - - - -
  35. float4 PixFn(VertOut Input) : COLOR0 {
  36.     return float4(1, 0, 0, 1);
  37. }//function
  38. // - - - - - - - - - - - - - - - - - - - -
  39. technique TechMain {
  40.     // - - - - - - - - - - - - - - - - - - - -
  41.     pass PassMain {
  42.         VertexShader    = compile vs_3_0 VertFn();
  43.         PixelShader     = compile ps_3_0 PixFn();
  44.     }//pass
  45.     // - - - - - - - - - - - - - - - - - - - -
  46. }//technique
  47. // - - - - - - - - - - - - - - - - - - - -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement