Panda3D

shader.h
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 shader.h
10 * @author jyelon
11 * @date 2005-09-01
12 * @author fperazzi, PandaSE
13 * @date 2010-04-29
14 */
15
16 #ifndef SHADER_H
17 #define SHADER_H
18
19 #include "pandabase.h"
20 #include "config_gobj.h"
21 #include "typedWritableReferenceCount.h"
22 #include "namable.h"
23 #include "graphicsStateGuardianBase.h"
24 #include "internalName.h"
25 #include "pta_int.h"
26 #include "pta_float.h"
27 #include "pta_double.h"
28 #include "pta_stdfloat.h"
29 #include "pta_LMatrix4.h"
30 #include "pta_LMatrix3.h"
31 #include "pta_LVecBase4.h"
32 #include "pta_LVecBase3.h"
33 #include "pta_LVecBase2.h"
34 #include "epvector.h"
35 #include "asyncFuture.h"
36 #include "bamCacheRecord.h"
37
38 #ifdef HAVE_CG
39 // I don't want to include the Cg header file into panda as a whole. Instead,
40 // I'll just excerpt some opaque declarations.
41 typedef struct _CGcontext *CGcontext;
42 typedef struct _CGprogram *CGprogram;
43 typedef struct _CGparameter *CGparameter;
44 #endif
45
46 /**
47
48 */
49 class EXPCL_PANDA_GOBJ Shader : public TypedWritableReferenceCount {
50 PUBLISHED:
51 enum ShaderLanguage {
52 SL_none,
53 SL_Cg,
54 SL_GLSL,
55 SL_HLSL,
56 SL_SPIR_V,
57 };
58
59 enum ShaderType {
60 ST_none = 0,
61 ST_vertex,
62 ST_fragment,
63 ST_geometry,
64 ST_tess_control,
65 ST_tess_evaluation,
66 ST_compute,
67 ST_COUNT
68 };
69
70 enum AutoShaderSwitch {
71 AS_normal = 0x01,
72 AS_glow = 0x02,
73 AS_gloss = 0x04,
74 AS_ramp = 0x08,
75 AS_shadow = 0x10,
76 };
77
78 enum AutoShaderBit {
79 bit_AutoShaderNormal = 0, // bit for AS_normal
80 bit_AutoShaderGlow = 1, // bit for AS_glow
81 bit_AutoShaderGloss = 2, // bit for AS_gloss
82 bit_AutoShaderRamp = 3, // bit for AS_ramp
83 bit_AutoShaderShadow = 4, // bit for AS_shadow
84 };
85
86 static PT(Shader) load(const Filename &file, ShaderLanguage lang = SL_none);
87 static PT(Shader) make(std::string body, ShaderLanguage lang = SL_none);
88 static PT(Shader) load(ShaderLanguage lang,
89 const Filename &vertex, const Filename &fragment,
90 const Filename &geometry = "",
91 const Filename &tess_control = "",
92 const Filename &tess_evaluation = "");
93 static PT(Shader) load_compute(ShaderLanguage lang, const Filename &fn);
94 static PT(Shader) make(ShaderLanguage lang,
95 std::string vertex, std::string fragment,
96 std::string geometry = "",
97 std::string tess_control = "",
98 std::string tess_evaluation = "");
99 static PT(Shader) make_compute(ShaderLanguage lang, std::string body);
100
101 INLINE Filename get_filename(ShaderType type = ST_none) const;
102 INLINE void set_filename(ShaderType type, const Filename &filename);
103 INLINE const std::string &get_text(ShaderType type = ST_none) const;
104 INLINE bool get_error_flag() const;
105 INLINE ShaderLanguage get_language() const;
106
107 INLINE bool has_fullpath() const;
108 INLINE const Filename &get_fullpath() const;
109
110 INLINE bool get_cache_compiled_shader() const;
111 INLINE void set_cache_compiled_shader(bool flag);
112
113 PT(AsyncFuture) prepare(PreparedGraphicsObjects *prepared_objects);
114 bool is_prepared(PreparedGraphicsObjects *prepared_objects) const;
115 bool release(PreparedGraphicsObjects *prepared_objects);
116 int release_all();
117
118 ShaderContext *prepare_now(PreparedGraphicsObjects *prepared_objects,
119 GraphicsStateGuardianBase *gsg);
120
121 public:
122 enum ShaderMatInput {
123 SMO_identity,
124
125 SMO_window_size,
126 SMO_pixel_size,
127 SMO_texpad_x,
128 SMO_texpix_x,
129
130 SMO_attr_material,
131 SMO_attr_color,
132 SMO_attr_colorscale,
133
134 SMO_alight_x,
135 SMO_dlight_x,
136 SMO_plight_x,
137 SMO_slight_x,
138 SMO_satten_x,
139 SMO_texmat_i,
140 SMO_plane_x,
141 SMO_clipplane_x,
142
143 SMO_mat_constant_x,
144 SMO_vec_constant_x,
145
146 SMO_world_to_view,
147 SMO_view_to_world,
148
149 SMO_model_to_view,
150 SMO_view_to_model,
151
152 SMO_apiview_to_view,
153 SMO_view_to_apiview,
154
155 SMO_clip_to_view,
156 SMO_view_to_clip,
157
158 SMO_apiclip_to_view,
159 SMO_view_to_apiclip,
160
161 SMO_view_x_to_view,
162 SMO_view_to_view_x,
163
164 SMO_apiview_x_to_view,
165 SMO_view_to_apiview_x,
166
167 SMO_clip_x_to_view,
168 SMO_view_to_clip_x,
169
170 SMO_apiclip_x_to_view,
171 SMO_view_to_apiclip_x,
172
173 SMO_attr_fog,
174 SMO_attr_fogcolor,
175
176 SMO_frame_number,
177 SMO_frame_time,
178 SMO_frame_delta,
179
180 SMO_mat_constant_x_attrib,
181 SMO_vec_constant_x_attrib,
182
183 SMO_light_ambient,
184 SMO_light_source_i_attrib,
185
186 SMO_light_product_i_ambient,
187 SMO_light_product_i_diffuse,
188 SMO_light_product_i_specular,
189
190 // SMO_clipplane_x is world coords, GLSL needs eye coords
191 SMO_apiview_clipplane_i,
192
193 SMO_model_to_apiview,
194 SMO_apiview_to_model,
195 SMO_apiview_to_apiclip,
196 SMO_apiclip_to_apiview,
197
198 SMO_inv_texmat_i,
199
200 // Additional properties for PBR materials
201 SMO_attr_material2,
202
203 // Hack for text rendering. Don't use in user shaders.
204 SMO_tex_is_alpha_i,
205
206 SMO_transform_i,
207 SMO_slider_i,
208
209 SMO_light_source_i_packed,
210
211 // Texture scale component of texture matrix.
212 SMO_texscale_i,
213
214 // Color of an M_blend texture stage.
215 SMO_texcolor_i,
216
217 SMO_INVALID
218 };
219
220 enum ShaderTexInput {
221 STO_INVALID,
222
223 STO_named_input,
224 STO_named_stage,
225
226 STO_stage_i,
227 STO_light_i_shadow_map,
228
229 STO_ff_stage_i,
230 STO_stage_modulate_i,
231 STO_stage_add_i,
232 STO_stage_normal_i,
233 STO_stage_height_i,
234 STO_stage_selector_i,
235 STO_stage_gloss_i,
236 STO_stage_emission_i,
237 };
238
239 enum ShaderArgClass {
240 SAC_scalar,
241 SAC_vector,
242 SAC_matrix,
243 SAC_sampler,
244 SAC_array,
245 SAC_unknown,
246 };
247
248 enum ShaderArgType {
249 SAT_scalar,
250 SAT_vec1,
251 SAT_vec2,
252 SAT_vec3,
253 SAT_vec4,
254 SAT_mat1x1,
255 SAT_mat1x2,
256 SAT_mat1x3,
257 SAT_mat1x4,
258 SAT_mat2x1,
259 SAT_mat2x2,
260 SAT_mat2x3,
261 SAT_mat2x4,
262 SAT_mat3x1,
263 SAT_mat3x2,
264 SAT_mat3x3,
265 SAT_mat3x4,
266 SAT_mat4x1,
267 SAT_mat4x2,
268 SAT_mat4x3,
269 SAT_mat4x4,
270 SAT_sampler1d,
271 SAT_sampler2d,
272 SAT_sampler3d,
273 SAT_sampler2d_array,
274 SAT_sampler_cube,
275 SAT_sampler_buffer,
276 SAT_sampler_cube_array,
277 SAT_unknown
278 };
279
280 enum ShaderArgDir {
281 SAD_in,
282 SAD_out,
283 SAD_inout,
284 SAD_unknown,
285 };
286
287 enum ShaderMatPiece {
288 SMP_whole,
289 SMP_transpose,
290 SMP_row0,
291 SMP_row1,
292 SMP_row2,
293 SMP_row3,
294 SMP_col0,
295 SMP_col1,
296 SMP_col2,
297 SMP_col3,
298 SMP_row3x1,
299 SMP_row3x2,
300 SMP_row3x3,
301 SMP_upper3x3,
302 SMP_transpose3x3,
303 SMP_cell15,
304 SMP_cell14,
305 SMP_cell13,
306 };
307
308 enum ShaderStateDep {
309 SSD_NONE = 0x000,
310 SSD_general = 0x001,
311 SSD_transform = 0x2002,
312 SSD_color = 0x004,
313 SSD_colorscale = 0x008,
314 SSD_material = 0x010,
315 SSD_shaderinputs = 0x020,
316 SSD_fog = 0x040,
317 SSD_light = 0x080,
318 SSD_clip_planes = 0x100,
319 SSD_tex_matrix = 0x200,
320 SSD_frame = 0x400,
321 SSD_projection = 0x800,
322 SSD_texture = 0x1000,
323 SSD_view_transform= 0x2000,
324 };
325
326 enum ShaderBug {
327 SBUG_ati_draw_buffers,
328 };
329
330 enum ShaderMatFunc {
331 SMF_compose,
332 SMF_transform_dlight,
333 SMF_transform_plight,
334 SMF_transform_slight,
335 SMF_first,
336 };
337
338 struct ShaderArgId {
339 std::string _name;
340 ShaderType _type;
341 int _seqno;
342 };
343
344 enum ShaderPtrType {
345 SPT_float,
346 SPT_double,
347 SPT_int,
348 SPT_uint,
349 SPT_unknown
350 };
351
352 struct ShaderArgInfo {
353 ShaderArgId _id;
354 ShaderArgClass _class;
355 ShaderArgClass _subclass;
356 ShaderArgType _type;
357 ShaderArgDir _direction;
358 bool _varying;
359 ShaderPtrType _numeric_type;
360 NotifyCategory *_cat;
361 };
362
363 // Container structure for data of parameters ShaderPtrSpec.
364 struct ShaderPtrData {
365 private:
366 PT(ReferenceCount) _pta;
367
368 public:
369 void *_ptr;
370 ShaderPtrType _type;
371 bool _updated;
372 size_t _size; //number of elements vec3[4]=12
373
374 public:
375 INLINE ShaderPtrData();
376 INLINE ShaderPtrData(const PTA_float &ptr);
377 INLINE ShaderPtrData(const PTA_LVecBase4f &ptr);
378 INLINE ShaderPtrData(const PTA_LVecBase3f &ptr);
379 INLINE ShaderPtrData(const PTA_LVecBase2f &ptr);
380 INLINE ShaderPtrData(const PTA_LMatrix4f &mat);
381 INLINE ShaderPtrData(const PTA_LMatrix3f &mat);
382 INLINE ShaderPtrData(const LVecBase4f &vec);
383 INLINE ShaderPtrData(const LVecBase3f &vec);
384 INLINE ShaderPtrData(const LVecBase2f &vec);
385 INLINE ShaderPtrData(const LMatrix4f &mat);
386 INLINE ShaderPtrData(const LMatrix3f &mat);
387
388 INLINE ShaderPtrData(const PTA_double &ptr);
389 INLINE ShaderPtrData(const PTA_LVecBase4d &ptr);
390 INLINE ShaderPtrData(const PTA_LVecBase3d &ptr);
391 INLINE ShaderPtrData(const PTA_LVecBase2d &ptr);
392 INLINE ShaderPtrData(const PTA_LMatrix4d &mat);
393 INLINE ShaderPtrData(const PTA_LMatrix3d &mat);
394 INLINE ShaderPtrData(const LVecBase4d &vec);
395 INLINE ShaderPtrData(const LVecBase3d &vec);
396 INLINE ShaderPtrData(const LVecBase2d &vec);
397 INLINE ShaderPtrData(const LMatrix4d &mat);
398 INLINE ShaderPtrData(const LMatrix3d &mat);
399
400 INLINE ShaderPtrData(const PTA_int &ptr);
401 INLINE ShaderPtrData(const PTA_LVecBase4i &ptr);
402 INLINE ShaderPtrData(const PTA_LVecBase3i &ptr);
403 INLINE ShaderPtrData(const PTA_LVecBase2i &ptr);
404 INLINE ShaderPtrData(const LVecBase4i &vec);
405 INLINE ShaderPtrData(const LVecBase3i &vec);
406 INLINE ShaderPtrData(const LVecBase2i &vec);
407
408 INLINE void write_datagram(Datagram &dg) const;
409 INLINE void read_datagram(DatagramIterator &source);
410 };
411
412 struct ShaderMatSpec {
413 LMatrix4 _cache[2];
414 LMatrix4 _value;
415 ShaderArgId _id;
416 ShaderMatFunc _func;
417 ShaderMatInput _part[2];
418 PT(InternalName) _arg[2];
419 int _dep[2];
420 int _index;
421 ShaderMatPiece _piece;
422 };
423
424 struct ShaderTexSpec {
425 ShaderArgId _id;
426 PT(InternalName) _name;
427 ShaderTexInput _part;
428 int _stage;
429 int _desired_type;
430 PT(InternalName) _suffix;
431 };
432
433 struct ShaderVarSpec {
434 ShaderArgId _id;
435 PT(InternalName) _name;
436 int _append_uv;
437 int _elements;
438 ShaderPtrType _numeric_type;
439 };
440
441 struct ShaderPtrSpec {
442 ShaderArgId _id;
443 int _dim[3]; //n_elements,rows,cols
444 int _dep[2];
445 PT(InternalName) _arg;
446 ShaderArgInfo _info;
447 ShaderPtrType _type;
448 };
449
450 class EXPCL_PANDA_GOBJ ShaderCaps {
451 public:
452 void clear();
453 INLINE bool operator == (const ShaderCaps &other) const;
454 INLINE ShaderCaps();
455
456 public:
457 bool _supports_glsl;
458
459 #ifdef HAVE_CG
460 int _active_vprofile;
461 int _active_fprofile;
462 int _active_gprofile;
463 int _active_tprofile;
464
465 int _ultimate_vprofile;
466 int _ultimate_fprofile;
467 int _ultimate_gprofile;
468 int _ultimate_tprofile;
469
470 pset <ShaderBug> _bug_list;
471 #endif
472 };
473
474 class ShaderFile : public ReferenceCount {
475 public:
476 INLINE ShaderFile() {};
477 INLINE ShaderFile(std::string shared);
478 INLINE ShaderFile(std::string vertex, std::string fragment, std::string geometry,
479 std::string tess_control, std::string tess_evaluation);
480
481 INLINE void write_datagram(Datagram &dg) const;
482 INLINE void read_datagram(DatagramIterator &source);
483
484 INLINE bool operator < (const ShaderFile &other) const;
485
486 public:
487 bool _separate;
488 std::string _shared;
489 std::string _vertex;
490 std::string _fragment;
491 std::string _geometry;
492 std::string _tess_control;
493 std::string _tess_evaluation;
494 std::string _compute;
495 };
496
497 public:
498 // These routines help split the shader into sections, for those shader
499 // implementations that need to do so. Don't use them when you use separate
500 // shader programs.
501 void parse_init();
502 void parse_line(std::string &result, bool rt, bool lt);
503 void parse_upto(std::string &result, std::string pattern, bool include);
504 void parse_rest(std::string &result);
505 bool parse_eof();
506
507 void cp_report_error(ShaderArgInfo &arg, const std::string &msg);
508 bool cp_errchk_parameter_words(ShaderArgInfo &arg, int len);
509 bool cp_errchk_parameter_in(ShaderArgInfo &arg);
510 bool cp_errchk_parameter_ptr(ShaderArgInfo &p);
511 bool cp_errchk_parameter_varying(ShaderArgInfo &arg);
512 bool cp_errchk_parameter_uniform(ShaderArgInfo &arg);
513 bool cp_errchk_parameter_float(ShaderArgInfo &arg, int lo, int hi);
514 bool cp_errchk_parameter_sampler(ShaderArgInfo &arg);
515 bool cp_parse_eol(ShaderArgInfo &arg,
516 vector_string &pieces, int &next);
517 bool cp_parse_delimiter(ShaderArgInfo &arg,
518 vector_string &pieces, int &next);
519 std::string cp_parse_non_delimiter(vector_string &pieces, int &next);
520 bool cp_parse_coord_sys(ShaderArgInfo &arg,
521 vector_string &pieces, int &next,
522 ShaderMatSpec &spec, bool fromflag);
523 int cp_dependency(ShaderMatInput inp);
524 void cp_optimize_mat_spec(ShaderMatSpec &spec);
525
526 #ifdef HAVE_CG
527 void cg_recurse_parameters(CGparameter parameter,
528 const ShaderType &type,
529 bool &success);
530 #endif
531
532 bool compile_parameter(ShaderArgInfo &p, int *arg_dim);
533
534 void clear_parameters();
535
536 void set_compiled(unsigned int format, const char *data, size_t length);
537 bool get_compiled(unsigned int &format, std::string &binary) const;
538
539 static void set_default_caps(const ShaderCaps &caps);
540
541 private:
542 #ifdef HAVE_CG
543 ShaderArgClass cg_parameter_class(CGparameter p);
544 ShaderArgType cg_parameter_type(CGparameter p);
545 ShaderArgDir cg_parameter_dir(CGparameter p);
546
547 CGprogram cg_compile_entry_point(const char *entry, const ShaderCaps &caps,
548 CGcontext context, ShaderType type);
549
550 bool cg_analyze_entry_point(CGprogram prog, ShaderType type);
551
552 bool cg_analyze_shader(const ShaderCaps &caps);
553 bool cg_compile_shader(const ShaderCaps &caps, CGcontext context);
554 void cg_release_resources();
555 void cg_report_errors();
556
557 // Determines the appropriate cg profile settings and stores them in the
558 // active shader caps based on any profile settings stored in the shader's
559 // header
560 void cg_get_profile_from_header(ShaderCaps &caps);
561
562 ShaderCaps _cg_last_caps;
563 static CGcontext _cg_context;
564 CGprogram _cg_vprogram;
565 CGprogram _cg_fprogram;
566 CGprogram _cg_gprogram;
567
568 int _cg_vprofile;
569 int _cg_fprofile;
570 int _cg_gprofile;
571
572 CGprogram cg_program_from_shadertype(ShaderType type);
573
574 public:
575 bool cg_compile_for(const ShaderCaps &caps, CGcontext context,
576 CGprogram &combined_program, pvector<CGparameter> &map);
577
578 #endif
579
580 public:
581 pvector<ShaderPtrSpec> _ptr_spec;
582 epvector<ShaderMatSpec> _mat_spec;
583 pvector<ShaderTexSpec> _tex_spec;
584 pvector<ShaderVarSpec> _var_spec;
585 int _mat_deps;
586
587 bool _error_flag;
588 ShaderFile _text;
589
590 protected:
591 ShaderFile _filename;
592 Filename _fullpath;
593 int _parse;
594 bool _loaded;
595 ShaderLanguage _language;
596
597 typedef pvector<Filename> Filenames;
598 Filenames _included_files;
599
600 // Stores full paths, and includes the fullpaths of the shaders themselves
601 // as well as the includes.
602 Filenames _source_files;
603 time_t _last_modified;
604
605 PT(BamCacheRecord) _record;
606 bool _cache_compiled_shader;
607 unsigned int _compiled_format;
608 std::string _compiled_binary;
609
610 static ShaderCaps _default_caps;
611 static int _shaders_generated;
612
613 typedef pmap<ShaderFile, PT(Shader)> ShaderTable;
614
615 static ShaderTable _load_table;
616 static ShaderTable _make_table;
617
618 friend class ShaderContext;
619 friend class PreparedGraphicsObjects;
620
621 typedef pmap <PreparedGraphicsObjects *, ShaderContext *> Contexts;
622 Contexts _contexts;
623
624 private:
625 void clear_prepared(PreparedGraphicsObjects *prepared_objects);
626
627 Shader(ShaderLanguage lang);
628
629 bool read(const ShaderFile &sfile, BamCacheRecord *record = nullptr);
630 bool load(const ShaderFile &sbody, BamCacheRecord *record = nullptr);
631 bool do_read_source(std::string &into, const Filename &fn, BamCacheRecord *record);
632 bool do_load_source(std::string &into, const std::string &source, BamCacheRecord *record);
633 bool r_preprocess_include(std::ostream &out, const Filename &fn,
634 const Filename &source_dir,
635 std::set<Filename> &open_files,
636 BamCacheRecord *record, int depth);
637 bool r_preprocess_source(std::ostream &out, std::istream &in,
638 const Filename &fn, const Filename &full_fn,
639 std::set<Filename> &open_files,
640 BamCacheRecord *record,
641 int fileno = 0, int depth = 0);
642
643 bool check_modified() const;
644
645 public:
646 ~Shader();
647
648 Filename get_filename_from_index(int index, ShaderType type) const;
649
650 public:
651 static void register_with_read_factory();
652 virtual void write_datagram(BamWriter *manager, Datagram &dg);
653
654 protected:
655 static TypedWritable *make_from_bam(const FactoryParams &params);
656 void fillin(DatagramIterator &scan, BamReader *manager);
657
658 public:
659 static TypeHandle get_class_type() {
660 return _type_handle;
661 }
662 static void init_type() {
663 TypedWritableReferenceCount::init_type();
664 register_type(_type_handle, "Shader",
665 TypedWritableReferenceCount::get_class_type());
666 }
667 virtual TypeHandle get_type() const {
668 return get_class_type();
669 }
670 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
671
672 private:
673 static TypeHandle _type_handle;
674 };
675
676 #include "shader.I"
677
678 #endif
asyncFuture.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bamCacheRecord.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AsyncFuture
This class represents a thread-safe handle to a promised future result of an asynchronous operation,...
Definition: asyncFuture.h:61
BamCacheRecord
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
Definition: bamCacheRecord.h:36
BamReader
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
BamWriter
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
DatagramIterator
A class to retrieve the individual data elements previously stored in a Datagram.
Definition: datagramIterator.h:27
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
Filename
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
GraphicsStateGuardianBase
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Definition: graphicsStateGuardianBase.h:110
InternalName
Encodes a string name in a hash table, mapping it to a pointer.
Definition: internalName.h:38
NotifyCategory
A particular category of error messages.
Definition: notifyCategory.h:32
PreparedGraphicsObjects
A table of objects that are saved within the graphics context for reference by handle later.
Definition: preparedGraphicsObjects.h:58
ReferenceCount
A base class for all things that want to be reference-counted.
Definition: referenceCount.h:38
ShaderContext
The ShaderContext is meant to contain the compiled version of a shader string.
Definition: shaderContext.h:31
Shader::ShaderCaps
Definition: shader.h:450
Shader::ShaderFile
Definition: shader.h:474
Shader
Definition: shader.h:49
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
TypedWritableReferenceCount
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
Definition: typedWritableReferenceCount.h:31
TypedWritable
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
TypedWritable::fillin
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...
Definition: typedWritable.cxx:103
TypedWritable::write_datagram
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition: typedWritable.cxx:54
pmap
This is our own Panda specialization on the default STL map.
Definition: pmap.h:49
pset
This is our own Panda specialization on the default STL set.
Definition: pset.h:49
pvector
This is our own Panda specialization on the default STL vector.
Definition: pvector.h:42
config_gobj.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
epvector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
graphicsStateGuardianBase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
internalName.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
namable.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LMatrix3.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LMatrix4.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LVecBase2.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LVecBase3.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LVecBase4.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_double.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_float.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_int.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_stdfloat.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
shader.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Shader::ShaderArgId
Definition: shader.h:338
Shader::ShaderArgInfo
Definition: shader.h:352
Shader::ShaderMatSpec
Definition: shader.h:412
Shader::ShaderPtrData
Definition: shader.h:364
Shader::ShaderPtrSpec
Definition: shader.h:441
Shader::ShaderTexSpec
Definition: shader.h:424
Shader::ShaderVarSpec
Definition: shader.h:433
typedWritableReferenceCount.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.