18 #ifndef SHADERATTRIB_H
19 #define SHADERATTRIB_H
21 #include "pandabase.h"
22 #include "renderAttrib.h"
23 #include "pointerTo.h"
24 #include "shaderInput.h"
26 #include "pta_float.h"
27 #include "pta_double.h"
28 #include "pta_LMatrix4.h"
29 #include "pta_LMatrix3.h"
30 #include "pta_LVecBase4.h"
31 #include "pta_LVecBase3.h"
32 #include "pta_LVecBase2.h"
41 INLINE ShaderAttrib(
const ShaderAttrib ©);
49 F_disable_alpha_write = 0,
50 F_subsume_alpha_test = 1,
51 F_hardware_skinning = 2,
54 INLINE
bool has_shader()
const;
55 INLINE
bool auto_shader()
const;
56 INLINE
int get_shader_priority()
const;
57 INLINE
int get_instance_count()
const;
58 INLINE
bool auto_normal_on()
const;
59 INLINE
bool auto_glow_on()
const;
60 INLINE
bool auto_gloss_on()
const;
61 INLINE
bool auto_ramp_on()
const;
62 INLINE
bool auto_shadow_on()
const;
89 int priority=0)
const;
91 CPT(
RenderAttrib) set_instance_count(
int instance_count)
const;
96 CPT(
RenderAttrib) clear_shader_input(
const InternalName *
id)
const;
97 CPT(
RenderAttrib) clear_shader_input(
const string &
id)
const;
101 INLINE
bool get_flag(
int flag)
const;
104 const Shader *get_shader()
const;
105 const ShaderInput *get_shader_input(
const InternalName *
id)
const;
106 const ShaderInput *get_shader_input(
const string &
id)
const;
108 const NodePath &get_shader_input_nodepath(
const InternalName *
id)
const;
109 LVecBase4 get_shader_input_vector(InternalName *
id)
const;
110 Texture *get_shader_input_texture(
const InternalName *
id)
const;
111 const SamplerState &get_shader_input_sampler(
const InternalName *
id)
const;
113 const LMatrix4 &get_shader_input_matrix(
const InternalName *
id,
LMatrix4 &matrix)
const;
115 static void register_with_read_factory();
120 virtual int compare_to_impl(
const RenderAttrib *other)
const;
121 virtual size_t get_hash_impl()
const;
128 int _shader_priority;
135 bool _auto_normal_on;
139 bool _auto_shadow_on;
145 static int get_class_slot() {
148 virtual int get_slot()
const {
149 return get_class_slot();
156 static void init_type() {
157 RenderAttrib::init_type();
158 register_type(_type_handle,
"ShaderAttrib",
159 RenderAttrib::get_class_type());
160 _attrib_slot =
register_slot(_type_handle, 10, make_default);
163 return get_class_type();
165 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
169 static int _attrib_slot;
173 #include "shaderAttrib.I"
175 #endif // SHADERATTRIB_H
static int register_slot(TypeHandle type_handle, int sort, RenderAttribRegistry::MakeDefaultFunc *make_default_func)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
This is the base class for all three-component vectors and points.
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
This is a 4-by-4 transform matrix.
This is the base class for all two-component vectors and points.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Represents a set of settings that indicate how a texture is sampled.
This is the base class for all three-component vectors and points.
TypeHandle is the identifier used to differentiate C++ class types.
This is a 3-by-3 transform matrix.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...