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

  1. ; Inputs:   v0   = Position
  2. ;           v3   = Normal
  3. ;           c0   = (0,0.5,xxx,xxx) Constant
  4. ;           c1-4 = WorldView matrix
  5. ;           c5-9 = WorldViewProjection matrix
  6. ;           c9   = Light/material color
  7. ;           c10  = Light direction (in view space)
  8.  
  9. vs.1.0                             ; Shader version 1.0
  10. m4x4    oPos , v0   , c5           ; Compute projected position
  11. m3x3    r1   , v3   , c1           ; r1 = View space normal
  12. dp3     r2   ,-r1   , c10          ; r2 = Diffuse lighting calc
  13. max     r2   , r2   , c0.x         ; Clamp r2 to 0
  14. mov     oT0.x, r2                  ; Tex coord 0 is (r2,0.5)
  15. mov     oT0.y, c0.y
  16. mov     oD0  , c9                  ; Diffuse color = c9
  17.