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 >
Wrap
Text File
|
2004-07-09
|
720b
|
17 lines
; Inputs: v0 = Position
; v3 = Normal
; c0 = (0,0.5,xxx,xxx) Constant
; c1-4 = WorldView matrix
; c5-9 = WorldViewProjection matrix
; c9 = Light/material color
; c10 = Light direction (in view space)
vs.1.0 ; Shader version 1.0
m4x4 oPos , v0 , c5 ; Compute projected position
m3x3 r1 , v3 , c1 ; r1 = View space normal
dp3 r2 ,-r1 , c10 ; r2 = Diffuse lighting calc
max r2 , r2 , c0.x ; Clamp r2 to 0
mov oT0.x, r2 ; Tex coord 0 is (r2,0.5)
mov oT0.y, c0.y
mov oD0 , c9 ; Diffuse color = c9