28 #ifndef _OgreShaderExLayeredBlending_
29 #define _OgreShaderExLayeredBlending_
32 #ifdef RTSHADER_SYSTEM_BUILD_EXT_SHADERS
42 #define SGX_LIB_LAYEREDBLENDING "SGXLib_LayeredBlending"
91 SM_Source1InvModulate,
92 SM_Source2InvModulate,
98 TextureBlend() : blendMode(LB_Invalid), sourceModifier(SM_Invalid), customNum(0) {}
103 SourceModifier sourceModifier;
125 void setBlendMode(
unsigned short index, BlendMode mode);
130 BlendMode getBlendMode(
unsigned short index)
const;
139 void setSourceModifier(
unsigned short index, SourceModifier modType,
int customNum);
148 bool getSourceModifier(
unsigned short index, SourceModifier& modType,
int& customNum)
const;
153 virtual void copyFrom(
const SubRenderState& rhs);
163 virtual bool resolveParameters(ProgramSet* programSet);
171 virtual void addPSBlendInvocations(Function* psMain,
176 const LayerBlendModeEx& blendMode,
177 const int groupOrder,
178 int& internalCounter,
184 void addPSModifierInvocation(Function* psMain,
188 const int groupOrder,
189 int& internalCounter,
194 vector<TextureBlend>::type mTextureBlends;
204 class LayeredBlendingFactory :
public SubRenderStateFactory
211 virtual const String& getType()
const;
216 virtual SubRenderState* createInstance(ScriptCompiler* compiler, PropertyAbstractNode* prop, TextureUnitState* texState, SGScriptTranslator* translator);
221 virtual void writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState,
const TextureUnitState* srcTextureUnit,
const TextureUnitState* dstTextureUnit);
229 virtual SubRenderState* createInstanceImpl();
234 LayeredBlending::BlendMode stringToBlendMode(
const String &strValue);
238 String blendModeToString(LayeredBlending::BlendMode blendMode);
243 LayeredBlending::SourceModifier stringToSourceModifier(
const String &strValue);
248 String sourceModifierToString(LayeredBlending::SourceModifier modifier);
255 LayeredBlending* createOrRetrieveSubRenderState(SGScriptTranslator* translator);
261 #endif // RTSHADER_SYSTEM_BUILD_EXT_SHADERS
262 #endif // _OgreShaderExLayeredBlending_
SharedPtr< Parameter > ParameterPtr
Container class for shader based programs.