home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / bin / DXUtils / mview.exe / RCDATA / 1042 < prev   
Encoding:
Text File  |  2001-10-25  |  4.5 KB  |  201 lines

  1. //
  2. // Standard texture effect
  3. // Copyright (c) 2000 Microsoft Corporation. All rights reserved.
  4. //
  5.  
  6. vector vClr;   // color 
  7.  
  8. vector vScl;
  9.  
  10. matrix mWld;    // World
  11. matrix mTot;     // Total 
  12.  
  13. matrix mWd1;     
  14. matrix mWd2;     
  15. matrix mWd3;     
  16. matrix mWd4;     
  17. matrix mWd5;     
  18. matrix mWd6;     
  19. matrix mWd7;     
  20. matrix mWd8;     
  21. matrix mWd9;     
  22. matrix mWd10;     
  23. matrix mWd11;     
  24. matrix mWd12;     
  25. matrix mWd13;     
  26. matrix mWd14;     
  27. matrix mWd15;     
  28. matrix mWd16;     
  29. matrix mWd17;     
  30. matrix mWd18;     
  31. matrix mWd19;     
  32. matrix mWd20;     
  33. matrix mWd21;     
  34. matrix mWd22;     
  35. matrix mWd23;     
  36. matrix mWd24;     
  37. matrix mWd25;     
  38. matrix mWd26;     
  39. matrix mWd27;     
  40. matrix mWd28;     
  41.  
  42. Vertexshader vNonIndexed = 
  43.     decl
  44.     {
  45.                 stream 0;
  46.  
  47.                 float v0[3];
  48.                 float v1[4];
  49.                 float v3[3];
  50.     }
  51.     asm
  52.     {
  53.     vs.1.0
  54.  
  55.     m4x3 r0,v0,c0
  56.     m4x3 r1,v0,c4
  57.     m4x3 r2,v0,c8
  58.     m4x3 r3,v0,c12
  59.  
  60.     mul r0,r0,v1.xxxx
  61.     mad r0,r1,v1.yyyy,r0
  62.     mad r0,r2,v1.zzzz,r0
  63.     mad r0,r3,v1.wwww,r0
  64.  
  65.     m3x3 r4,v3,c0
  66.     m3x3 r5,v3,c4
  67.     m3x3 r6,v3,c8
  68.     m3x3 r7,v3,c12
  69.  
  70.     mul r4,r4,v1.xxxx
  71.     mad r4,r5,v1.yyyy,r4
  72.     mad r4,r6,v1.zzzz,r4
  73.     mad r4,r7,v1.wwww,r4
  74.  
  75.     mad r0,r4,c21.xxxx,r0
  76.  
  77.     mov r0.w,c20.x
  78.     m4x4 oPos,r0,c16
  79.  
  80.     mov oD0,c22
  81.     };
  82.  
  83.  
  84. Vertexshader vIndexed = 
  85.     decl
  86.     {
  87.                 stream 0;
  88.  
  89.                 float v0[3];
  90.                 float v1[4];
  91.                 d3dcolor v2[1];
  92.                 float v3[3];
  93.     }
  94.     asm
  95.     {
  96.     vs.1.1
  97.  
  98.     // Compensate for lack of UBYTE4 on Geforce3
  99.     mul r8,v2.zyxw,c4.wwww
  100.     
  101.     mov a0.x,r8.x
  102.     m4x3 r0,v0,c[a0.x + 9]
  103.     m3x3 r4,v3,c[a0.x + 9]
  104.     mov a0.x,r8.y
  105.     m4x3 r1,v0,c[a0.x + 9]
  106.     m3x3 r5,v3,c[a0.x + 9]
  107.     mov a0.x,r8.z
  108.     m4x3 r2,v0,c[a0.x + 9]
  109.     m3x3 r6,v3,c[a0.x + 9]
  110.     mov a0.x,r8.w
  111.     m4x3 r3,v0,c[a0.x + 9]
  112.     m3x3 r7,v3,c[a0.x + 9]
  113.  
  114.     mul r0,r0,v1.xxxx
  115.     mad r0,r1,v1.yyyy,r0
  116.     mad r0,r2,v1.zzzz,r0
  117.     mad r0,r3,v1.wwww,r0
  118.  
  119.     mul r4,r4,v1.xxxx
  120.     mad r4,r5,v1.yyyy,r4
  121.     mad r4,r6,v1.zzzz,r4
  122.     mad r4,r7,v1.wwww,r4
  123.  
  124.     mad r0,r4,c6.xxxx,r0
  125.  
  126.     mov r0.w,c4.x
  127.     m4x4 oPos,r0,c0
  128.  
  129.     mov oD0,c5
  130.     };
  131.  
  132. technique NonIndexed
  133. {
  134.     pass P0
  135.     {
  136.         ColorVertex = FALSE;
  137.  
  138.         ColorOp[0]   = Disable;
  139.         AlphaOp[0]   = Disable;
  140.  
  141.         VertexShader = <vNonIndexed>;
  142.  
  143.         VertexShaderConstant[0] = <mWd1>;
  144.         VertexShaderConstant[4] = <mWd2>;
  145.         VertexShaderConstant[8] = <mWd3>;
  146.         VertexShaderConstant[12] = <mWd4>;
  147.         VertexShaderConstant[16] = <mTot>;
  148.         VertexShaderConstant[20] = (1.0f, 0.0f, 0.0f, 0.0f);
  149.         VertexShaderConstant[21] = <vScl>;
  150.         VertexShaderConstant[22] = <vClr>;
  151.     }
  152. }
  153.  
  154. technique Indexed
  155. {
  156.     pass P0
  157.     {
  158.         ColorVertex = FALSE;
  159.  
  160.         ColorOp[0]   = Disable;
  161.         AlphaOp[0]   = Disable;
  162.  
  163.         VertexShader = <vIndexed>;
  164.  
  165.         VertexShaderConstant[0] = <mTot>;
  166.         VertexShaderConstant[4] = ( 1.0f, 0.0f, 0.0f, 765.01f );
  167.         VertexShaderConstant[5] = <vClr>;
  168.         VertexShaderConstant[6] = <vScl>;
  169.  
  170.         VertexShaderConstant3[9] = <mWd1>;
  171.         VertexShaderConstant3[12] = <mWd2>;
  172.         VertexShaderConstant3[15] = <mWd3>;
  173.         VertexShaderConstant3[18] = <mWd4>;
  174.         VertexShaderConstant3[21] = <mWd5>;
  175.         VertexShaderConstant3[24] = <mWd6>;
  176.         VertexShaderConstant3[27] = <mWd7>;
  177.         VertexShaderConstant3[30] = <mWd8>;
  178.         VertexShaderConstant3[33] = <mWd9>;
  179.         VertexShaderConstant3[36] = <mWd10>;
  180.         VertexShaderConstant3[39] = <mWd11>;
  181.         VertexShaderConstant3[42] = <mWd12>;
  182.         VertexShaderConstant3[45] = <mWd13>;
  183.         VertexShaderConstant3[48] = <mWd14>;
  184.         VertexShaderConstant3[51] = <mWd15>;
  185.         VertexShaderConstant3[54] = <mWd16>;
  186.         VertexShaderConstant3[57] = <mWd17>;
  187.         VertexShaderConstant3[60] = <mWd18>;
  188.         VertexShaderConstant3[63] = <mWd19>;
  189.         VertexShaderConstant3[66] = <mWd20>;
  190.         VertexShaderConstant3[69] = <mWd21>;
  191.         VertexShaderConstant3[72] = <mWd22>;
  192.         VertexShaderConstant3[75] = <mWd23>;
  193.         VertexShaderConstant3[78] = <mWd24>;
  194.         VertexShaderConstant3[81] = <mWd25>;
  195.         VertexShaderConstant3[84] = <mWd26>;
  196.         VertexShaderConstant3[87] = <mWd27>;
  197.         VertexShaderConstant3[90] = <mWd28>;
  198.     }
  199. }
  200.  
  201.