ShKernelLib.hpp

Go to the documentation of this file.
00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2006 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
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     // returns the string prefix concatenated with index
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     // TODO make a version of this with names like RenderMan globals
00088     // make a version with names like Houdini globals
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

Generated on Thu Feb 16 14:51:32 2006 for Sh by  doxygen 1.4.6