Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/environment/programs/Godrays_raw.cg @ 12092

Last change on this file since 12092 was 8357, checked in by marwegma, 14 years ago

Godrays.compositor added, extended Godrays.material, unified the Godrays code a bit.

File size: 2.0 KB
Line 
1/**
2*
3* \brief
4* Godrays_*.cg is a radial blur based shader implementation of the natural effects of godrays (ray light scattering).
5* Godrays_raw.cg includes the shader programs for the preparating step. Is only of representative use.
6*
7* \author Markus Wegmann
8*
9**/
10
11
12void sun_shader(
13    float4 position : POSITION,
14        float4 normal: NORMAL,
15
16    out float4 oPosition : POSITION,
17    out float4 oColor : COLOR,
18
19    uniform float4x4 modelViewProj,
20    uniform float4 sunColor)
21{
22    oPosition = mul(modelViewProj, position);
23    oColor    = 2 * normalize(sunColor);
24}
25
26
27void obstacle_shader(
28    float4 position : POSITION,
29
30    out float4 oPosition : POSITION,
31        out float4 oColor: COLOR0,
32
33    uniform float4x4 modelViewProj)
34{
35    oPosition = mul(modelViewProj, position);
36    oColor    = float4 (0, 0, 0, 1);
37}
38
39
40/* CgFx based code
41
42
43//// Variables ////
44/////////////////////////////////////////////////////////////////////////////////////
45
46float4 SunLightColor : Specular <
47    string UIName =  "Lamp 0 Color";
48    string Object = "Pointlight0";
49    string UIWidget = "Color";
50> = {0.3, 0.42, 1, 1};
51
52//// UN-TWEAKABLES - AUTOMATICALLY-TRACKED TRANSFORMS ////
53
54float4x4 WorldITXf : WorldInverseTranspose < string UIWidget="None"; >;
55float4x4 WvpXf : WorldViewProjection < string UIWidget="None"; >;
56float4x4 VpXf : ViewProjection < string UIWidget="None"; >;
57float4x4 WorldXf : World < string UIWidget="None"; >;
58float4x4 ViewIXf : ViewInverse < string UIWidget="None"; >;
59
60
61//// Techniques ////
62technique SunShader
63{
64        pass p0 <
65        string Script = "Draw=geometry;";
66>       {
67                DepthTestEnable = true;
68                DepthMask = true;
69                BlendEnable = true;
70                CullFaceEnable = true;
71                       
72                VertexProgram = compile vp40 sun_shader(WvpXf, SunLightColor);         
73        }
74}
75
76technique BlackShader
77{
78                pass p0 <
79                string Script = "Draw=geometry;";
80>               {
81                        DepthTestEnable = true;
82                        DepthMask = true;
83                        BlendEnable = true;
84                        CullFaceEnable = true;
85               
86                        VertexProgram = compile vp40 obstacle_shader(WvpXf);
87                }
88}
89
90*/
91
Note: See TracBrowser for help on using the repository browser.