OgreShaderExHardwareSkinningTechnique.h
Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004 (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org
    00006
    00007 Copyright (c) 2000-2012 Torus Knot Software Ltd
    00008 Permission is hereby granted, free of charge, to any person obtaining a copy
    00009 of this software and associated documentation files (the "Software"), to deal
    00010 in the Software without restriction, including without limitation the rights
    00011 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00012 copies of the Software, and to permit persons to whom the Software is
    00013 furnished to do so, subject to the following conditions:
    00014
    00015 The above copyright notice and this permission notice shall be included in
    00016 all copies or substantial portions of the Software.
    00017
    00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00020 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    00021 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00022 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00023 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    00024 THE SOFTWARE.
    00025 -----------------------------------------------------------------------------
    00026 */
    00027 #ifndef _ShaderExHardwareSkinningTechnique_
    00028 #define _ShaderExHardwareSkinningTechnique_
    00029
    00030 #include "OgreShaderPrerequisites.h"
    00031
    00032 #ifdef RTSHADER_SYSTEM_BUILD_EXT_SHADERS
    00033 #include "OgreShaderSubRenderState.h"
    00034 #include "OgreShaderParameter.h"
    00035 #include "OgreRenderSystem.h"
    00036 #include "OgreShaderFunctionAtom.h"
    00037
    00038 namespace Ogre {
    00039 namespace RTShader {
    00040
    00041 class HardwareSkinningFactory;
    00042
    00054 class _OgreRTSSExport HardwareSkinningTechnique : public RTShaderSystemAlloc
    00055 {
    00056 // Interface.
    00057 public:
    00059     HardwareSkinningTechnique();
    00060
    00061     virtual ~HardwareSkinningTechnique();
    00062
    00066     virtual void copyFrom(const HardwareSkinningTechnique* hardSkin);
    00067
    00071     void setHardwareSkinningParam(ushort boneCount, ushort weightCount, bool correctAntipodalityHandling = false, bool scalingShearingSupport = false);
    00072
    00077     ushort getBoneCount();
    00078
    00083     ushort getWeightCount();
    00084
    00089     bool hasCorrectAntipodalityHandling();
    00090
    00095     bool hasScalingShearingSupport();
    00096
    00099     void setDoBoneCalculations(bool doBoneCalculations);
    00100
    00104     virtual bool resolveParameters(ProgramSet* programSet) = 0;
    00105
    00109     virtual bool resolveDependencies(ProgramSet* programSet) = 0;
    00110
    00114     virtual bool addFunctionInvocations(ProgramSet* programSet) = 0;
    00115
    00116 protected:
    00118     Operand::OpMask indexToMask (int index);
    00119
    00120 // Attributes.
    00121 protected:
    00122     ushort mBoneCount;
    00123     ushort mWeightCount;
    00124
    00125     bool mCorrectAntipodalityHandling;
    00126     bool mScalingShearingSupport;
    00127
    00128     bool mDoBoneCalculations;
    00129
    00130     ParameterPtr mParamInPosition;
    00131     ParameterPtr mParamInNormal;
    00132     ParameterPtr mParamInBiNormal;
    00133     ParameterPtr mParamInTangent;
    00134     ParameterPtr mParamInIndices;
    00135     ParameterPtr mParamInWeights;
    00136     UniformParameterPtr mParamInWorldMatrices;
    00137     UniformParameterPtr mParamInInvWorldMatrix;
    00138     UniformParameterPtr mParamInViewProjMatrix;
    00139     UniformParameterPtr mParamInWorldMatrix;
    00140     UniformParameterPtr mParamInWorldViewProjMatrix;
    00141
    00142     ParameterPtr mParamTempFloat4;
    00143     ParameterPtr mParamTempFloat3;
    00144     ParameterPtr mParamLocalPositionWorld;
    00145     ParameterPtr mParamLocalNormalWorld;
    00146     ParameterPtr mParamLocalTangentWorld;
    00147     ParameterPtr mParamLocalBinormalWorld;
    00148     ParameterPtr mParamOutPositionProj;
    00149 };
    00150
    00151 }
    00152 }
    00153
    00154 #endif
    00155 #endif
    00156

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:27:23