source: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h @ 2299

Revision 2299, 3.8 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 "CausticReceiverRenderTechnique.h"
12#include "Ogre.h"
13
14using namespace Ogre;
15
16/**
17        @brief CausticReceiverRenderTechnique 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 receiver 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 OgreCausticReceiverRenderTechnique : public OgreRenderTechnique,
30                                                                                public CausticReceiverRenderTechnique
31{
32public:
33        /**
34                @brief Constructor.
35
36                @param maxcasters                               the maximum number of caustic casters from which this receiver 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 passBlendingSRC                          source blend factor of the new passes
41                @param passBlendingDEST                         destination blend factor of the new passes
42                @param pass                                             the pass after which caustic gathering passes should be added
43                @param parentRenderable                 the object to operate on
44                @param parentTechniqueGroup             the TechniqueGroup this RenderedTechnique is attached to
45        */
46        OgreCausticReceiverRenderTechnique(
47                                                        int maxcasters,
48                                                        String causticVertexProgram,
49                                                        String causticFragmentProgram,
50                                                        SceneBlendFactor passBlendingSRC,
51                                                        SceneBlendFactor passBlendingDEST,
52                                                        Pass* pass,
53                                                        OgreRenderable* parentRenderable,
54                                                        OgreTechniqueGroup* parentTechniqueGroup
55                                                        );
56        /**
57                @brief Destructor.
58        */
59        ~OgreCausticReceiverRenderTechnique();
60       
61        //inherited
62        virtual void update(unsigned long frameNum);
63       
64protected:
65        /**
66                @brief the maximum number of caustic casters from which this receiver can recieve caustic light
67        */
68        int maxcasters;
69        /**
70                @brief the vertex program to be used in the caustic gathering passes
71        */
72        String causticVertexProgram;
73        /**
74                @brief the fragment program to be used in the caustic gathering passes
75
76                It should have one pass and the caustic cubemap of a caster will be bound to the first sampler unit.
77        */
78        String causticFragmentProgram;
79        /**
80                @breif new passes created by this technique
81        */
82        std::vector<Pass*> passes;
83        /**
84                @brief the nearest caustic casters found during update
85        */
86        std::vector<OgreSharedRuns*> causticCasters;
87        /**
88                @brief source blend factor of the new passes
89        */
90        SceneBlendFactor passBlendingSRC;
91        /**
92                @brief destination blend factor of the new passes
93        */
94        SceneBlendFactor passBlendingDEST;
95};
96
97/**
98        @brief RenderTechniqueFactory to create OgreCausticReceiverRenderTechnique instances.
99*/
100class OgreCausticReceiverRenderTechniqueFactory : public RenderTechniqueFactory
101{
102public:
103       
104        OgreCausticReceiverRenderTechniqueFactory();
105
106        OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
107                                                                                Pass* pass,
108                                                                                OgreRenderable* parentRenderable,
109                                                                                OgreTechniqueGroup* parentTechniqueGroup);
110
111
112        int maxcasters;
113        String causticVertexProgram;
114        String causticFragmentProgram;
115        SceneBlendFactor passBlendingSRC;
116        SceneBlendFactor passBlendingDEST;
117};
118
Note: See TracBrowser for help on using the repository browser.