shaders/shaderscreen/orshaderscreen_shader.h

shaders/shaderscreen/orshaderscreen_shader.h
#ifndef __ORSHADER_SCREEN_H__
#define __ORSHADER_SCREEN_H__
/***************************************************************************************
Autodesk(R) Open Reality(R) Samples
(C) 2009 Autodesk, Inc. and/or its licensors
All rights reserved.
AUTODESK SOFTWARE LICENSE AGREEMENT
Autodesk, Inc. licenses this Software to you only upon the condition that
you accept all of the terms contained in the Software License Agreement ("Agreement")
that is embedded in or that is delivered with this Software. By selecting
the "I ACCEPT" button at the end of the Agreement or by copying, installing,
uploading, accessing or using all or any portion of the Software you agree
to enter into the Agreement. A contract is then formed between Autodesk and
either you personally, if you acquire the Software for yourself, or the company
or other legal entity for which you are acquiring the software.
AUTODESK, INC., MAKES NO WARRANTY, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE REGARDING THESE MATERIALS, AND MAKES SUCH MATERIALS AVAILABLE SOLELY ON AN
"AS-IS" BASIS.
IN NO EVENT SHALL AUTODESK, INC., BE LIABLE TO ANYONE FOR SPECIAL, COLLATERAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING OUT OF PURCHASE
OR USE OF THESE MATERIALS. THE SOLE AND EXCLUSIVE LIABILITY TO AUTODESK, INC.,
REGARDLESS OF THE FORM OF ACTION, SHALL NOT EXCEED THE PURCHASE PRICE OF THE
MATERIALS DESCRIBED HEREIN.
Autodesk, Inc., reserves the right to revise and improve its products as it sees fit.
Autodesk and Open Reality are registered trademarks or trademarks of Autodesk, Inc.,
in the U.S.A. and/or other countries. All other brand names, product names, or
trademarks belong to their respective holders.
GOVERNMENT USE
Use, duplication, or disclosure by the U.S. Government is subject to restrictions as
set forth in FAR 12.212 (Commercial Computer Software-Restricted Rights) and
DFAR 227.7202 (Rights in Technical Data and Computer Software), as applicable.
Manufacturer is Autodesk, Inc., 10 Duke Street, Montreal, Quebec, Canada, H3C 2L7.
***************************************************************************************/
//--- SDK include
#include <fbsdk/fbsdk.h>
#ifndef ORSDK_DLL
#define ORSDK_DLL K_DLLIMPORT
#endif
//--- Registration define
#define ORSHADERSCREEN__CLASSNAME ORShaderScreen
#define ORSHADERSCREEN__CLASSSTR "ORShaderScreen"
#define ORSHADERSCREEN__DESCSTR "OR - Shader Screen"
class ORSDK_DLL ORShaderScreen : public FBShader
{
//--- FiLMBOX declaration.
FBShaderDeclare( ORShaderScreen, FBShader );
public:
virtual bool FBCreate();
virtual void FBDestroy();
public:
virtual FBShaderModelInfo* NewShaderModelInfo(HKModelRenderInfo pModelRenderInfo, int pSubRegionIndex);
virtual void DestroyShaderModelInfo( FBRenderOptions* pOptions, FBShaderModelInfo* pInfo );
virtual void ShadeModel( FBRenderOptions* pRenderOptions, FBShaderModelInfo* pShaderModelInfo, FBRenderingPass pPass );
// FBX store/retrieve
bool FbxStore (FBFbxObject* pFbxObject);
bool FbxRetrieve(FBFbxObject* pFbxObject, FBRenderer* pRenderer);
public:
// Tweak the parameters for the connectors
void AnimateColor1 ( bool pState ) { mColor1.SetAnimated(pState); }
void AnimateColor2 ( bool pState ) { mColor2.SetAnimated(pState); }
void AnimateIntensity ( bool pState ) { mIntensity.SetAnimated(pState); }
void KeyColor1 () { mColor1.Key(); }
void KeyColor2 () { mColor2.Key(); }
void KeyIntensity () { mIntensity.Key(); }
bool IsColor1Animated () { return mColor1.IsAnimated(); }
bool IsColor2Animated () { return mColor2.IsAnimated(); }
bool IsIntensityAnimated() { return mIntensity.IsAnimated(); }
public:
// Color operations
enum ORColorOp
{
eMultiply,
eAdd,
eAverage,
eSubtract1,
eSubtract2,
eColor1,
eColor2,
eColorOpCount
};
ORColorOp GetColorOp() { return mColorOp; }
void SetColorOp(ORColorOp pOp) { mColorOp = pOp; }
const char* GetColorOpName(ORColorOp pOp) { return ColorOpNames[pOp]; }
private:
static const char* ColorOpNames[eColorOpCount];
public:
// Query from UI
void SetColor1( FBColor pValue ) { mColor1 = pValue; }
FBColor GetColor1() { return mColor1; }
void SetColor2( FBColor pValue ) { mColor2 = pValue; }
FBColor GetColor2() { return mColor2; }
void SetIntensity(double pValue) { mIntensity = pValue; }
double GetIntensity() { return mIntensity; }
private:
FBSystem mSystem;
ORColorOp mColorOp;
FBPropertyAnimatableColor mColor1; // Xfade color 1
FBPropertyAnimatableColor mColor2; // Xfade color 2
FBPropertyAnimatableDouble mIntensity; // Intensity.
};
#endif /* __ORSHADER_SCREEN_H__ */