Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/Example_ProjectionFp.glsles @ 12091

Last change on this file since 12091 was 12091, checked in by wiesep, 5 years ago

Updated programs and adjusted Material to work with GLSL>150

File size: 1.2 KB
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
29
30void generalPurposeProjection_vp(
31                float4 pos                      : POSITION,
32               
33                out float4 oPos         : POSITION,
34                out float4 texCoord : TEXCOORD0,
35
36                uniform float4x4 worldViewProjMatrix,
37                uniform float4x4 worldMatrix,
38                uniform float4x4 texViewProjMatrix)
39{
40        oPos = mul(worldViewProjMatrix, pos);
41        // multiply position by world matrix, then by projective view/proj
42        float4 newpos = mul(worldMatrix, pos);
43        texCoord = mul(texViewProjMatrix, newpos);
44       
45}
46
47void generalPurposeProjection_fp(
48                float4 texCoord         : TEXCOORD0,
49                out float4 col          : COLOR,
50                uniform sampler2D texMap)
51{
52        col = tex2Dproj(texMap, texCoord);
53
54}
55               
56
Note: See TracBrowser for help on using the repository browser.