00001 /********************************************************************** 00002 * glsl_perlin_test.H: 00003 **********************************************************************/ 00004 #ifndef GLSL_PERLIN_TEST_H_IS_INCLUDED 00005 #define GLSL_PERLIN_TEST_H_IS_INCLUDED 00006 00007 #include "glsl_shader.H" 00008 00009 /********************************************************************** 00010 * GLSLPerlinTest: 00011 **********************************************************************/ 00012 class GLSLPerlinTest : public GLSLShader { 00013 public: 00014 //******** MANAGERS ******** 00015 GLSLPerlinTest(Patch* patch = 0); 00016 00017 //******** RUN-TIME TYPE ID ******** 00018 DEFINE_RTTI_METHODS3("GLSL Perlin Test", 00019 GLSLPerlinTest*, BasicTexture, CDATA_ITEM*); 00020 00021 // Set the name of the texture to use (full path): 00022 void set_tex(Cstr_ptr& full_path_name); 00023 00024 //******** GLSLShader VIRTUAL METHODS ******** 00025 00026 // Called in init(); query and store the "locations" of 00027 // uniform and attribute variables here: 00028 virtual bool get_variable_locs(); 00029 00030 // Send values of uniform variables to the shader: 00031 virtual bool set_uniform_variables() const; 00032 00033 // Init the 1D toon texture by loading from file: 00034 virtual void init_textures(); 00035 00036 // Activate the 1D toon texture for drawing: 00037 virtual void activate_textures(); 00038 00039 //******** DATA_ITEM VIRTUAL METHODS ******** 00040 virtual DATA_ITEM *dup() const { return new GLSLPerlinTest; } 00041 00042 protected: 00043 //******** Member Variables ******** 00044 TEXTUREglptr _tex; // the texture 00045 GLint _tex_loc; // "location" of sampler2D in the program 00046 00047 //******** VIRTUAL METHODS ******** 00048 00049 // Return the names of the toon GLSL shader programs: 00050 virtual str_ptr vp_filename() { return vp_name("Perlin"); } 00051 00052 // XXX - temporary, until we can figure out how to not use the 00053 // fragment shader: 00054 virtual str_ptr fp_filename() { return fp_name("Perlin"); } 00055 00056 // we're not using any fragment shader: 00057 // XXX - we have to figure out how to not use the fragment shader 00058 // virtual str_list fp_filenames() { return str_list(); } 00059 }; 00060 00061 #endif // GLSL_TOON_H_IS_INCLUDED 00062 00063 // end of file glsl_toon.H