00001 // Filename: shader.cxx 00002 // Created by: mike (09Jan97) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 #include "shader.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Static variables 00022 //////////////////////////////////////////////////////////////////// 00023 TypeHandle Shader::_type_handle; 00024 TypeHandle FrustumShader::_type_handle; 00025 00026 Shader::Visualize* Shader::_viz = (Shader::Visualize*)0L; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: Shader::Constructor 00030 // Access: Protected 00031 // Description: 00032 //////////////////////////////////////////////////////////////////// 00033 Shader:: 00034 Shader() : Configurable(), _priority(0) { 00035 MemoryUsage::update_type(this, this); 00036 } 00037 00038 Shader::Visualize::Visualize(void) 00039 { 00040 } 00041 00042 Shader::Visualize::~Visualize(void) 00043 { 00044 } 00045 00046 void Shader::Visualize::DisplayTexture(PT(Texture)&, Shader*) 00047 { 00048 } 00049 00050 void Shader::Visualize::DisplayPixelBuffer(PT(PixelBuffer)&, Shader*) 00051 { 00052 } 00053 00054 void Shader::Visualize::Flush(void) 00055 { 00056 } 00057 00058 //////////////////////////////////////////////////////////////////// 00059 // Function: Shader::apply 00060 // Access: Public 00061 // Description: 00062 //////////////////////////////////////////////////////////////////// 00063 void Shader:: 00064 apply(Node *, const AllAttributesWrapper &, 00065 const AllTransitionsWrapper &, 00066 GraphicsStateGuardian *) 00067 { 00068 if (is_dirty()) config(); 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: Shader::pre_apply 00073 // Access: Public 00074 // Description: 00075 //////////////////////////////////////////////////////////////////// 00076 void Shader:: 00077 pre_apply(Node *, const AllAttributesWrapper &, 00078 const AllTransitionsWrapper &, 00079 GraphicsStateGuardian *) 00080 { 00081 } 00082 00083 //////////////////////////////////////////////////////////////////// 00084 // Function: Shader::set_priority 00085 // Access: Public 00086 // Description: 00087 //////////////////////////////////////////////////////////////////// 00088 void Shader:: 00089 set_priority(int priority) 00090 { 00091 _priority = priority; 00092 } 00093 00094 //////////////////////////////////////////////////////////////////// 00095 // Function: Shader::get_priority 00096 // Access: Public 00097 // Description: 00098 //////////////////////////////////////////////////////////////////// 00099 int Shader:: 00100 get_priority(void) const 00101 { 00102 return _priority; 00103 } 00104 00105 00106 //////////////////////////////////////////////////////////////////// 00107 // Function: Shader::set_multipass 00108 // Access: Public 00109 // Description: 00110 //////////////////////////////////////////////////////////////////// 00111 void Shader:: 00112 set_multipass(bool on) 00113 { 00114 _multipass_on = on; 00115 } 00116 00117 00118 00119 00120