vertex.vsd
资源名称:Direct3D.rar [点击查看]
上传用户:junlon
上传日期:2022-01-05
资源大小:39075k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual C++
- // vertex shader file: vertex.vsd
- vs_2_0
- // c0,c1,c2,c3 hold the worldviewproj matrix
- // c4 hold the frequency component
- // c5 hold the time phase component
- dcl_position v0 //input position
- dcl_color v1
- //dcl_texcoord v2 //input texcoordinate
- mov r1, v0
- sincos r2.xy, r1.x, c4, c5
- mov r2.z, r2.x
- mov r2.xyw, v0.xyw
- m4x4 r0, r2, c0 //transformation with the worldViewProj matrix
- // r0.x = v0.x*c0.x + v0.y*c0.y + v0.z*c0.z + v0.w*c0.w
- // r0.y = v0.x*c1.x + v0.y*c1.y + v0.z*c1.z + v0.w*c1.w
- // r0.z = v0.x*c2.x + v0.y*c2.y + v0.z*c2.z + v0.w*c2.w
- // r0.w = v0.x*c3.x + v0.y*c3.y + v0.z*c3.z + v0.w*c3.w
- mov oPos, r0 //output the position ,which is transformed by the WORLD_VIEW_PROJ matrix
- mov oD0, v1 //output the diffuse color
- //mov oT0, v2 //output the coodinate