Panda3D
textureStage.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file textureStage.cxx
10  * @author MAsaduzz
11  * @date 2004-07-16
12  */
13 
14 #include "textureStage.h"
15 #include "internalName.h"
16 #include "bamReader.h"
17 #include "bamWriter.h"
18 
19 using std::ostream;
20 
21 PT(TextureStage) TextureStage::_default_stage;
22 UpdateSeq TextureStage::_sort_seq;
23 
24 TypeHandle TextureStage::_type_handle;
25 
26 /**
27  * Initialize the texture stage at construction
28  */
30 TextureStage(const std::string &name) : _used_by_auto_shader(false) {
31  _name = name;
32  _sort = 0;
33  _priority = 0;
34  _texcoord_name = InternalName::get_texcoord();
35  _mode = M_modulate;
36  _color.set(0.0f, 0.0f, 0.0f, 1.0f);
37  _rgb_scale = 1;
38  _alpha_scale = 1;
39  _saved_result = false;
40  _tex_view_offset = 0;
41  _combine_rgb_mode = CM_undefined;
42  _num_combine_rgb_operands = 0;
43  _combine_rgb_source0 = CS_undefined;
44  _combine_rgb_operand0 = CO_undefined;
45  _combine_rgb_source1 = CS_undefined;
46  _combine_rgb_operand1 = CO_undefined;
47  _combine_rgb_source2 = CS_undefined;
48  _combine_rgb_operand2 = CO_undefined;
49  _combine_alpha_mode = CM_undefined;
50  _num_combine_alpha_operands = 0;
51  _combine_alpha_source0 = CS_undefined;
52  _combine_alpha_operand0 = CO_undefined;
53  _combine_alpha_source1 = CS_undefined;
54  _combine_alpha_operand1 = CO_undefined;
55  _combine_alpha_source2 = CS_undefined;
56  _combine_alpha_operand2 = CO_undefined;
57 
58  _uses_color = false;
59  _involves_color_scale = false;
60 }
61 
62 /**
63  * just copy the members of other to this
64  */
65 void TextureStage::
66 operator = (const TextureStage &other) {
67  _name = other._name;
68  _sort = other._sort;
69  _priority = other._priority;
70  _texcoord_name = other._texcoord_name;
71  _mode = other._mode;
72  _color = other._color;
73  _rgb_scale = other._rgb_scale;
74  _alpha_scale = other._alpha_scale;
75  _saved_result = other._saved_result;
76  _tex_view_offset = other._tex_view_offset;
77 
78  _combine_rgb_mode = other._combine_rgb_mode;
79  _combine_rgb_source0 = other._combine_rgb_source0;
80  _combine_rgb_operand0 = other._combine_rgb_operand0;
81  _combine_rgb_source1 = other._combine_rgb_source1;
82  _combine_rgb_operand1 = other._combine_rgb_operand1;
83  _combine_rgb_source2 = other._combine_rgb_source2;
84  _combine_rgb_operand2 = other._combine_rgb_operand2;
85  _combine_alpha_mode = other._combine_alpha_mode;
86  _combine_alpha_source0 = other._combine_alpha_source0;
87  _combine_alpha_operand0 = other._combine_alpha_operand0;
88  _combine_alpha_source1 = other._combine_alpha_source1;
89  _combine_alpha_operand1 = other._combine_alpha_operand1;
90  _combine_alpha_source2 = other._combine_alpha_source2;
91  _combine_alpha_operand2 = other._combine_alpha_operand2;
92 
93  _uses_color = other._uses_color;
94  _involves_color_scale = other._involves_color_scale;
95 
96  _used_by_auto_shader = false;
97 }
98 
99 /**
100  *
101  */
102 TextureStage::
103 ~TextureStage() {
104 }
105 
106 /**
107  * Returns a number less than zero if this TextureStage sorts before the other
108  * one, greater than zero if it sorts after, or zero if they are equivalent.
109  * The sorting order is arbitrary and largely meaningless, except to
110  * differentiate different stages.
111  */
112 int TextureStage::
113 compare_to(const TextureStage &other) const {
114  // We put the sort parameter first, so that we sorting a list of
115  // TextureStages will happen to put them in sorted order, even though we
116  // don't promise to do that. But there's no reason not to do so, and it
117  // might be more convenient for the developer.
118  if (get_sort() != other.get_sort()) {
119  return get_sort() < other.get_sort() ? -1 : 1;
120  }
121 
122  // The remaining parameters are arbitrary. We start with the name, because
123  // that's most likely to be consistent between similar TextureStages, and
124  // different between different TextureStages.
125  int compare = strcmp(get_name().c_str(), other.get_name().c_str());
126  if (compare != 0) {
127  return compare;
128  }
129 
130  if (get_priority() != other.get_priority()) {
131  return get_priority() < other.get_priority() ? -1 : 1;
132  }
133  if (get_texcoord_name() != other.get_texcoord_name()) {
134  return get_texcoord_name() < other.get_texcoord_name() ? -1 : 1;
135  }
136  if (get_mode() != other.get_mode()) {
137  return get_mode() < other.get_mode() ? -1 : 1;
138  }
139  if (get_rgb_scale() != other.get_rgb_scale()) {
140  return get_rgb_scale() < other.get_rgb_scale() ? -1 : 1;
141  }
142  if (get_alpha_scale() != other.get_alpha_scale()) {
143  return get_alpha_scale() < other.get_alpha_scale() ? -1 : 1;
144  }
145  if (get_saved_result() != other.get_saved_result()) {
146  return get_saved_result() < other.get_saved_result() ? -1 : 1;
147  }
148  if (get_tex_view_offset() != other.get_tex_view_offset()) {
149  return get_tex_view_offset() < other.get_tex_view_offset() ? -1 : 1;
150  }
151  if (get_mode() == M_combine) {
152  if (get_combine_rgb_mode() != other.get_combine_rgb_mode()) {
153  return get_combine_rgb_mode() < other.get_combine_rgb_mode() ? -1 : 1;
154  }
155 
158  }
159  if (get_num_combine_rgb_operands() >= 1) {
161  return get_combine_rgb_source0() < other.get_combine_rgb_source0() ? -1 : 1;
162  }
164  return get_combine_rgb_operand0() < other.get_combine_rgb_operand0() ? -1 : 1;
165  }
166  }
167  if (get_num_combine_rgb_operands() >= 2) {
169  return get_combine_rgb_source1() < other.get_combine_rgb_source1() ? -1 : 1;
170  }
172  return get_combine_rgb_operand1() < other.get_combine_rgb_operand1() ? -1 : 1;
173  }
174  }
175  if (get_num_combine_rgb_operands() >= 3) {
177  return get_combine_rgb_source2() < other.get_combine_rgb_source2() ? -1 : 1;
178  }
180  return get_combine_rgb_operand2() < other.get_combine_rgb_operand2() ? -1 : 1;
181  }
182  }
184  return get_combine_alpha_mode() < other.get_combine_alpha_mode() ? -1 : 1;
185  }
186 
189  }
190  if (get_num_combine_alpha_operands() >= 1) {
192  return get_combine_alpha_source0() < other.get_combine_alpha_source0() ? -1 : 1;
193  }
195  return get_combine_alpha_operand0() < other.get_combine_alpha_operand0() ? -1 : 1;
196  }
197  }
198  if (get_num_combine_alpha_operands() >= 2) {
200  return get_combine_alpha_source1() < other.get_combine_alpha_source1() ? -1 : 1;
201  }
203  return get_combine_alpha_operand1() < other.get_combine_alpha_operand1() ? -1 : 1;
204  }
205  }
206  if (get_num_combine_alpha_operands() >= 3) {
208  return get_combine_alpha_source2() < other.get_combine_alpha_source2() ? -1 : 1;
209  }
211  return get_combine_alpha_operand2() < other.get_combine_alpha_operand2() ? -1 : 1;
212  }
213  }
214  }
215 
216  return 0;
217 }
218 
219 /**
220  * Writes the details of this stage
221  */
222 void TextureStage::
223 write(ostream &out) const {
224  out << "TextureStage " << get_name() << ", sort = " << get_sort() << ", priority = " << get_priority() << "\n"
225  << " texcoords = " << get_texcoord_name()->get_name()
226  << ", mode = " << get_mode() << ", color = " << get_color()
227  << ", scale = " << get_rgb_scale() << ", " << get_alpha_scale()
228  << ", saved_result = " << get_saved_result()
229  << ", tex_view_offset = " << get_tex_view_offset() << "\n";
230 
231  if (get_mode() == M_combine) {
232  out << " RGB combine mode = " << get_combine_rgb_mode() << "\n";
233  if (get_num_combine_rgb_operands() >= 1) {
234  out << " 0: " << get_combine_rgb_source0() << ", "
235  << get_combine_rgb_operand0() << "\n";
236  }
237  if (get_num_combine_rgb_operands() >= 2) {
238  out << " 1: " << get_combine_rgb_source1() << ", "
239  << get_combine_rgb_operand1() << "\n";
240  }
241  if (get_num_combine_rgb_operands() >= 3) {
242  out << " 2: " << get_combine_rgb_source2() << ", "
243  << get_combine_rgb_operand2() << "\n";
244  }
245  out << " alpha combine mode = " << get_combine_alpha_mode() << "\n";
246  if (get_num_combine_alpha_operands() >= 1) {
247  out << " 0: " << get_combine_alpha_source0() << ", "
248  << get_combine_alpha_operand0() << "\n";
249  }
250  if (get_num_combine_alpha_operands() >= 2) {
251  out << " 1: " << get_combine_alpha_source1() << ", "
252  << get_combine_alpha_operand1() << "\n";
253  }
254  if (get_num_combine_alpha_operands() >= 3) {
255  out << " 2: " << get_combine_alpha_source2() << ", "
256  << get_combine_alpha_operand2() << "\n";
257  }
258  }
259 }
260 
261 /**
262  * Just a single line output
263  */
264 void TextureStage::
265 output(ostream &out) const {
266  out << "TextureStage " << get_name();
267 }
268 
269 /**
270  * Returns the number of combine operands expected with the indicated combine
271  * mode (0, 1, 2, or 3).
272  */
273 int TextureStage::
274 get_expected_num_combine_operands(TextureStage::CombineMode cm) {
275  switch (cm) {
276  case CM_undefined:
277  return 0;
278 
279  case CM_replace:
280  return 1;
281 
282  case CM_modulate:
283  case CM_add:
284  case CM_add_signed:
285  case CM_subtract:
286  case CM_dot3_rgb:
287  case CM_dot3_rgba:
288  return 2;
289 
290  case CM_interpolate:
291  return 3;
292  }
293 
294  return 0;
295 }
296 
297 /**
298  * Returns true if the indicated CombineOperand is valid for one of the RGB
299  * modes, false otherwise.
300  */
301 bool TextureStage::
302 operand_valid_for_rgb(TextureStage::CombineOperand co) {
303  switch (co) {
304  case CO_undefined:
305  return false;
306 
307  case CO_src_color:
308  case CO_one_minus_src_color:
309  case CO_src_alpha:
310  case CO_one_minus_src_alpha:
311  return true;
312  }
313 
314  return false;
315 }
316 
317 /**
318  * Returns true if the indicated CombineOperand is valid for one of the alpha
319  * modes, false otherwise.
320  */
321 bool TextureStage::
322 operand_valid_for_alpha(TextureStage::CombineOperand co) {
323  switch (co) {
324  case CO_undefined:
325  case CO_src_color:
326  case CO_one_minus_src_color:
327  return false;
328 
329  case CO_src_alpha:
330  case CO_one_minus_src_alpha:
331  return true;
332  }
333 
334  return false;
335 }
336 
337 /**
338  * Factory method to generate a TextureStage object
339  */
340 void TextureStage::
343 }
344 
345 /**
346  * Factory method to generate a TextureStage object
347  */
350  DatagramIterator scan;
351  BamReader *manager;
352 
353  parse_params(params, scan, manager);
354 
355  bool is_default = scan.get_bool();
356  if (is_default) {
357  return get_default();
358  } else {
359  TextureStage *me = new TextureStage("");
360  me->fillin(scan, manager);
361  return me;
362  }
363 }
364 
365 /**
366  * Function that reads out of the datagram (or asks manager to read) all of
367  * the data that is needed to re-create this object and stores it in the
368  * appropiate place
369  */
370 void TextureStage::
371 fillin(DatagramIterator &scan, BamReader *manager) {
372  _name = scan.get_string();
373  _sort = scan.get_int32();
374  _priority = scan.get_int32();
375 
376  manager->read_pointer(scan);
377 
378  _mode = (TextureStage::Mode) scan.get_uint8();
379  _color.read_datagram(scan);
380 
381  _rgb_scale = scan.get_uint8();
382  _alpha_scale = scan.get_uint8();
383  _saved_result = scan.get_bool();
384  _tex_view_offset = 0;
385  if (manager->get_file_minor_ver() >= 26) {
386  _tex_view_offset = scan.get_int32();
387  }
388 
389  _combine_rgb_mode = (TextureStage::CombineMode) scan.get_uint8();
390  _num_combine_rgb_operands = scan.get_uint8();
391  _combine_rgb_source0 = (TextureStage::CombineSource) scan.get_uint8();
392  _combine_rgb_operand0 = (TextureStage::CombineOperand) scan.get_uint8();
393  _combine_rgb_source1 = (TextureStage::CombineSource) scan.get_uint8();
394  _combine_rgb_operand1 = (TextureStage::CombineOperand) scan.get_uint8();
395  _combine_rgb_source2 = (TextureStage::CombineSource) scan.get_uint8();
396  _combine_rgb_operand2 = (TextureStage::CombineOperand) scan.get_uint8();
397 
398  _combine_alpha_mode = (TextureStage::CombineMode) scan.get_uint8();
399  _num_combine_alpha_operands = scan.get_uint8();
400  _combine_alpha_source0 = (TextureStage::CombineSource) scan.get_uint8();
401  _combine_alpha_operand0 = (TextureStage::CombineOperand) scan.get_uint8();
402  _combine_alpha_source1 = (TextureStage::CombineSource) scan.get_uint8();
403  _combine_alpha_operand1 = (TextureStage::CombineOperand) scan.get_uint8();
404  _combine_alpha_source2 = (TextureStage::CombineSource) scan.get_uint8();
405  _combine_alpha_operand2 = (TextureStage::CombineOperand) scan.get_uint8();
406 
407  update_color_flags();
408 }
409 
410 /**
411  * Receives an array of pointers, one for each time manager->read_pointer()
412  * was called in fillin(). Returns the number of pointers processed.
413  */
414 int TextureStage::
416  int pi = TypedWritableReferenceCount::complete_pointers(p_list, manager);
417 
418  _texcoord_name = DCAST(InternalName, p_list[pi++]);
419 
420  return pi;
421 }
422 
423 /**
424  * Function to write the important information in the particular object to a
425  * Datagram
426  */
427 void TextureStage::
429  // These properties are read in again by fillin(), above.
430  if (this == get_default()) {
431  me.add_bool(true);
432  } else {
433  me.add_bool(false);
434  me.add_string(_name);
435  me.add_int32(_sort);
436  me.add_int32(_priority);
437 
438  manager->write_pointer(me, _texcoord_name);
439 
440  me.add_uint8(_mode);
441  _color.write_datagram(me);
442  me.add_uint8(_rgb_scale);
443  me.add_uint8(_alpha_scale);
444  me.add_bool(_saved_result);
445 
446  if (manager->get_file_minor_ver() >= 26) {
447  me.add_int32(_tex_view_offset);
448  }
449 
450  me.add_uint8(_combine_rgb_mode);
451  me.add_uint8(_num_combine_rgb_operands);
452  me.add_uint8(_combine_rgb_source0);
453  me.add_uint8(_combine_rgb_operand0);
454  me.add_uint8(_combine_rgb_source1);
455  me.add_uint8(_combine_rgb_operand1);
456  me.add_uint8(_combine_rgb_source2);
457  me.add_uint8(_combine_rgb_operand2);
458 
459  me.add_uint8(_combine_alpha_mode);
460  me.add_uint8(_num_combine_alpha_operands);
461  me.add_uint8(_combine_alpha_source0);
462  me.add_uint8(_combine_alpha_operand0);
463  me.add_uint8(_combine_alpha_source1);
464  me.add_uint8(_combine_alpha_operand1);
465  me.add_uint8(_combine_alpha_source2);
466  me.add_uint8(_combine_alpha_operand2);
467  }
468 }
469 
470 ostream &
471 operator << (ostream &out, TextureStage::Mode mode) {
472  switch (mode) {
473  case TextureStage::M_modulate:
474  return out << "modulate";
475 
476  case TextureStage::M_decal:
477  return out << "decal";
478 
479  case TextureStage::M_blend:
480  return out << "blend";
481 
482  case TextureStage::M_replace:
483  return out << "replace";
484 
485  case TextureStage::M_add:
486  return out << "add";
487 
488  case TextureStage::M_combine:
489  return out << "combine";
490 
491  case TextureStage::M_blend_color_scale:
492  return out << "blend_color_scale";
493 
494  case TextureStage::M_modulate_glow:
495  return out << "modulate_glow";
496 
497  case TextureStage::M_modulate_gloss:
498  return out << "modulate_gloss";
499 
500  case TextureStage::M_normal:
501  return out << "normal";
502 
503  case TextureStage::M_normal_height:
504  return out << "normal_height";
505 
506  case TextureStage::M_glow:
507  return out << "glow";
508 
509  case TextureStage::M_gloss:
510  return out << "gloss";
511 
512  case TextureStage::M_height:
513  return out << "height";
514 
515  case TextureStage::M_selector:
516  return out << "selector";
517 
518  case TextureStage::M_normal_gloss:
519  return out << "normal_gloss";
520  }
521 
522  return out << "**invalid Mode(" << (int)mode << ")**";
523 }
524 
525 ostream &
526 operator << (ostream &out, TextureStage::CombineMode cm) {
527  switch (cm) {
528  case TextureStage::CM_undefined:
529  return out << "undefined";
530 
531  case TextureStage::CM_replace:
532  return out << "replace";
533 
534  case TextureStage::CM_modulate:
535  return out << "modulate";
536 
537  case TextureStage::CM_add:
538  return out << "add";
539 
540  case TextureStage::CM_add_signed:
541  return out << "add_signed";
542 
543  case TextureStage::CM_interpolate:
544  return out << "interpolate";
545 
546  case TextureStage::CM_subtract:
547  return out << "subtract";
548 
549  case TextureStage::CM_dot3_rgb:
550  return out << "dot3_rgb";
551 
552  case TextureStage::CM_dot3_rgba:
553  return out << "dot3_rgba";
554  }
555 
556  return out << "**invalid CombineMode(" << (int)cm << ")**";
557 }
558 
559 ostream &
560 operator << (ostream &out, TextureStage::CombineSource cs) {
561  switch (cs) {
562  case TextureStage::CS_undefined:
563  return out << "undefined";
564 
565  case TextureStage::CS_texture:
566  return out << "texture";
567 
568  case TextureStage::CS_constant:
569  return out << "constant";
570 
571  case TextureStage::CS_primary_color:
572  return out << "primary_color";
573 
574  case TextureStage::CS_previous:
575  return out << "previous";
576 
577  case TextureStage::CS_constant_color_scale:
578  return out << "constant_color_scale";
579 
580  case TextureStage::CS_last_saved_result:
581  return out << "last_saved_result";
582  }
583 
584  return out << "**invalid CombineSource(" << (int)cs << ")**";
585 }
586 
587 ostream &
588 operator << (ostream &out, TextureStage::CombineOperand co) {
589  switch (co) {
590  case TextureStage::CO_undefined:
591  return out << "undefined";
592 
593  case TextureStage::CO_src_color:
594  return out << "src_color";
595 
596  case TextureStage::CO_one_minus_src_color:
597  return out << "one_minus_src_color";
598 
599  case TextureStage::CO_src_alpha:
600  return out << "src_alpha";
601 
602  case TextureStage::CO_one_minus_src_alpha:
603  return out << "one_minus_src_alpha";
604  }
605 
606  return out << "**invalid CombineOperand(" << (int)co << ")**";
607 }
CombineSource get_combine_alpha_source2() const
Get source2 of combine_alpha_mode.
Definition: textureStage.I:583
get_tex_view_offset
Returns the current setting of the tex_view_offset.
Definition: textureStage.h:203
get_name
Returns the name of this texture stage.
Definition: textureStage.h:188
static TypedWritable * make_TextureStage(const FactoryParams &params)
Factory method to generate a TextureStage object.
bool get_bool()
Extracts a boolean value.
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
CombineOperand get_combine_alpha_operand0() const
Get operand0 of combine_alpha_mode.
Definition: textureStage.I:559
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
Definition: bamWriter.I:59
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
int get_num_combine_alpha_operands() const
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and g...
Definition: textureStage.I:543
int32_t get_int32()
Extracts a signed 32-bit integer.
CombineOperand get_combine_rgb_operand1() const
Get operand1 of combine_rgb_mode.
Definition: textureStage.I:437
std::string get_string()
Extracts a variable-length string.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
Definition: bamReader.I:83
CombineSource get_combine_rgb_source1() const
Get source1 of combine_rgb_mode.
Definition: textureStage.I:429
get_rgb_scale
See set_rgb_scale().
Definition: textureStage.h:199
void output(std::ostream &out) const
Just a single line output.
get_mode
Return the mode of this stage.
Definition: textureStage.h:196
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...
void parse_params(const FactoryParams &params, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
Definition: bamReader.I:275
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_bool(bool value)
Adds a boolean value to the datagram.
Definition: datagram.I:34
CombineSource get_combine_alpha_source0() const
Get source0 of combine_alpha_mode.
Definition: textureStage.I:551
CombineSource get_combine_rgb_source2() const
Get source2 of combine_rgb_mode.
Definition: textureStage.I:445
static void register_with_read_factory()
Factory method to generate a TextureStage object.
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().
void write(std::ostream &out) const
Writes the details of this stage.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CombineOperand get_combine_rgb_operand0() const
Get operand0 of combine_rgb_mode.
Definition: textureStage.I:421
void add_string(const std::string &str)
Adds a variable-length string to the datagram.
Definition: datagram.I:219
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
Definition: factory.I:73
int get_num_combine_rgb_operands() const
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get...
Definition: textureStage.I:405
get_saved_result
Returns the current setting of the saved_result flag.
Definition: textureStage.h:201
CombineMode get_combine_alpha_mode() const
Get combine_alpha_mode.
Definition: textureStage.I:534
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_alpha_scale
See set_alpha_scale().
Definition: textureStage.h:200
get_color
return the color for this stage
Definition: textureStage.h:198
CombineOperand get_combine_alpha_operand1() const
Get operand1 of combine_alpha_mode.
Definition: textureStage.I:575
Encodes a string name in a hash table, mapping it to a pointer.
Definition: internalName.h:38
void add_int32(int32_t value)
Adds a signed 32-bit integer to the datagram.
Definition: datagram.I:67
CombineMode get_combine_rgb_mode() const
Get the combine_rgb_mode.
Definition: textureStage.I:396
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
Definition: bamReader.I:177
CombineSource get_combine_rgb_source0() const
Get source0 of combine_rgb_mode.
Definition: textureStage.I:413
void operator=(const TextureStage &copy)
just copy the members of other to this
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
Definition: bamReader.cxx:610
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
get_sort
Returns the sort order of this texture stage.
Definition: textureStage.h:189
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
Definition: datagram.I:50
CombineOperand get_combine_rgb_operand2() const
Get operand2 of combine_rgb_mode.
Definition: textureStage.I:453
CombineSource get_combine_alpha_source1() const
Get source1 of combine_alpha_mode.
Definition: textureStage.I:567
CombineOperand get_combine_alpha_operand2() const
Get operand2 of combine_alpha_mode.
Definition: textureStage.I:591
A class to retrieve the individual data elements previously stored in a Datagram.
get_priority
Returns the priority associated with this stage.
Definition: textureStage.h:190
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This is a sequence number that increments monotonically.
Definition: updateSeq.h:37
Defines the properties of a named stage of the multitexture pipeline.
Definition: textureStage.h:35
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
get_texcoord_name
See set_texcoord_name.
Definition: textureStage.h:192
TextureStage(const std::string &name)
Initialize the texture stage at construction.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
Definition: bamWriter.cxx:317
get_default
Returns the default TextureStage that will be used for all texturing that does not name a particular ...
Definition: textureStage.h:205