Example_Projection.cg
资源名称:3dwind2.0.rar [点击查看]
上传用户:xhbjoy
上传日期:2014-10-07
资源大小:38068k
文件大小:1k
源码类别:
游戏引擎
开发平台:
Visual C++
- void generalPurposeProjection_vp(
- float4 pos : POSITION,
- out float4 oPos : POSITION,
- out float4 texCoord : TEXCOORD0,
- uniform float4x4 worldViewProjMatrix,
- uniform float4x4 worldMatrix,
- uniform float4x4 texViewProjMatrix)
- {
- oPos = mul(worldViewProjMatrix, pos);
- // multiply position by world matrix, then by projective view/proj
- float4 newpos = mul(worldMatrix, pos);
- texCoord = mul(texViewProjMatrix, newpos);
- }
- void generalPurposeProjection_fp(
- float4 texCoord : TEXCOORD0,
- out float4 col : COLOR,
- uniform sampler2D texMap)
- {
- col = tex2Dproj(texMap, texCoord);
- }