Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5312


Ignore:
Timestamp:
Dec 7, 2008, 4:22:37 AM (15 years ago)
Author:
landauf
Message:

added shaders (compositors, materials, cg programs and textures)

Location:
data/media
Files:
36 added
2 edited

Legend:

Unmodified
Added
Removed
  • data/media/levels/sample3.oxw

    r5286 r5312  
    1818    <SpawnPoint position="0,   0, -700" yaw  =180 spawnclass=SpaceShip pawndesign=spaceshipassff />
    1919    <SpawnPoint position="0, 300, -300" pitch=-90 spawnclass=SpaceShip pawndesign=spaceshipassff /-->
     20
     21    <GlobalShader compositor="Old TV" visible=false>
     22      <events>
     23        <visibility>
     24          <DistanceTrigger position="0,-200,0" distance=50 target="ControllableEntity" switch=true />
     25        </visibility>
     26      </events>
     27    </GlobalShader>
    2028
    2129    <MovableEntity scale=1.5 position="0,0,-300" velocity="0,0,0" rotationaxis="0,1,0" rotationrate=90>
  • data/media/materials/scripts/Examples.compositor

    r5023 r5312  
    1 // Manuel's bloom
    2 // Needs a scene-sized rtt, but does only one render of the scene
    3 compositor Bloom
    4 {
    5     technique
    6     {
    7         // Temporary textures
    8         texture rt0 128 128 PF_A8R8G8B8
    9         texture rt1 128 128 PF_A8R8G8B8
    10 
    11         target rt1
    12         {
    13             // Render output from previous compositor (or original scene)
    14             input previous
    15         }
    16 
    17         target rt0
    18         {
    19             // Start with clear texture
    20             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
    34             // Horizontal blur pass
    35             pass render_quad
    36             {
    37                 // Renders a fullscreen quad with a material
    38                 material Ogre/Compositor/Blur1
    39                 input 0 rt0
    40             }
    41         }
    42 
    43         target_output
    44         {
    45             // Start with clear output
    46             input previous
    47             // Draw a fullscreen quad
    48             pass render_quad
    49             {
    50                 // Renders a fullscreen quad with a material
    51                 material Ogre/Compositor/BloomBlend
    52                 input 0 rt1
    53             }
    54         }
    55     }
    56 }
    57 
    58 compositor Glass
    59 {
    60     technique
    61     {
    62         texture rt0 target_width target_height PF_R8G8B8
    63 
    64         target rt0 { input previous }
    65 
    66         target_output
    67         {
    68             // Start with clear output
    69             input none
    70 
    71             pass render_quad
    72             {
    73                 material Ogre/Compositor/GlassPass
    74                 input 0 rt0
    75             }
    76         }
    77     }
    78 }
    79 
    80 compositor "Old TV"
    81 {
    82     technique
    83     {
    84         texture rt0 target_width target_height PF_R8G8B8
    85 
    86         // render scene to a texture
    87         target rt0 { input previous }
    88 
    89         target_output
    90         {
    91             // Start with clear output
    92             input none
    93 
    94             pass render_quad
    95             {
    96                 // convert the previous render target to a black and white image, add some noise, distort it,
    97                 // then render to scene aligned quad
    98                 material Ogre/Compositor/OldTV
    99                 input 0 rt0
    100             }
    101         }
    102     }
    103 }
    104 
    105 
    106 // Black and white effect
    107 compositor B&W
    108 {
    109     technique
    110     {
    111         // Temporary textures
    112         texture rt0 target_width target_height PF_A8R8G8B8
    113 
    114         target rt0
    115         {
    116             // Render output from previous compositor (or original scene)
    117             input previous
    118         }
    119 
    120         target_output
    121         {
    122             // Start with clear output
    123             input none
    124             // Draw a fullscreen quad with the black and white image
    125             pass render_quad
    126             {
    127                 // Renders a fullscreen quad with a material
    128                 material Ogre/Compositor/BlackAndWhite
    129                 input 0 rt0
    130             }
    131         }
    132     }
    133 }
    134 
    1351//compositor DOF // based on Blur but final pass does depth of field
    1362//{
     
    18955//}
    19056
    191 // Embossed (fake bump) effect
    192 compositor Embossed
    193 {
    194     technique
    195     {
    196         // Temporary textures
    197         texture rt0 target_width target_height PF_A8R8G8B8
    198 
    199         target rt0
    200         {
    201             // Render output from previous compositor (or original scene)
    202             input previous
    203         }
    204 
    205         target_output
    206         {
    207             // Start with clear output
    208             input none
    209             // Draw a fullscreen quad with the black and white image
    210             pass render_quad
    211             {
    212                 // Renders a fullscreen quad with a material
    213                 material Ogre/Compositor/Embossed
    214                 input 0 rt0
    215             }
    216         }
    217     }
    218 }
    219 
    220 // SharpenEdges
    221 compositor Sharpen Edges
    222 {
    223     technique
    224     {
    225         // Temporary textures
    226         texture rt0 target_width target_height PF_A8R8G8B8
    227 
    228         target rt0
    229         {
    230             // Render output from previous compositor (or original scene)
    231             input previous
    232         }
    233 
    234         target_output
    235         {
    236             // Start with clear output
    237             input none
    238             // Draw a fullscreen quad with the black and white image
    239             pass render_quad
    240             {
    241                 // Renders a fullscreen quad with a material
    242                 material Ogre/Compositor/SharpenEdges
    243                 input 0 rt0
    244             }
    245         }
    246     }
    247 }
    248 
    249 // Invert
    250 compositor Invert
    251 {
    252     technique
    253     {
    254         // Temporary textures
    255         texture rt0 target_width target_height PF_A8R8G8B8
    256 
    257         target rt0
    258         {
    259             // Render output from previous compositor (or original scene)
    260             input previous
    261         }
    262 
    263         target_output
    264         {
    265             // Start with clear output
    266             input none
    267             // Draw a fullscreen quad with the black and white image
    268             pass render_quad
    269             {
    270                 // Renders a fullscreen quad with a material
    271                 material Ogre/Compositor/Invert
    272                 input 0 rt0
    273             }
    274         }
    275     }
    276 }
    277 
    278 // Posterize
    279 compositor Posterize
    280 {
    281     technique
    282     {
    283         // Temporary textures
    284         texture rt0 target_width target_height PF_A8R8G8B8
    285 
    286         target rt0
    287         {
    288             // Render output from previous compositor (or original scene)
    289             input previous
    290         }
    291 
    292         target_output
    293         {
    294             // Start with clear output
    295             input none
    296             // Draw a fullscreen quad with the black and white image
    297             pass render_quad
    298             {
    299                 // Renders a fullscreen quad with a material
    300                 material Ogre/Compositor/Posterize
    301                 input 0 rt0
    302             }
    303         }
    304     }
    305 }
    306 
    307 // Laplace
    308 compositor Laplace
    309 {
    310     technique
    311     {
    312         // Temporary textures
    313         texture rt0 target_width target_height PF_A8R8G8B8
    314 
    315         target rt0
    316         {
    317             // Render output from previous compositor (or original scene)
    318             input previous
    319         }
    320 
    321         target_output
    322         {
    323             // Start with clear output
    324             input none
    325             // Draw a fullscreen quad with the black and white image
    326             pass render_quad
    327             {
    328                 // Renders a fullscreen quad with a material
    329                 material Ogre/Compositor/Laplace
    330                 input 0 rt0
    331             }
    332         }
    333     }
    334 }
    335 
    336 // Tiling
    337 compositor Tiling
    338 {
    339     technique
    340     {
    341         // Temporary textures
    342         texture rt0 target_width target_height PF_A8R8G8B8
    343 
    344         target rt0
    345         {
    346             // Render output from previous compositor (or original scene)
    347             input previous
    348         }
    349 
    350         target_output
    351         {
    352             // Start with clear output
    353             input none
    354             // Draw a fullscreen quad with the black and white image
    355             pass render_quad
    356             {
    357                 // Renders a fullscreen quad with a material
    358                 material Ogre/Compositor/Tiling
    359                 input 0 rt0
    360             }
    361         }
    362     }
    363 }
    364 
    365 // Old Movie
    366 compositor Old Movie
    367 {
    368     technique
    369     {
    370         // Temporary textures
    371         texture rt0 target_width target_height PF_A8R8G8B8
    372 
    373         target rt0
    374         {
    375             // Render output from previous compositor (or original scene)
    376             input previous
    377         }
    378 
    379         target_output
    380         {
    381             // Start with clear output
    382             input none
    383             // Draw a fullscreen quad with the black and white image
    384             pass render_quad
    385             {
    386                 // Renders a fullscreen quad with a material
    387                 material Ogre/Compositor/OldMovie
    388                 input 0 rt0
    389             }
    390         }
    391     }
    392 }
    393 
    39457// HDR
    39558compositor HDR
     
    40063        // Temporary textures
    40164                // Fullsize HDR render target, used as tone mapping source
    402         texture rt_full target_width target_height PF_FLOAT16_RGB
     65                texture rt_full target_width target_height PF_FLOAT16_RGB
    40366                // Targets used for luminance evaluation (3x3 downsample, point filtering)
    40467                texture rt_lum0 1 1 PF_FLOAT16_RGB
     
    449112            pass render_quad
    450113            {
    451                                 // Downsample using a 3x3 filter
     114                // Downsample using a 3x3 filter
    452115                material Ogre/Compositor/HDR/Downsample3x3
    453116                input 0 rt_lum4
     
    492155                target rt_brightpass
    493156                {
    494             input none
    495             pass render_quad
    496             {
    497                 // Downsample using a 3x3 filter, hi-pass and tone map
    498                 material Ogre/Compositor/HDR/Downsample3x3Brightpass
    499                 input 0 rt_full
    500                         input 1 rt_lum0
     157                        input none
     158                        pass render_quad
     159                        {
     160                                // Downsample using a 3x3 filter, hi-pass and tone map
     161                                material Ogre/Compositor/HDR/Downsample3x3Brightpass
     162                                input 0 rt_full
     163                                input 1 rt_lum0
    501164                                identifier 800
    502             }
     165                        }
    503166                }
    504167
     
    541204                        }
    542205                }
    543 
    544 
    545206        }
    546 
    547207}
    548 
    549 
    550 // Gaussian blur effect
    551 compositor Gaussian Blur
    552 {
    553     technique
    554     {
    555         // Temporary textures
    556         texture rt0 target_width target_height PF_A8R8G8B8
    557         texture rt1 target_width target_height PF_A8R8G8B8
    558 
    559         target rt0
    560         {
    561             // Render output from previous compositor (or original scene)
    562             input previous
    563         }
    564 
    565         target rt1
    566         {
    567             // Blur horizontally
    568             input none
    569                         pass render_quad
    570                         {
    571                                 material Ogre/Compositor/HDR/GaussianBloom
    572                                 input 0 rt0
    573                                 identifier 700
    574                         }
    575         }
    576 
    577                 target_output
    578         {
    579             // Start with clear output
    580             input none
    581             // Blur vertically
    582             pass render_quad
    583             {
    584                 // Renders a fullscreen quad with a material
    585                                 material Ogre/Compositor/HDR/GaussianBloom
    586                 input 0 rt1
    587                                 identifier 701
    588             }
    589         }
    590     }
    591 }
    592 
Note: See TracChangeset for help on using the changeset viewer.