home *** CD-ROM | disk | FTP | other *** search
/ DarkBasic Professional / DarkBasicPro.iso / data1.cab / Lang_Files_(English) / Help / examples / basic3d / vshader.vsh < prev   
Encoding:
Text File  |  2004-09-22  |  602 b   |  17 lines

  1. // vertex shader version
  2. vs.1.0
  3.  
  4. // take the vertex position data ( v0 ) and multiply it by the matrix which we have put in 
  5. // register 0, the result is stored in oPos which is the position output register
  6. m4x4 oPos, v0, c0 
  7.  
  8. // calculate the amount of light falling on a vertex by taking the normal and dot it with the // light vector
  9. dp3 r0, v3, c4
  10.  
  11. // multiply the result of the dot product with the diffuse colour and place it in the oD0 
  12. // register
  13. mul oD0, r0.x, v5
  14.  
  15. // pass the texture coordinates from the input register ( v7 ) into the output register ( oT0 )
  16. mov oT0.xy, v7
  17.