00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef SHUTIL_KERNELLIB_HPP
00021 #define SHUTIL_KERNELLIB_HPP
00022
00023 #include <string>
00024 #include "sh/ShLib.hpp"
00025 #include "sh/ShMatrix.hpp"
00026 #include "sh/ShTexture.hpp"
00027 #include "sh/ShProgram.hpp"
00028
00046 namespace ShUtil {
00047
00048 using namespace SH;
00049
00050 class ShKernelLib {
00051 private:
00052
00053 static std::string makeName(std::string prefix, int index);
00054
00055 public:
00057
00063 static ShProgram outputPass( const ShProgram &p );
00064
00071 static ShProgram inputPass( const ShProgram &p );
00072
00083 static ShProgram shChangeBasis(std::string name="vec",
00084 std::string b0Name="b0", std::string b1Name="b1", std::string b2Name="b2");
00085
00087
00088
00089
00127 template<int N, ShBindingType Binding, typename T>
00128 static ShProgram shVsh(const ShMatrix<N, N, Binding, T> &mv,
00129 const ShMatrix<N, N, Binding, T> &mvp,
00130 int numTangents = 0, int numLights = 1);
00131 };
00132
00133 }
00134
00135 #include "ShKernelLibImpl.hpp"
00136
00137 #endif