Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShKernelLib.hpp

Go to the documentation of this file.
00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory
00004 // Project administrator: Michael D. McCool
00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa,
00006 //          Bryan Chan, Michael D. McCool
00007 // 
00008 // This software is provided 'as-is', without any express or implied
00009 // warranty. In no event will the authors be held liable for any damages
00010 // arising from the use of this software.
00011 // 
00012 // Permission is granted to anyone to use this software for any purpose,
00013 // including commercial applications, and to alter it and redistribute it
00014 // freely, subject to the following restrictions:
00015 // 
00016 // 1. The origin of this software must not be misrepresented; you must
00017 // not claim that you wrote the original software. If you use this
00018 // software in a product, an acknowledgment in the product documentation
00019 // would be appreciated but is not required.
00020 // 
00021 // 2. Altered source versions must be plainly marked as such, and must
00022 // not be misrepresented as being the original software.
00023 // 
00024 // 3. This notice may not be removed or altered from any source
00025 // distribution.
00027 #ifndef SHUTIL_KERNELLIB_HPP 
00028 #define SHUTIL_KERNELLIB_HPP 
00029 
00030 #include <string>
00031 #include "ShLib.hpp"
00032 #include "ShMatrix.hpp"
00033 #include "ShTexture.hpp"
00034 #include "ShProgram.hpp"
00035 
00053 namespace ShUtil {
00054 
00055 using namespace SH;
00056 
00057 class ShKernelLib {
00058   private:
00059     // returns the string prefix concatenated with index
00060     static std::string makeName(std::string prefix, int index); 
00061 
00062   public:
00064 
00070     static ShProgram outputPass( const ShProgram &p );
00071 
00078     static ShProgram inputPass( const ShProgram &p );
00079 
00090     static ShProgram shChangeBasis(std::string name="vec", 
00091         std::string b0Name="b0", std::string b1Name="b1", std::string b2Name="b2"); 
00092 
00094     // TODO make a version of this with names like RenderMan globals
00095     // make a version with names like Houdini globals
00096 
00134     template<int N, ShBindingType Binding, typename T>
00135     static ShProgram shVsh(const ShMatrix<N, N, Binding, T> &mv,
00136                            const ShMatrix<N, N, Binding, T> &mvp,
00137                            int numTangents = 0, int numLights = 1); 
00138 };
00139 
00140 }
00141 
00142 #include "ShKernelLibImpl.hpp"
00143 
00144 #endif

Generated on Mon Jan 24 18:36:32 2005 for Sh by  doxygen 1.4.1