Changeset 8346 for data/branches/environment/programs
- Timestamp:
- Apr 27, 2011, 9:30:08 PM (14 years ago)
- Location:
- data/branches/environment/programs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/environment/programs/Godrays_blur.cg
r8258 r8346 1 1 /** 2 2 * 3 * @brief Godrays_*.cg is a radial blur based shader implementation of the natural effects of godrays (ray light scattering).3 * \brief Godrays_*.cg is a radial blur based shader implementation of the natural effects of godrays (ray light scattering). The vertex function ScreenQuadVS() skips the default wvp-transform, that is irrelevant for screenspace effects. 4 4 * 5 * @author Markus Wegmann5 * \author Markus Wegmann 6 6 * 7 7 **/ … … 25 25 } 26 26 27 OneTexelVertex ScreenQuadVSWithLightPosition(28 float3 Position : POSITION,29 float2 UV : TEXCOORD0,30 31 uniform float4x4 viewProj,32 uniform float4 sunLightPosition,33 34 out float2 projSunLightPosition : TEXCOORD135 ) {36 OneTexelVertex OUT = (OneTexelVertex)0;37 OUT.Position = float4(Position, 1);38 OUT.UV = float2(UV.xy);39 40 projSunLightPosition = (mul(viewProj, float4(0,0,0,1))).xy;41 projSunLightPosition = float2(0.5, 0.5) + projSunLightPosition / 35;42 43 return OUT;44 }45 46 27 //// Fragment Shader //// 47 28 48 29 void godray_blur( 49 30 OneTexelVertex IN, 50 51 float2 projSunLightPosition : TEXCOORD1,52 31 53 32 out float4 oColor: COLOR, 54 33 34 uniform float2 projSunLightPosition, 55 35 uniform float exposure, 56 36 uniform float decay, … … 59 39 60 40 { 61 const int NUM_SAMPLES = 3 6;41 const int NUM_SAMPLES = 35; 62 42 63 43 float2 texCoord = IN.UV; … … 113 93 > = 0.8; 114 94 115 float 4SunLightPosition : Position <95 float2 ProjSunLightPosition : Position < 116 96 string UIName = "Sun Light Position"; 117 97 string Space = "World"; 118 > = {0, 0 , 0, 1};98 > = {0, 0}; 119 99 120 100 float4 SkyColor < … … 181 161 string UIWidget = "None"; 182 162 > = 1.0; 183 184 float2 ViewportSize : VIEWPORTPIXELSIZE <185 string UIName="Screen Size";186 string UIWidget="None";187 >;188 163 189 164 technique Main < … … 212 187 BlendEnable = false; 213 188 214 VertexShader = compile vp40 ScreenQuadVS WithLightPosition(VpXf, SunLightPosition);189 VertexShader = compile vp40 ScreenQuadVS(); 215 190 FragmentProgram = compile fp40 godray_blur( 191 ProjSunLightPosition, 216 192 GodrayExposure, 217 193 GodrayDecay, -
data/branches/environment/programs/Godrays_raw.cg
r8258 r8346 1 1 /** 2 2 * 3 * @brief3 * \brief 4 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. 5 * Godrays_raw.cg includes the shader programs for the preparating step. Is only of representative use. 6 6 * 7 * @author Markus Wegmann7 * \author Markus Wegmann 8 8 * 9 9 **/
Note: See TracChangeset
for help on using the changeset viewer.