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

Revision 2240, 3.3 KB checked in by szirmay, 17 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 "CausticRecieverRenderTechnique.h"
12#include "Ogre.h"
13
14using namespace Ogre;
15
16/**
17        @brief CausticRecieverRenderTechnique used in an OGRE environment.
18
19        This technique defines that the object will recieve caustic lighting from caustic caster objects.
20        The caustic light spots will be calculated by the caustic caster's RenderingRuns.
21        These runs will only be updated if caustic redievers are visible, so it is the reciever technique's
22        responsibility to update them.
23
24        Each caustic caster's light contribution will be added in separate passes. Each pass
25        will add some light to the shaded image, so these passes should be the last passes.
26        In the constructor the given Pass* parameter will be the pass after which the caustic lighting
27        passes will be added by the technique.
28*/
29class OgreCausticRecieverRenderTechnique : public OgreRenderTechnique,
30                                                                                public CausticRecieverRenderTechnique
31{
32public:
33        /**
34                @brief Constructor.
35
36                @param maxcasters                               the maximum number of caustic casters from which this reciever can recieve caustic light
37                @param causticVertexProgram             the vertex program to be used in the caustic gathering passes
38                @param causticFragmentProgram   the fragment program to be used in the caustic gathering passes.
39                                                                                It should have one pass and the caustic cubemap of a caster will be bound to the first sampler unit.
40                @param pass                                             the pass after which caustic gathering passes should be added
41                @param parentRenderable                 the object to operate on
42                @param parentTechniqueGroup             the TechniqueGroup this RenderedTechnique is attached to
43        */
44        OgreCausticRecieverRenderTechnique(
45                                                        int maxcasters,
46                                                        String causticVertexProgram,
47                                                        String causticFragmentProgram,
48                                                        Pass* pass,
49                                                        OgreRenderable* parentRenderable,
50                                                        OgreTechniqueGroup* parentTechniqueGroup
51                                                        );
52        /**
53                @brief Destructor.
54        */
55        ~OgreCausticRecieverRenderTechnique();
56       
57        //inherited
58        virtual void update(unsigned long frameNum);
59       
60protected:
61        /**
62                @brief the maximum number of caustic casters from which this reciever can recieve caustic light
63        */
64        int maxcasters;
65        /**
66                @brief the vertex program to be used in the caustic gathering passes
67        */
68        String causticVertexProgram;
69        /**
70                @brief the fragment program to be used in the caustic gathering passes
71
72                It should have one pass and the caustic cubemap of a caster will be bound to the first sampler unit.
73        */
74        String causticFragmentProgram;
75        /**
76                @breif new passes created by this technique
77        */
78        std::vector<Pass*> passes;
79        /**
80                @brief the nearest caustic casters found during update
81        */
82        std::vector<OgreSharedRuns*> causticCasters;
83       
84};
85
86/**
87        @brief RenderTechniqueFactory to create OgreCausticRecieverRenderTechnique instances.
88*/
89class OgreCausticRecieverRenderTechniqueFactory : public RenderTechniqueFactory
90{
91public:
92       
93        OgreCausticRecieverRenderTechniqueFactory();
94
95        OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
96                                                                                Pass* pass,
97                                                                                OgreRenderable* parentRenderable,
98                                                                                OgreTechniqueGroup* parentTechniqueGroup);
99
100
101        int maxcasters;
102        String causticVertexProgram;
103        String causticFragmentProgram;
104
105};
106
Note: See TracBrowser for help on using the repository browser.