16#ifndef SHADERGENERATOR_H
17#define SHADERGENERATOR_H
76 void rehash_generated_shaders();
77 void clear_generated_shaders();
82 bool _use_generic_attr : 1;
83 bool _use_pointcoord : 1;
88 void reset_register_allocator();
89 const char *alloc_vreg();
90 const char *alloc_freg();
92 bool _use_shadow_filter;
99 bool operator < (
const ShaderKey &other)
const;
100 bool operator == (
const ShaderKey &other)
const;
101 bool operator != (
const ShaderKey &other)
const {
return !operator ==(other); }
106 TF_has_alpha = 0x002,
107 TF_has_texscale = 0x004,
108 TF_has_texmat = 0x008,
109 TF_saved_result = 0x010,
110 TF_map_normal = 0x020,
111 TF_map_height = 0x040,
113 TF_map_gloss = 0x100,
114 TF_map_emission = 0x001000000,
115 TF_uses_color = 0x200,
116 TF_uses_primary_color = 0x400,
117 TF_uses_last_saved_result = 0x800,
119 TF_rgb_scale_2 = 0x1000,
120 TF_rgb_scale_4 = 0x2000,
121 TF_alpha_scale_2 = 0x4000,
122 TF_alpha_scale_4 = 0x8000,
124 TF_COMBINE_RGB_MODE_SHIFT = 16,
125 TF_COMBINE_RGB_MODE_MASK = 0x0000f0000,
126 TF_COMBINE_ALPHA_MODE_SHIFT = 20,
127 TF_COMBINE_ALPHA_MODE_MASK = 0x000f00000,
130 ColorAttrib::Type _color_type;
136 Texture::TextureType _type;
137 TextureStage::Mode _mode;
138 TexGenAttrib::Mode _gen_mode;
140 uint16_t _combine_rgb;
141 uint16_t _combine_alpha;
147 LF_has_specular_color = 2,
156 bool _have_separate_ambient;
162 bool _calc_primary_alpha;
163 bool _disable_alpha_write;
164 RenderAttrib::PandaCompareFunc _alpha_test_mode;
165 PN_stdfloat _alpha_test_ref;
167 int _num_clip_planes;
172 typedef phash_map<ShaderKey, CPT(
ShaderAttrib)> GeneratedShaders;
173 GeneratedShaders _generated_shaders;
175 void analyze_renderstate(ShaderKey &key,
const RenderState *rs);
177 static std::string combine_mode_as_string(
const ShaderKey::TextureInfo &info,
178 TextureStage::CombineMode c_mode,
bool alpha,
short texindex);
179 static std::string combine_source_as_string(
const ShaderKey::TextureInfo &info,
180 short num,
bool alpha,
short texindex);
181 static const char *texture_type_as_string(Texture::TextureType ttype);
187 static void init_type() {
188 TypedReferenceCount::init_type();
190 TypedReferenceCount::get_class_type());
193 return get_class_type();
195 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
212 void rehash_generated_shaders();
213 void clear_generated_shaders();
219 static void init_type() {
220 TypedReferenceCount::init_type();
222 TypedReferenceCount::get_class_type());
225 return get_class_type();
227 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A light source that seems to illuminate all points in space at once.
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
A light shining from infinitely far away in a particular direction, like sunlight.
This object describes how the vertex animation, if any, represented in a GeomVertexData is encoded.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Indicates which set of lights should be considered "on" to illuminate geometry at this level and belo...
A Light Ramp is any unary operator that takes a rendered pixel as input, and adjusts the brightness o...
A light originating from a single point in space, and shining in all directions.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
A light originating from a single point in space, and shining in a particular direction,...
TypeHandle is the identifier used to differentiate C++ class types.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.