source: GTP/trunk/Lib/Geom/OgreStuff/include/OgreCompositionTargetPass.h @ 1809

Revision 1809, 4.9 KB checked in by gumbau, 18 years ago (diff)
RevLine 
[1809]1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __CompositionTargetPass_H__
26#define __CompositionTargetPass_H__
27
28#include "OgrePrerequisites.h"
29#include "OgreIteratorWrappers.h"
30
31namespace Ogre {
32        /** Object representing one render to a RenderTarget or Viewport in the Ogre Composition
33                framework.
34         */
35    class _OgreExport CompositionTargetPass
36    {
37    public:
38        CompositionTargetPass(CompositionTechnique *parent);
39        ~CompositionTargetPass();
40       
41        /** Input mode of a TargetPass
42        */
43        enum InputMode
44        {
45            IM_NONE,        // No input
46            IM_PREVIOUS     // Output of previous Composition in chain
47        };
48        typedef std::vector<CompositionPass *> Passes;
49        typedef VectorIterator<Passes> PassIterator;
50       
51        /** Set input mode of this TargetPass
52        */
53        void setInputMode(InputMode mode);
54        /** Get input mode */
55        InputMode getInputMode() const;
56       
57        /** Set output local texture name */
58        void setOutputName(const String &out);
59        /** Get output local texture name */
60        const String &getOutputName() const;
61       
62        /** Set "only initial" flag. This makes that this target pass is only executed initially
63            after the effect has been enabled.
64        */
65        void setOnlyInitial(bool value);
66        /** Get "only initial" flag.
67        */
68        bool getOnlyInitial();
69       
70        /** Set the scene visiblity mask used by this pass
71        */
72        void setVisibilityMask(uint32 mask);
73        /** Get the scene visiblity mask used by this pass
74        */
75        uint32 getVisibilityMask();
76
77                /** Set the material scheme used by this target pass.
78                @remarks
79                        Only applicable to targets that render the scene as
80                        one of their passes.
81                        @see Technique::setScheme.
82                */
83                void setMaterialScheme(const String& schemeName);
84                /** Get the material scheme used by this target pass.
85                @remarks
86                        Only applicable to targets that render the scene as
87                        one of their passes.
88                        @see Technique::setScheme.
89                */
90                const String& getMaterialScheme(void) const;
91       
92        /** Set the scene LOD bias used by this pass. The default is 1.0,
93            everything below that means lower quality, higher means higher quality.
94        */
95        void setLodBias(float bias);
96        /** Get the scene LOD bias used by this pass
97        */
98        float getLodBias();
99       
100        /** Create a new pass, and return a pointer to it.
101        */
102        CompositionPass *createPass();
103        /** Remove a pass. It will also be destroyed.
104        */
105        void removePass(size_t idx);
106        /** Get a pass.
107        */
108        CompositionPass *getPass(size_t idx);
109        /** Get the number of passes.
110        */
111        size_t getNumPasses();
112       
113        /** Remove all passes
114        */
115        void removeAllPasses();
116   
117        /** Get an iterator over the Passes in this TargetPass. */
118        PassIterator getPassIterator(void);
119       
120        /** Get parent object */
121        CompositionTechnique *getParent();
122
123        /** Determine if this target pass is supported on the current rendering device.
124         */
125        bool _isSupported(void);
126
127    private:
128        /// Parent technique
129        CompositionTechnique *mParent;
130        /// Input name
131        InputMode mInputMode;
132        /// (local) output texture
133        String mOutputName;
134        /// Passes
135        Passes mPasses;
136        /// This target pass is only executed initially after the effect
137        /// has been enabled.
138        bool mOnlyInitial;
139        /// Visibility mask for this render
140        uint32 mVisibilityMask;
141        /// LOD bias of this render
142        float mLodBias;
143                /// Material scheme name
144                String mMaterialScheme;
145    };
146
147}
148
149#endif
Note: See TracBrowser for help on using the repository browser.