home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / multimedia / 3dcanvas / 3DCanvas.msi / Instal01.cab / _CFD4BD7332B848AA8E16E6C06D0F6FD5 < prev    next >
Text File  |  2004-07-09  |  759b  |  21 lines

  1. ; Inputs:   v0   = Position
  2. ;           v3   = Normal
  3. ;           c0   = Constant (0,0.5,xxx,xxx)
  4. ;           c1-4 = WorldView matrix
  5. ;           c5-9 = WorldViewProjection matrix
  6.  
  7. vs.1.0                             ; Shader version 1.0
  8. m4x4    r0   , v0   , c1           ; r0 = View space position
  9. m3x3    r1   , v3   , c1           ; r1 = View space normal
  10. m4x4    oPos , v0   , c5           ; Spit out projected position
  11. dp3     r2.x , r0   , r0           ; Normalize r0 (position)
  12. rsq     r2.x , r2.x
  13. mul     r0   , r0   , r2.x
  14. dp3     r3.x , r0   , -r1          ; Compute dot product
  15. mad     oD0.w, r3.x , c0.y , c0.y  ; Scale to [0,1] and make alpha
  16. mov     oD0.xyz     , c0.x         ; Diffuse RGB is 0
  17.  
  18.  
  19.                 
  20.                   
  21.