Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7883


Ignore:
Timestamp:
Feb 14, 2011, 12:15:39 PM (13 years ago)
Author:
landauf
Message:

no fucking clue what I'm doing here, but it looks like I just fixed the Bloom shader in combination with a GUI

(the old implementation used a material with alpha_blend for the compositor's output, hence Ogre rendered the GUI first and the shader afterward. the new implementation uses a cg program to create the bloom effect which seems to work)

Location:
data/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • data/trunk/materials/Bloom.material

    r7708 r7883  
    6969                        texture_unit RT
    7070                        {
    71                 tex_coord_set 0
     71                                tex_coord_set 0
    7272                                tex_address_mode clamp
    7373                                filtering linear linear linear
     
    9292                        texture_unit RT
    9393                        {
    94                 tex_coord_set 0
     94                                tex_coord_set 0
    9595                                tex_address_mode clamp
    9696                                filtering linear linear linear
     
    120120                        texture_unit
    121121                        {
    122                 tex_coord_set 0
     122                                tex_coord_set 0
    123123                                tex_address_mode clamp
    124124                                filtering linear linear linear
     
    144144                        texture_unit
    145145                        {
    146                 tex_coord_set 0
     146                                tex_coord_set 0
    147147                                tex_address_mode clamp
    148148                                filtering linear linear linear
     
    152152}
    153153
    154 /// Overlay quad
     154fragment_program Ogre/Compositor/BloomFP cg
     155{
     156        source BloomFP.cg
     157        entry_point Bloom_ps
     158        profiles ps_2_0 arbfp1
     159}
     160
    155161material Ogre/Compositor/BloomBlend
    156162{
    157     technique
    158     {
    159         pass
    160         {
    161             lighting on
    162             diffuse 0.0 0.0 0.0 0.5
    163             specular 0.0 0.0 0.0 0.0
    164             ambient 0.0 0.0 0.0
    165             emissive 1.0 1.0 1.0
    166             cull_hardware none
    167             depth_check off
    168             scene_blend alpha_blend
     163        technique
     164        {
    169165
    170             texture_unit
    171             {
    172                 tex_coord_set 0
     166                pass
     167                {
     168                        cull_hardware none
     169                        cull_software none
     170                        depth_func always_pass
     171
     172                        vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
     173                        {
     174                        }
     175
     176                        fragment_program_ref Ogre/Compositor/BloomFP
     177                        {
     178                        }
     179
     180                        texture_unit
     181                        {
     182                                tex_coord_set 0
    173183                                tex_address_mode clamp
    174                                 filtering linear linear linear
    175             }
    176         }
    177     }
     184                                filtering trilinear
     185                        }
     186
     187                        texture_unit
     188                        {
     189                                tex_coord_set 0
     190                                tex_address_mode clamp
     191                                filtering trilinear
     192                        }
     193                }
     194        }
    178195}
  • data/trunk/materials/Shaders.compositor

    r7708 r7883  
    66    {
    77        // Temporary textures
    8         texture rt0 128 128 PF_A8R8G8B8
    9         texture rt1 128 128 PF_A8R8G8B8
     8        texture rt_output target_width target_height PF_R8G8B8
     9        texture rt0 128 128 PF_R8G8B8
     10        texture rt1 128 128 PF_R8G8B8
     11
     12        target rt_output
     13        {
     14            // Render output from previous compositor (or original scene)
     15            input previous
     16        }
     17
     18        target rt0
     19        {
     20            // Start with clear texture
     21            input none
     22            // Vertical blur pass
     23            pass render_quad
     24            {
     25                // Renders a fullscreen quad with a material
     26                material Ogre/Compositor/Blur0
     27                input 0 rt_output
     28            }
     29        }
    1030
    1131        target rt1
    1232        {
    13             // Render output from previous compositor (or original scene)
    14             input previous
    15         }
    16 
    17         target rt0
    18         {
    1933            // Start with clear texture
    2034            input none
    21             // Vertical blur pass
    22             pass render_quad
    23             {
    24                 // Renders a fullscreen quad with a material
    25                 material Ogre/Compositor/Blur0
    26                 input 0 rt1
    27             }
    28         }
    29 
    30         target rt1
    31         {
    32             // Start with clear texture
    33             input none
    3435            // Horizontal blur pass
    3536            pass render_quad
     
    4445        {
    4546            // Start with clear output
    46             input previous
     47            input none
    4748            // Draw a fullscreen quad
    4849            pass render_quad
     
    5051                // Renders a fullscreen quad with a material
    5152                material Ogre/Compositor/BloomBlend
    52                 input 0 rt1
     53                input 0 rt_output
     54                input 1 rt1
    5355            }
    5456        }
Note: See TracChangeset for help on using the changeset viewer.