Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/OgreMain/include/OgreCompositionTargetPass.h @ 1

Last change on this file since 1 was 1, checked in by landauf, 17 years ago
File size: 5.6 KB
Line 
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-2006 Torus Knot Software Ltd
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
24You may alternatively use this source under the terms of a specific version of
25the OGRE Unrestricted License provided you have obtained such a license from
26Torus Knot Software Ltd.
27-----------------------------------------------------------------------------
28*/
29#ifndef __CompositionTargetPass_H__
30#define __CompositionTargetPass_H__
31
32#include "OgrePrerequisites.h"
33#include "OgreIteratorWrappers.h"
34
35namespace Ogre {
36        /** Object representing one render to a RenderTarget or Viewport in the Ogre Composition
37                framework.
38         */
39    class _OgreExport CompositionTargetPass
40    {
41    public:
42        CompositionTargetPass(CompositionTechnique *parent);
43        ~CompositionTargetPass();
44       
45        /** Input mode of a TargetPass
46        */
47        enum InputMode
48        {
49            IM_NONE,        // No input
50            IM_PREVIOUS     // Output of previous Composition in chain
51        };
52        typedef std::vector<CompositionPass *> Passes;
53        typedef VectorIterator<Passes> PassIterator;
54       
55        /** Set input mode of this TargetPass
56        */
57        void setInputMode(InputMode mode);
58        /** Get input mode */
59        InputMode getInputMode() const;
60       
61        /** Set output local texture name */
62        void setOutputName(const String &out);
63        /** Get output local texture name */
64        const String &getOutputName() const;
65       
66        /** Set "only initial" flag. This makes that this target pass is only executed initially
67            after the effect has been enabled.
68        */
69        void setOnlyInitial(bool value);
70        /** Get "only initial" flag.
71        */
72        bool getOnlyInitial();
73       
74        /** Set the scene visiblity mask used by this pass
75        */
76        void setVisibilityMask(uint32 mask);
77        /** Get the scene visiblity mask used by this pass
78        */
79        uint32 getVisibilityMask();
80
81                /** Set the material scheme used by this target pass.
82                @remarks
83                        Only applicable to targets that render the scene as
84                        one of their passes.
85                        @see Technique::setScheme.
86                */
87                void setMaterialScheme(const String& schemeName);
88                /** Get the material scheme used by this target pass.
89                @remarks
90                        Only applicable to targets that render the scene as
91                        one of their passes.
92                        @see Technique::setScheme.
93                */
94                const String& getMaterialScheme(void) const;
95       
96                /** Set whether shadows are enabled in this target pass.
97                @remarks
98                        Only applicable to targets that render the scene as
99                        one of their passes.
100                */
101                void setShadowsEnabled(bool enabled);
102                /** Get whether shadows are enabled in this target pass.
103                @remarks
104                        Only applicable to targets that render the scene as
105                        one of their passes.
106                */
107                bool getShadowsEnabled(void) const;
108        /** Set the scene LOD bias used by this pass. The default is 1.0,
109            everything below that means lower quality, higher means higher quality.
110        */
111        void setLodBias(float bias);
112        /** Get the scene LOD bias used by this pass
113        */
114        float getLodBias();
115       
116        /** Create a new pass, and return a pointer to it.
117        */
118        CompositionPass *createPass();
119        /** Remove a pass. It will also be destroyed.
120        */
121        void removePass(size_t idx);
122        /** Get a pass.
123        */
124        CompositionPass *getPass(size_t idx);
125        /** Get the number of passes.
126        */
127        size_t getNumPasses();
128       
129        /** Remove all passes
130        */
131        void removeAllPasses();
132   
133        /** Get an iterator over the Passes in this TargetPass. */
134        PassIterator getPassIterator(void);
135       
136        /** Get parent object */
137        CompositionTechnique *getParent();
138
139        /** Determine if this target pass is supported on the current rendering device.
140         */
141        bool _isSupported(void);
142
143    private:
144        /// Parent technique
145        CompositionTechnique *mParent;
146        /// Input name
147        InputMode mInputMode;
148        /// (local) output texture
149        String mOutputName;
150        /// Passes
151        Passes mPasses;
152        /// This target pass is only executed initially after the effect
153        /// has been enabled.
154        bool mOnlyInitial;
155        /// Visibility mask for this render
156        uint32 mVisibilityMask;
157        /// LOD bias of this render
158        float mLodBias;
159                /// Material scheme name
160                String mMaterialScheme;
161                /// Shadows option
162                bool mShadowsEnabled;
163    };
164
165}
166
167#endif
Note: See TracBrowser for help on using the repository browser.