OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreShaderExHardwareSkinningTechnique.h
Go to the documentation of this file.
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 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE.
25 -----------------------------------------------------------------------------
26 */
27 #ifndef _ShaderExHardwareSkinningTechnique_
28 #define _ShaderExHardwareSkinningTechnique_
29 
31 
32 #ifdef RTSHADER_SYSTEM_BUILD_EXT_SHADERS
33 #include "OgreShaderFunctionAtom.h"
34 
35 namespace Ogre {
36 namespace RTShader {
37 
49 class _OgreRTSSExport HardwareSkinningTechnique : public RTShaderSystemAlloc
50 {
51 // Interface.
52 public:
54  HardwareSkinningTechnique();
55 
56  virtual ~HardwareSkinningTechnique();
57 
61  virtual void copyFrom(const HardwareSkinningTechnique* hardSkin);
62 
66  void setHardwareSkinningParam(ushort boneCount, ushort weightCount, bool correctAntipodalityHandling = false, bool scalingShearingSupport = false);
67 
72  ushort getBoneCount();
73 
78  ushort getWeightCount();
79 
84  bool hasCorrectAntipodalityHandling();
85 
90  bool hasScalingShearingSupport();
91 
94  void setDoBoneCalculations(bool doBoneCalculations);
95 
99  virtual bool resolveParameters(ProgramSet* programSet) = 0;
100 
104  virtual bool resolveDependencies(ProgramSet* programSet) = 0;
105 
109  virtual bool addFunctionInvocations(ProgramSet* programSet) = 0;
110 
111 protected:
113  Operand::OpMask indexToMask (int index);
114 
115 // Attributes.
116 protected:
117  ushort mBoneCount;
118  ushort mWeightCount;
119 
120  bool mCorrectAntipodalityHandling;
121  bool mScalingShearingSupport;
122 
123  bool mDoBoneCalculations;
124 
125  ParameterPtr mParamInPosition;
126  ParameterPtr mParamInNormal;
127  ParameterPtr mParamInBiNormal;
128  ParameterPtr mParamInTangent;
129  ParameterPtr mParamInIndices;
130  ParameterPtr mParamInWeights;
131  UniformParameterPtr mParamInWorldMatrices;
132  UniformParameterPtr mParamInInvWorldMatrix;
133  UniformParameterPtr mParamInViewProjMatrix;
134  UniformParameterPtr mParamInWorldMatrix;
135  UniformParameterPtr mParamInWorldViewProjMatrix;
136 
137  ParameterPtr mParamTempFloat4;
138  ParameterPtr mParamTempFloat3;
139  ParameterPtr mParamLocalPositionWorld;
140  ParameterPtr mParamLocalNormalWorld;
141  ParameterPtr mParamLocalTangentWorld;
142  ParameterPtr mParamLocalBinormalWorld;
143  ParameterPtr mParamOutPositionProj;
144 };
145 
146 }
147 }
148 
149 #endif
150 #endif
151 
#define _OgreRTSSExport
SharedPtr< Parameter > ParameterPtr
unsigned short ushort
GeneralAllocatedObject RTShaderSystemAlloc
SharedPtr< UniformParameter > UniformParameterPtr