Coverage Report

Created: 2025-08-28 06:22

/src/ogre/OgreMain/include/OgreCompositionTargetPass.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OGRE
4
    (Object-oriented Graphics Rendering Engine)
5
For the latest info, see http://www.ogre3d.org/
6
7
Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9
Permission is hereby granted, free of charge, to any person obtaining a copy
10
of this software and associated documentation files (the "Software"), to deal
11
in the Software without restriction, including without limitation the rights
12
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
copies of the Software, and to permit persons to whom the Software is
14
furnished to do so, subject to the following conditions:
15
16
The above copyright notice and this permission notice shall be included in
17
all copies or substantial portions of the Software.
18
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
THE SOFTWARE.
26
-----------------------------------------------------------------------------
27
*/
28
#ifndef __CompositionTargetPass_H__
29
#define __CompositionTargetPass_H__
30
31
#include "OgrePrerequisites.h"
32
#include "OgreHeaderPrefix.h"
33
#include "OgreCompositionPass.h"
34
35
namespace Ogre {
36
    template <typename T> class VectorIterator;
37
38
    /** \addtogroup Core
39
    *  @{
40
    */
41
    /** \addtogroup Effects
42
    *  @{
43
    */
44
    /** Object representing one render to a RenderTarget or Viewport in the Ogre Composition
45
        framework.
46
     */
47
    class _OgreExport CompositionTargetPass : public CompositorInstAlloc
48
    {
49
    public:
50
        CompositionTargetPass(CompositionTechnique *parent);
51
        ~CompositionTargetPass();
52
        
53
        /** Input mode of a TargetPass
54
        */
55
        enum InputMode
56
        {
57
            IM_NONE,        /// No input
58
            IM_PREVIOUS     /// Output of previous Composition in chain
59
        };
60
        typedef std::vector<CompositionPass *> Passes;
61
        typedef VectorIterator<Passes> PassIterator;
62
        
63
        /** Set input mode of this TargetPass
64
        */
65
        void setInputMode(InputMode mode);
66
        /** Get input mode */
67
        InputMode getInputMode() const;
68
        
69
        /** Set output local texture name */
70
        void setOutputName(const String &out);
71
        /** Get output local texture name */
72
        const String &getOutputName() const;
73
74
        /// sets the slice of output texture
75
0
        void setOutputSlice(int slice) { mOutputSlice = slice; }
76
0
        int getOutputSlice() const { return mOutputSlice; }
77
78
        /** Set "only initial" flag. This makes that this target pass is only executed initially 
79
            after the effect has been enabled.
80
        */
81
        void setOnlyInitial(bool value);
82
        /** Get "only initial" flag.
83
        */
84
        bool getOnlyInitial();
85
        
86
        /** Set the scene visibility mask used by this pass 
87
        */
88
        void setVisibilityMask(uint32 mask);
89
        /** Get the scene visibility mask used by this pass 
90
        */
91
        uint32 getVisibilityMask();
92
93
        /** Set the material scheme used by this target pass.
94
95
            Only applicable to targets that render the scene as
96
            one of their passes.
97
            @see Technique::setScheme.
98
        */
99
        void setMaterialScheme(const String& schemeName);
100
        /** Get the material scheme used by this target pass.
101
102
            Only applicable to targets that render the scene as
103
            one of their passes.
104
            @see Technique::setScheme.
105
        */
106
        const String& getMaterialScheme(void) const;
107
        
108
        /** Set whether shadows are enabled in this target pass.
109
110
            Only applicable to targets that render the scene as
111
            one of their passes.
112
        */
113
        void setShadowsEnabled(bool enabled);
114
        /** Get whether shadows are enabled in this target pass.
115
116
            Only applicable to targets that render the scene as
117
            one of their passes.
118
        */
119
        bool getShadowsEnabled(void) const;
120
        /** Set the scene LOD bias used by this pass. The default is 1.0,
121
            everything below that means lower quality, higher means higher quality.
122
        */
123
        void setLodBias(float bias);
124
        /** Get the scene LOD bias used by this pass 
125
        */
126
        float getLodBias();
127
128
        /** Create a new pass, and return a pointer to it.
129
        */
130
        CompositionPass *createPass(CompositionPass::PassType type = CompositionPass::PT_RENDERQUAD);
131
        /** Remove a pass. It will also be destroyed.
132
        */
133
        void removePass(size_t idx);
134
        /** Get a pass.*/
135
0
        CompositionPass *getPass(size_t idx) const { return mPasses.at(idx); }
136
        /** Get the number of passes.
137
        */
138
0
        size_t getNumPasses() const { return mPasses.size(); }
139
        
140
        /// Get the Passes in this TargetPass
141
0
        const Passes& getPasses() const {
142
0
            return mPasses;
143
0
        }
144
145
        /** Remove all passes
146
        */
147
        void removeAllPasses();
148
    
149
        /** Get an iterator over the Passes in this TargetPass.
150
        @deprecated use getPasses() */
151
        OGRE_DEPRECATED PassIterator getPassIterator(void);
152
        
153
        /** Get parent object */
154
        CompositionTechnique *getParent();
155
156
        /** Determine if this target pass is supported on the current rendering device. 
157
         */
158
        bool _isSupported(void);
159
160
    private:
161
        /// Parent technique
162
        CompositionTechnique *mParent;
163
        /// Input mode
164
        InputMode mInputMode;
165
        /// (local) output texture
166
        String mOutputName;
167
        /// Passes
168
        Passes mPasses;
169
        /// This target pass is only executed initially after the effect
170
        /// has been enabled.
171
        bool mOnlyInitial;
172
        /// Visibility mask for this render
173
        uint32 mVisibilityMask;
174
        /// LOD bias of this render
175
        float mLodBias;
176
        /// Material scheme name
177
        String mMaterialScheme;
178
        /// Shadows option
179
        bool mShadowsEnabled;
180
        /// Output Slice
181
        int mOutputSlice;
182
    };
183
184
    /** @} */
185
    /** @} */
186
}
187
188
#include "OgreHeaderSuffix.h"
189
190
#endif