source: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreIllumVolumeRenderTechnique.h @ 2302

Revision 2302, 3.7 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 "IllumVolumeRenderTechnique.h"
12
13/**
14        @brief IllumVolumeRenderTechnique used in an OGRE environment.
15*/
16class OgreIllumVolumeRenderTechnique : public OgreRenderTechnique,
17                                                                                        public IllumVolumeRenderTechnique
18{
19public:
20        /**
21                @brief Constructor.
22
23                @param startFrame                                       adds an offset to the current frame number to help evenly distribute updates between frames
24                @param illumVolumeUpdateInterval        the update frequency of the light volume
25                @param illumTextureResolution           the resolution of the light volume texture
26                @param textureDepth                                     the number of layers to use (should be set to 1)
27                @param illumTexID                                       the id of the texture unit state the resulting illum volume should be bound to
28                @param useDistCalc                                      flag to skip updates if the shaded particle system is far away (not used)
29                @param materialName                                     the name of the material that is used while rendering the light volume
30                @param lightMatrixGPUParamName          the name of the gpu program parameter where the light matrix should be bound to
31                @param useHierarchicalImpostor          set this flag to true if the particle system is a hierarchical particle system
32                @param impostorTexID                            the id of the texture unit state where the impostor image of the smaller system should be bound to
33                @param pass                                                     the pass to operate on                 
34                @param parentRenderable                         the object to operate on
35                @param parentTechniqueGroup                     the TechniqueGroup this RenderedTechnique is attached to
36        */
37        OgreIllumVolumeRenderTechnique(unsigned long startFrame,
38                                                        unsigned long illumVolumeUpdateInterval,
39                                                        unsigned int illumTextureResolution,
40                                                        unsigned int textureDepth,
41                                                        unsigned char illumTexID,
42                                                        bool useDistCalc,
43                                                        String materialName,
44                                                        String lightMatrixGPUParamName,
45                                                        bool useHierarchicalImpostor,
46                                                        unsigned char impostorTexID,
47                                                        Pass* pass,
48                                                        OgreRenderable* parentRenderable,
49                                                        OgreTechniqueGroup* parentTechniqueGroup
50                                                        );
51        /**
52                @brief Destructor.
53        */
54        ~OgreIllumVolumeRenderTechnique();
55       
56protected:
57        /**
58                @brief the name of the material that is used while rendering the light volume
59        */
60        String materialName;
61        /**
62                @brief the id of the texture unit state the resulting illumevolume should be bound to
63        */
64        unsigned char illumTexID;
65        /**
66                @brief the name of the gpu program parameter where the light matrix should be bound to
67        */
68        String lightMatrixGPUParamName;
69        /**
70                @brief the id of the texture unit state where the impostor image of the smaller system should be bound to
71        */
72        unsigned char impostorTexID;
73       
74        //inherited
75        RenderingRun* createLightVolumeRenderingRun();
76        //inherited
77        void lightVolumeChanged(RenderingRun* run);
78        //inherited
79        void lightVolumeUpdated(RenderingRun* run);
80        //inherited
81        void hierarchicalImpostorUpdated(RenderingRun* run);
82};
83
84/**
85        @brief RenderTechniqueFactory to create OgreIllumVolumeRenderTechnique instances.
86*/
87class OgreIllumVolumeRenderTechniqueFactory : public RenderTechniqueFactory
88{
89public:
90       
91        OgreIllumVolumeRenderTechniqueFactory();
92
93        OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
94                                                                                Pass* pass,
95                                                                                OgreRenderable* parentRenderable,
96                                                                                OgreTechniqueGroup* parentTechniqueGroup);
97
98
99        String materialName;
100        unsigned char illumTexID;
101        unsigned long startFrame;       
102        unsigned long illumVolumeUpdateInterval;
103        unsigned int illumTextureResolution;
104        unsigned int textureDepth;     
105        bool useDistCalc;
106        String lightMatrixGPUParamName;
107        unsigned char impostorTexID;
108        bool useHierarchicalImpostor;   
109};
Note: See TracBrowser for help on using the repository browser.