OgreShaderFFPColour.h
Go to the documentation of this file.
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-2013 Torus Knot Software Ltd
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24THE SOFTWARE.
25-----------------------------------------------------------------------------
26*/
27#ifndef _ShaderFFPColur_
28#define _ShaderFFPColur_
29
31#ifdef RTSHADER_SYSTEM_BUILD_CORE_SHADERS
33#include "OgreShaderParameter.h"
34
35namespace Ogre {
36namespace RTShader {
37
48class _OgreRTSSExport FFPColour : public SubRenderState
49{
50public:
51
52 // Parameter stage flags of the colour component.
53 enum StageFlags
54 {
55 SF_VS_INPUT_DIFFUSE = 1 << 1,
56 SF_VS_INPUT_SPECULAR = 1 << 2,
57 SF_VS_OUTPUT_DIFFUSE = 1 << 3,
58 SF_VS_OUTPUT_SPECULAR = 1 << 4,
59 SF_PS_INPUT_DIFFUSE = 1 << 5,
60 SF_PS_INPUT_SPECULAR = 1 << 6,
61 SF_PS_OUTPUT_DIFFUSE = 1 << 7,
62 SF_PS_OUTPUT_SPECULAR = 1 << 8
63 };
64
65// Interface.
66public:
67
69 FFPColour();
70
71
75 virtual const String& getType() const;
76
80 virtual int getExecutionOrder() const;
81
85 virtual void copyFrom(const SubRenderState& rhs);
86
90 virtual bool preAddToRenderState(const RenderState* renderState, Pass* srcPass, Pass* dstPass);
91
98 void setResolveStageFlags(unsigned int flags) { mResolveStageFlags = flags; }
99
103 unsigned int getResolveStageFlags() const { return mResolveStageFlags; }
104
109 void addResolveStageMask(unsigned int mask) { mResolveStageFlags |= mask; }
110
115 void removeResolveStageMask(unsigned int mask) { mResolveStageFlags &= ~mask; }
116
117 static String Type;
118
119// Protected methods
120protected:
121 virtual bool resolveParameters(ProgramSet* programSet);
122 virtual bool resolveDependencies(ProgramSet* programSet);
123 virtual bool addFunctionInvocations(ProgramSet* programSet);
124
125// Attributes.
126protected:
127 // Vertex shader input diffuse component.
128 ParameterPtr mVSInputDiffuse;
129 // Vertex shader input specular component.
130 ParameterPtr mVSInputSpecular;
131 // Vertex shader output diffuse component.
132 ParameterPtr mVSOutputDiffuse;
133 // Vertex shader input specular component.
134 ParameterPtr mVSOutputSpecular;
135 // Pixel shader input diffuse component.
136 ParameterPtr mPSInputDiffuse;
137 // Pixel shader input specular component.
138 ParameterPtr mPSInputSpecular;
139 // Pixel shader output diffuse component.
140 ParameterPtr mPSOutputDiffuse;
141 // Pixel shader input specular component.
142 ParameterPtr mPSOutputSpecular;
143 // Stage flags that defines resolve parameters definitions.
144 unsigned int mResolveStageFlags;
145};
146
147
152class _OgreRTSSExport FFPColourFactory : public SubRenderStateFactory
153{
154public:
155
159 virtual const String& getType() const;
160
164 virtual SubRenderState* createInstance(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
165
169 virtual void writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState, Pass* srcPass, Pass* dstPass);
170
171
172protected:
173
177 virtual SubRenderState* createInstanceImpl();
178
179
180};
181
185}
186}
187
188#endif
189#endif
#define _OgreRTSSExport
SharedPtr< Parameter > ParameterPtr
_StringBase String

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.