35class EXPCL_PANDA_GOBJ
TextureStage :
public TypedWritableReferenceCount {
70 M_metallic_roughness = M_selector,
93 CS_constant_color_scale,
100 CO_one_minus_src_color,
102 CO_one_minus_src_alpha,
105 INLINE
void set_name(
const std::string &name);
106 INLINE
const std::string &
get_name()
const;
125 INLINE
void set_color(
const LColor &color);
141 CombineSource source0, CombineOperand operand0);
143 CombineSource source0, CombineOperand operand0,
144 CombineSource source1, CombineOperand operand1);
146 CombineSource source0, CombineOperand operand0,
147 CombineSource source1, CombineOperand operand1,
148 CombineSource source2, CombineOperand operand2);
159 CombineSource source0, CombineOperand operand0);
161 CombineSource source0, CombineOperand operand0,
162 CombineSource source1, CombineOperand operand1);
164 CombineSource source0, CombineOperand operand0,
165 CombineSource source1, CombineOperand operand1,
166 CombineSource source2, CombineOperand operand2);
181 INLINE
bool operator == (
const TextureStage &other)
const;
182 INLINE
bool operator != (
const TextureStage &other)
const;
183 INLINE
bool operator < (
const TextureStage &other)
const;
187 void write(std::ostream &out)
const;
188 void write(std::ostream &out,
int indent_level)
const;
189 void output(std::ostream &out)
const;
219 INLINE
void update_color_flags();
221 static int get_expected_num_combine_operands(CombineMode cm);
222 static bool operand_valid_for_rgb(CombineOperand co);
223 static bool operand_valid_for_alpha(CombineOperand co);
234 int _tex_view_offset;
235 bool _involves_color_scale;
237 bool _uses_primary_color;
238 bool _uses_last_saved_result;
240 CombineMode _combine_rgb_mode;
241 int _num_combine_rgb_operands;
242 CombineSource _combine_rgb_source0;
243 CombineOperand _combine_rgb_operand0;
244 CombineSource _combine_rgb_source1;
245 CombineOperand _combine_rgb_operand1;
246 CombineSource _combine_rgb_source2;
247 CombineOperand _combine_rgb_operand2;
249 CombineMode _combine_alpha_mode;
250 int _num_combine_alpha_operands;
251 CombineSource _combine_alpha_source0;
252 CombineOperand _combine_alpha_operand0;
253 CombineSource _combine_alpha_source1;
254 CombineOperand _combine_alpha_operand1;
255 CombineSource _combine_alpha_source2;
256 CombineOperand _combine_alpha_operand2;
261 mutable bool _used_by_auto_shader;
278 static void init_type() {
279 TypedWritableReferenceCount::init_type();
281 TypedWritableReferenceCount::get_class_type());
283 virtual TypeHandle get_type()
const {
284 return get_class_type();
286 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
289 static TypeHandle _type_handle;
292INLINE std::ostream &operator << (std::ostream &out,
const TextureStage &ts);
294EXPCL_PANDA_GOBJ std::ostream &operator << (std::ostream &out, TextureStage::Mode mode);
295EXPCL_PANDA_GOBJ std::ostream &operator << (std::ostream &out, TextureStage::CombineMode cm);
296EXPCL_PANDA_GOBJ std::ostream &operator << (std::ostream &out, TextureStage::CombineSource cs);
297EXPCL_PANDA_GOBJ std::ostream &operator << (std::ostream &out, TextureStage::CombineOperand co);
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Encodes a string name in a hash table, mapping it to a pointer.
Defines the properties of a named stage of the multitexture pipeline.
bool uses_primary_color() const
Returns true if the TextureStage makes use of the CS_primary_color combine source.
get_default
Returns the default TextureStage that will be used for all texturing that does not name a particular ...
int compare_to(const TextureStage &other) const
Returns a number less than zero if this TextureStage sorts before the other one, greater than zero if...
get_binormal_name
Returns the set of binormals this texture stage will use.
CombineMode get_combine_alpha_mode() const
Get combine_alpha_mode.
set_sort
Changes the order in which the texture associated with this stage is rendered relative to the other t...
get_saved_result
Returns the current setting of the saved_result flag.
get_name
Returns the name of this texture stage.
CombineOperand get_combine_rgb_operand2() const
Get operand2 of combine_rgb_mode.
set_tex_view_offset
Sets the tex_view_offset value.
CombineSource get_combine_alpha_source1() const
Get source1 of combine_alpha_mode.
void write(std::ostream &out) const
Writes the details of this stage.
void output(std::ostream &out) const
Just a single line output.
TextureStage(const std::string &name)
Initialize the texture stage at construction.
static void register_with_read_factory()
Factory method to generate a TextureStage object.
CombineMode get_combine_rgb_mode() const
Get the combine_rgb_mode.
CombineSource get_combine_rgb_source1() const
Get source1 of combine_rgb_mode.
bool is_fixed_function() const
Returns true if the TextureStage is relevant to the classic fixed function pipeline.
bool involves_color_scale() const
Returns true if the TextureStage is affected by the setting of the current ColorScaleAttrib,...
CombineOperand get_combine_alpha_operand0() const
Get operand0 of combine_alpha_mode.
set_color
Set the color for this stage.
get_priority
Returns the priority associated with this stage.
CombineOperand get_combine_rgb_operand1() const
Get operand1 of combine_rgb_mode.
CombineSource get_combine_alpha_source0() const
Get source0 of combine_alpha_mode.
get_rgb_scale
See set_rgb_scale().
set_name
Changes the name of this texture stage.
get_alpha_scale
See set_alpha_scale().
set_mode
Set the mode of this texture stage.
get_sort
Returns the sort order of this texture stage.
int get_num_combine_rgb_operands() const
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get...
static TypedWritable * make_TextureStage(const FactoryParams ¶ms)
Factory method to generate a TextureStage object.
CombineOperand get_combine_alpha_operand1() const
Get operand1 of combine_alpha_mode.
get_color
return the color for this stage
get_tex_view_offset
Returns the current setting of the tex_view_offset.
void mark_used_by_auto_shader() const
Marks this TextureStage as having been used by the auto shader.
CombineSource get_combine_rgb_source0() const
Get source0 of combine_rgb_mode.
CombineSource get_combine_rgb_source2() const
Get source2 of combine_rgb_mode.
get_mode
Return the mode of this stage.
void set_combine_rgb(CombineMode mode, CombineSource source0, CombineOperand operand0)
Specifies any of the CombineMode values that represent a one-parameter operation.
static UpdateSeq get_sort_seq()
Returns a global sequence number that is incremented any time any TextureStage in the world changes s...
set_priority
Changes the relative importance of the texture associated with this stage relative to the other textu...
bool uses_color() const
Returns true if the TextureStage makes use of whatever color is specified in set_color(),...
int get_num_combine_alpha_operands() const
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and g...
CombineOperand get_combine_rgb_operand0() const
Get operand0 of combine_rgb_mode.
CombineSource get_combine_alpha_source2() const
Get source2 of combine_alpha_mode.
void set_combine_alpha(CombineMode mode, CombineSource source0, CombineOperand operand0)
Specifies any of the CombineMode values that represent a one-parameter operation.
get_texcoord_name
See set_texcoord_name.
set_alpha_scale
Sets an additional factor that will scale the alpha component after the texture has been applied.
bool uses_last_saved_result() const
Returns true if the TextureStage makes use of the CS_primary_color combine source.
set_rgb_scale
Sets an additional factor that will scale all three r, g, b components after the texture has been app...
get_tangent_name
Returns the set of tangents this texture stage will use.
set_saved_result
Sets the saved_result flag.
set_texcoord_name
Indicate which set of UV's this texture stage will use.
CombineOperand get_combine_alpha_operand2() const
Get operand2 of combine_alpha_mode.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
This is a sequence number that increments monotonically.
This is our own Panda specialization on the default STL list.
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.