Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8346


Ignore:
Timestamp:
Apr 27, 2011, 9:30:08 PM (13 years ago)
Author:
marwegma
Message:

Godrays.material added. Compositor script will follow.

Location:
data/branches/environment
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • data/branches/environment/programs/Godrays_blur.cg

    r8258 r8346  
    11/**
    22*
    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.
    44*
    5 * @author Markus Wegmann
     5* \author Markus Wegmann
    66*
    77**/
     
    2525}
    2626
    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 : TEXCOORD1
    35 ) {
    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 
    4627//// Fragment Shader ////
    4728
    4829void godray_blur(
    4930        OneTexelVertex IN,
    50 
    51                 float2 projSunLightPosition : TEXCOORD1,
    5231               
    5332        out float4 oColor: COLOR,
    5433       
     34        uniform float2 projSunLightPosition,
    5535        uniform float exposure,
    5636        uniform float decay,
     
    5939
    6040{
    61         const int NUM_SAMPLES = 36;
     41        const int NUM_SAMPLES = 35;
    6242       
    6343        float2 texCoord = IN.UV;
     
    11393> = 0.8;
    11494
    115 float4 SunLightPosition : Position <
     95float2 ProjSunLightPosition : Position <
    11696    string UIName =  "Sun Light Position";
    11797    string Space = "World";
    118 > = {0, 0, 0, 1};
     98> = {0, 0};
    11999
    120100float4 SkyColor <
     
    181161    string UIWidget = "None";
    182162> = 1.0;
    183 
    184 float2 ViewportSize : VIEWPORTPIXELSIZE <
    185     string UIName="Screen Size";
    186     string UIWidget="None";
    187 >;
    188163
    189164technique Main <
     
    212187                BlendEnable = false;
    213188               
    214                 VertexShader = compile vp40 ScreenQuadVSWithLightPosition(VpXf, SunLightPosition);
     189                VertexShader = compile vp40 ScreenQuadVS();
    215190        FragmentProgram = compile fp40 godray_blur(
     191            ProjSunLightPosition,
    216192                        GodrayExposure,
    217193                        GodrayDecay,
  • data/branches/environment/programs/Godrays_raw.cg

    r8258 r8346  
    11/**
    22*
    3 * @brief
     3* \brief
    44* 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.
    66*
    7 * @author Markus Wegmann
     7* \author Markus Wegmann
    88*
    99**/
Note: See TracChangeset for help on using the changeset viewer.