home *** CD-ROM | disk | FTP | other *** search
- // vecMul(matrix, float3) multiplies like a vector instead of point
- // (no translate)
- float3 vecMul(const float4x4 matrix, const float3 vec){
- return(float3(dot(vec, matrix._11_12_13),
- dot(vec, matrix._21_22_23),
- dot(vec, matrix._31_32_33)));
- }
-
- struct a2vConnector : application2vertex {
- float4 coord;
- float3 texture;
- };
-
- struct v2fConnector : vertex2fragment {
- float4 HPOS:HPOS;
- float3 texture:TEX0;
- };
-
- v2fConnector main(a2vConnector a2v,
- uniform float4x4 view,
- uniform float4x4 proj){
- v2fConnector v2f;
-
- float4 eyeCoord;
- eyeCoord.xyz = vecMul(view, a2v.coord.xyz);
- eyeCoord.w = 1.0;
-
- v2f.HPOS = mul(proj, eyeCoord);
- v2f.texture = a2v.texture;
-
- return v2f;
- }
-