Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/skybox/Media/materials/programs/Example_Projection.cg @ 883

Last change on this file since 883 was 390, checked in by landauf, 17 years ago

added materials

File size: 606 bytes
Line 
1
2void generalPurposeProjection_vp(
3                float4 pos                      : POSITION,
4               
5                out float4 oPos         : POSITION,
6                out float4 texCoord : TEXCOORD0,
7
8                uniform float4x4 worldViewProjMatrix,
9                uniform float4x4 worldMatrix,
10                uniform float4x4 texViewProjMatrix)
11{
12        oPos = mul(worldViewProjMatrix, pos);
13        // multiply position by world matrix, then by projective view/proj
14        float4 newpos = mul(worldMatrix, pos);
15        texCoord = mul(texViewProjMatrix, newpos);
16       
17}
18
19void generalPurposeProjection_fp(
20                float4 texCoord         : TEXCOORD0,
21                out float4 col          : COLOR,
22                uniform sampler2D texMap)
23{
24        col = tex2Dproj(texMap, texCoord);
25
26}
27               
28
Note: See TracBrowser for help on using the repository browser.