Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2011, 5:41:04 PM (14 years ago)
Author:
marwegma
Message:

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

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

Legend:

Unmodified
Added
Removed
  • data/branches/environment/materials/Godrays.material

    r8346 r8357  
    11/**
    2 *
     2* 
    33* \author Markus Wegmann
    44*
     
    3131
    3232
    33 fragment_program GodrayBlurFragmentProgram cg
     33fragment_program GodraysBlurFragmentProgram cg
    3434{
    3535    source Godrays_blur.cg
    36     entry_point godray_blur
    37     profiles ps_3_0 fp40
     36    entry_point godrays_blur
     37    profiles fp40 ps_3_0
    3838}
    3939
    4040
    41 material Godrays/Blur/RadialBlur
     41
     42material Godrays/Blur
    4243{
    4344    technique
     
    4647        pass
    4748        {
    48             fragment_program_ref GodrayBlurFragmentProgram
     49            fragment_program_ref GodraysBlurFragmentProgram
    4950            {
    5051                param_indexed 0 float2 0.0 0.0
     
    5253                param_indexed 2 float 0.1
    5354                param_indexed 3 float 0.7
    54                 // The raw decal has to be loaded manually by api.
    5555            }
    5656        }
    5757    }
    5858}
     59
     60fragment_program GodraysCombineFragmentProgram cg
     61{
     62    source Godrays_blur.cg
     63    entry_point godrays_combine
     64    profiles fp40 ps_3_0
     65}
     66
     67material Godrays/Combine
     68{
     69    technique
     70    {
     71        pass
     72        { 
     73            fragment_program_ref GodraysCombineFragmentProgram { }
     74        }
     75    }
     76}
  • data/branches/environment/programs/Godrays_blur.cg

    r8346 r8357  
    11/**
    22*
    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.
     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, what is irrelevant in Ogre when doing a "render_quad"-pass... just to say!
    44*
    55* \author Markus Wegmann
     
    2727//// Fragment Shader ////
    2828
    29 void godray_blur(
     29void godrays_blur(
    3030        OneTexelVertex IN,
    3131               
     
    6666
    6767
    68 void combineRenderAndGodrays(
     68void godrays_combine(
    6969        OneTexelVertex IN,
    7070
     
    103103> = {0f,0f,0f,1.0f};
    104104
    105 float GodrayExposure = 1f;
    106 float GodrayDecay = 0.1f;
    107 float GodrayDensity = 0.7f;
     105float GodraysExposure = 1f;
     106float GodraysDecay = 0.1f;
     107float GodraysDensity = 0.7f;
    108108
    109109texture ScnTarget : RenderColorTarget <
     
    122122};
    123123
    124 texture GodrayTarget : RenderColorTarget <
     124texture GodraysTarget : RenderColorTarget <
    125125        float2 ViewPortRatio = {1,1};
    126126    int MipLevels = 1;
     
    129129>;
    130130
    131 sampler2D GodrayDecal = sampler_state {
    132     Texture = <GodrayTarget>;
     131sampler2D GodraysDecal = sampler_state {
     132    Texture = <GodraysTarget>;
    133133        WrapS = ClampToEdge;
    134134    WrapT = ClampToEdge;
     
    188188               
    189189                VertexShader = compile vp40 ScreenQuadVS();
    190         FragmentProgram = compile fp40 godray_blur(
     190        FragmentProgram = compile fp40 godrays_blur(
    191191            ProjSunLightPosition,
    192                         GodrayExposure,
    193                         GodrayDecay,
    194                         GodrayDensity,
     192                        GodraysExposure,
     193                        GodraysDecay,
     194                        GodraysDensity,
    195195                        ScnDecal);
    196196        }
     
    208208               
    209209                VertexShader = compile vp40 ScreenQuadVS();
    210         FragmentProgram = compile fp40 combineRenderAndGodrays(
     210        FragmentProgram = compile fp40 godrays_combine(
    211211                        ScnDecal,
    212                         GodrayDecal);
     212                        GodraysDecal);
    213213        }
    214214}
  • data/branches/environment/programs/Godrays_raw.cg

    r8346 r8357  
    2525
    2626
    27 void black_shader(
     27void obstacle_shader(
    2828    float4 position : POSITION,
    2929
     
    8484                        CullFaceEnable = true;
    8585               
    86                         VertexProgram = compile vp40 black_shader(WvpXf);
     86                        VertexProgram = compile vp40 obstacle_shader(WvpXf);
    8787                }
    8888}
Note: See TracChangeset for help on using the changeset viewer.