source: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreFireRenderTechnique.h @ 2240

Revision 2240, 2.6 KB checked in by szirmay, 18 years ago (diff)
Line 
1#pragma once
2
3//disable inheritance warning caused by multiple inheritance
4#if _WIN32
5#if _MSC_VER
6#pragma warning(disable: 4250)
7#endif
8#endif
9
10#include "OgreRenderTechnique.h"
11#include "Ogre.h"
12
13using namespace Ogre;
14
15class FireRenderTarget :  public GlobalUseRenderTarget
16{
17       
18public:
19
20        static int targetsize;
21
22        FireRenderTarget();     
23};
24
25
26
27/**
28        @brief A special SBBRenderTechnique used in an OGRE environment.
29
30        Instead of rendering to the frame buffer this Technique renders into two render targets at the same time.
31        The firs render target will be used as it were an ordinary backbuffer.
32        The second rendertarget will be used to simulate heat shimmering (offset values will be written to it).
33        The shimmering effect will be achieved with post processing: combining the backbuffer with the first render target using the second render target as uv offset.
34        Just like the spherical billboard techniqeue, this thechnique requires a depth image taken from main camera's viewpoint.       
35*/
36class OgreFireRenderTechnique : public OgreRenderTechnique,
37                                                                        public RenderTargetListener,
38                                                                        public FrameListener,
39                                                                        public UpdateListener
40{
41public:
42        /**
43                @brief Constructor.
44
45                @param depthTexID                               the id of the texture unit state the resulting
46                                                                                        scene depth map should be bound to
47                @param pass                                             the pass to operate on                 
48                @param parentRenderable                 the object to operate on
49                @param parentTechniqueGroup             the TechniqueGroup this RenderedTechnique is attached to
50        */
51        OgreFireRenderTechnique(        unsigned char depthTexID,
52                                                        Pass* pass,
53                                                        OgreRenderable* parentRenderable,
54                                                        OgreTechniqueGroup* parentTechniqueGroup
55                                                        );
56        ~OgreFireRenderTechnique();
57       
58        //inherited
59        virtual void update(unsigned long frameNum);
60        //inherited
61        void  preRenderTargetUpdate (const RenderTargetEvent &evt);
62        //inherited
63        void  postRenderTargetUpdate (const RenderTargetEvent &evt);
64        //inherited
65        bool  frameEnded (const FrameEvent &evt);
66        //inherited
67        void preAllUpdates();
68       
69protected:     
70        /**
71                &brief the id of the texture unit state the resulting scene depth map should be bound to
72        */
73        unsigned char depthTexID;
74        bool lastVisibility;
75       
76};
77
78/**
79        @brief RenderTechniqueFactory to create OgreFireRenderTechnique instances.
80*/
81class OgreFireRenderTechniqueFactory : public RenderTechniqueFactory
82{
83public:
84       
85        OgreFireRenderTechniqueFactory();
86
87        OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
88                                                                                Pass* pass,
89                                                                                OgreRenderable* parentRenderable,
90                                                                                OgreTechniqueGroup* parentTechniqueGroup);
91
92
93        unsigned char depthTexID;
94
95};
96
97
Note: See TracBrowser for help on using the repository browser.