Panda3D
Loading...
Searching...
No Matches
eggTexture.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 eggTexture.h
10 * @author drose
11 * @date 1999-01-18
12 */
13
14#ifndef EGGTEXTURE_H
15#define EGGTEXTURE_H
16
17#include "pandabase.h"
18
19#include "eggRenderMode.h"
20#include "eggFilenameNode.h"
21#include "eggTransform.h"
22
23#include "pset.h"
24#include "luse.h"
25
26
27/**
28 * Defines a texture map that may be applied to geometry.
29 */
30class EXPCL_PANDA_EGG EggTexture : public EggFilenameNode, public EggRenderMode, public EggTransform {
31PUBLISHED:
32 explicit EggTexture(const std::string &tref_name, const Filename &filename);
33 EggTexture(const EggTexture &copy);
34 EggTexture &operator = (const EggTexture &copy);
35 virtual ~EggTexture();
36
37 virtual void write(std::ostream &out, int indent_level) const;
38
39 enum Equivalence {
40 E_basename = 0x001,
41 E_extension = 0x002,
42 E_dirname = 0x004,
43 E_complete_filename = 0x007,
44 E_transform = 0x008,
45 E_attributes = 0x010,
46 E_tref_name = 0x020,
47 };
48
49 bool is_equivalent_to(const EggTexture &other, int eq) const;
50 bool sorts_less_than(const EggTexture &other, int eq) const;
51
52 bool has_alpha_channel(int num_components) const;
53
54 enum TextureType {
55 TT_unspecified, TT_1d_texture,
56 TT_2d_texture, TT_3d_texture, TT_cube_map
57 };
58 enum Format {
59 F_unspecified,
60 F_rgba, F_rgbm, F_rgba12, F_rgba8, F_rgba4, F_rgba5,
61 F_rgb, F_rgb12, F_rgb8, F_rgb5, F_rgb332,
62 F_red, F_green, F_blue, F_alpha, F_luminance,
63 F_luminance_alpha, F_luminance_alphamask,
64
65 // Only for compatibility with .bam, use is discouraged!
66 F_srgb, F_srgb_alpha
67 };
68 enum CompressionMode {
69 CM_default, CM_off, CM_on,
70 CM_fxt1, CM_dxt1, CM_dxt2, CM_dxt3, CM_dxt4, CM_dxt5,
71 };
72 enum WrapMode {
73 WM_unspecified, WM_clamp, WM_repeat,
74 WM_mirror, WM_mirror_once, WM_border_color
75 };
76 enum FilterType {
77 // Note that these type values match up, name-for-name, with a similar
78 // enumerated type in Panda's Texture object. However, they do *not*
79 // match up numerically. You must convert between them using a switch
80 // statement.
81 FT_unspecified,
82
83 // Mag Filter and Min Filter
84 FT_nearest,
85 FT_linear,
86
87 // Min Filter Only
88 FT_nearest_mipmap_nearest, // "mipmap point"
89 FT_linear_mipmap_nearest, // "mipmap linear"
90 FT_nearest_mipmap_linear, // "mipmap bilinear"
91 FT_linear_mipmap_linear, // "mipmap trilinear"
92 };
93 enum EnvType {
94 ET_unspecified,
95 ET_modulate,
96 ET_decal,
97 ET_blend,
98 ET_replace,
99 ET_add,
100 ET_blend_color_scale,
101 ET_modulate_glow,
102 ET_modulate_gloss,
103 ET_normal,
104 ET_normal_height,
105 ET_glow,
106 ET_gloss,
107 ET_height,
108 ET_selector,
109 ET_normal_gloss,
110 ET_emission,
111
112 // Forward compatibility with Panda 1.11
113 ET___occlusion,
114 ET___occlusion_metallic_roughness,
115 ET___metallic_roughness,
116 };
117 enum CombineMode {
118 CM_unspecified,
119 CM_replace,
120 CM_modulate,
121 CM_add,
122 CM_add_signed,
123 CM_interpolate,
124 CM_subtract,
125 CM_dot3_rgb,
126 CM_dot3_rgba,
127 };
128 enum CombineChannel {
129 CC_rgb = 0,
130 CC_alpha = 1,
131 CC_num_channels = 2,
132 };
133 enum CombineIndex {
134 CI_num_indices = 3
135 };
136 enum CombineSource {
137 CS_unspecified,
138 CS_texture,
139 CS_constant,
140 CS_primary_color,
141 CS_previous,
142 CS_constant_color_scale,
143 CS_last_saved_result,
144 };
145 enum CombineOperand {
146 CO_unspecified,
147 CO_src_color,
148 CO_one_minus_src_color,
149 CO_src_alpha,
150 CO_one_minus_src_alpha,
151 };
152 enum TexGen {
153 TG_unspecified,
154
155 TG_eye_sphere_map,
156
157 TG_world_cube_map,
158 TG_eye_cube_map,
159
160 TG_world_normal,
161 TG_eye_normal,
162
163 TG_world_position,
164 TG_eye_position,
165
166 TG_point_sprite,
167 };
168 enum QualityLevel {
169 QL_unspecified,
170 QL_default,
171 QL_fastest,
172 QL_normal,
173 QL_best,
174 };
175
176 INLINE void set_texture_type(TextureType texture_type);
177 INLINE TextureType get_texture_type() const;
178
179 INLINE void set_format(Format format);
180 INLINE Format get_format() const;
181
182 INLINE void set_compression_mode(CompressionMode mode);
183 INLINE CompressionMode get_compression_mode() const;
184
185 INLINE void set_wrap_mode(WrapMode mode);
186 INLINE WrapMode get_wrap_mode() const;
187
188 INLINE void set_wrap_u(WrapMode mode);
189 INLINE WrapMode get_wrap_u() const;
190 INLINE WrapMode determine_wrap_u() const;
191
192 INLINE void set_wrap_v(WrapMode mode);
193 INLINE WrapMode get_wrap_v() const;
194 INLINE WrapMode determine_wrap_v() const;
195
196 INLINE void set_wrap_w(WrapMode mode);
197 INLINE WrapMode get_wrap_w() const;
198 INLINE WrapMode determine_wrap_w() const;
199
200 INLINE void set_minfilter(FilterType type);
201 INLINE FilterType get_minfilter() const;
202
203 INLINE void set_magfilter(FilterType type);
204 INLINE FilterType get_magfilter() const;
205
206 INLINE void set_anisotropic_degree(int anisotropic_degree);
207 INLINE void clear_anisotropic_degree();
208 INLINE bool has_anisotropic_degree() const;
209 INLINE int get_anisotropic_degree() const;
210
211 INLINE void set_env_type(EnvType type);
212 INLINE EnvType get_env_type() const;
213 bool affects_polygon_alpha() const;
214
215 INLINE void set_combine_mode(CombineChannel channel, CombineMode cm);
216 INLINE CombineMode get_combine_mode(CombineChannel channel) const;
217 INLINE void set_combine_source(CombineChannel channel, int n, CombineSource cs);
218 INLINE CombineSource get_combine_source(CombineChannel channel, int n) const;
219 INLINE void set_combine_operand(CombineChannel channel, int n, CombineOperand co);
220 INLINE CombineOperand get_combine_operand(CombineChannel channel, int n) const;
221
222 INLINE void set_saved_result(bool saved_result);
223 INLINE bool get_saved_result() const;
224
225 INLINE void set_tex_gen(TexGen tex_gen);
226 INLINE TexGen get_tex_gen() const;
227
228 INLINE void set_quality_level(QualityLevel quality_level);
229 INLINE QualityLevel get_quality_level() const;
230
231 INLINE void set_stage_name(const std::string &stage_name);
232 INLINE void clear_stage_name();
233 INLINE bool has_stage_name() const;
234 INLINE const std::string &get_stage_name() const;
235
236 INLINE void set_priority(int priority);
237 INLINE void clear_priority();
238 INLINE bool has_priority() const;
239 INLINE int get_priority() const;
240
241 INLINE void set_color(const LColor &color);
242 INLINE void clear_color();
243 INLINE bool has_color() const;
244 INLINE const LColor &get_color() const;
245
246 INLINE void set_border_color(const LColor &border_color);
247 INLINE void clear_border_color();
248 INLINE bool has_border_color() const;
249 INLINE const LColor &get_border_color() const;
250
251 INLINE void set_uv_name(const std::string &uv_name);
252 INLINE void clear_uv_name();
253 INLINE bool has_uv_name() const;
254 INLINE const std::string &get_uv_name() const;
255
256 INLINE void set_rgb_scale(int rgb_scale);
257 INLINE void clear_rgb_scale();
258 INLINE bool has_rgb_scale() const;
259 INLINE int get_rgb_scale() const;
260
261 INLINE void set_alpha_scale(int alpha_scale);
262 INLINE void clear_alpha_scale();
263 INLINE bool has_alpha_scale() const;
264 INLINE int get_alpha_scale() const;
265
266 INLINE void set_alpha_filename(const Filename &filename);
267 INLINE void clear_alpha_filename();
268 INLINE bool has_alpha_filename() const;
269 INLINE const Filename &get_alpha_filename() const;
270
271 INLINE void set_alpha_fullpath(const Filename &fullpath);
272 INLINE const Filename &get_alpha_fullpath() const;
273
274 INLINE void set_alpha_file_channel(int alpha_file_channel);
275 INLINE void clear_alpha_file_channel();
276 INLINE bool has_alpha_file_channel() const;
277 INLINE int get_alpha_file_channel() const;
278
279 INLINE void set_multiview(bool multiview);
280 INLINE bool get_multiview() const;
281
282 INLINE void set_num_views(int num_views);
283 INLINE void clear_num_views();
284 INLINE bool has_num_views() const;
285 INLINE int get_num_views() const;
286
287 INLINE void set_read_mipmaps(bool read_mipmaps);
288 INLINE bool get_read_mipmaps() const;
289
290 INLINE void set_min_lod(double min_lod);
291 INLINE void clear_min_lod();
292 INLINE bool has_min_lod() const;
293 INLINE double get_min_lod() const;
294
295 INLINE void set_max_lod(double max_lod);
296 INLINE void clear_max_lod();
297 INLINE bool has_max_lod() const;
298 INLINE double get_max_lod() const;
299
300 INLINE void set_lod_bias(double lod_bias);
301 INLINE void clear_lod_bias();
302 INLINE bool has_lod_bias() const;
303 INLINE double get_lod_bias() const;
304
305 void clear_multitexture();
306 bool multitexture_over(EggTexture *other);
307 INLINE int get_multitexture_sort() const;
308
309 static TextureType string_texture_type(const std::string &string);
310 static Format string_format(const std::string &string);
311 static CompressionMode string_compression_mode(const std::string &string);
312 static WrapMode string_wrap_mode(const std::string &string);
313 static FilterType string_filter_type(const std::string &string);
314 static EnvType string_env_type(const std::string &string);
315 static CombineMode string_combine_mode(const std::string &string);
316 static CombineSource string_combine_source(const std::string &string);
317 static CombineOperand string_combine_operand(const std::string &string);
318 static TexGen string_tex_gen(const std::string &string);
319 static QualityLevel string_quality_level(const std::string &string);
320
321PUBLISHED:
322 MAKE_PROPERTY(texture_type, get_texture_type, set_texture_type);
323 MAKE_PROPERTY(format, get_format, set_format);
324 MAKE_PROPERTY(compression_mode, get_compression_mode, set_compression_mode);
325 MAKE_PROPERTY(wrap_mode, get_wrap_mode, set_wrap_mode);
326 MAKE_PROPERTY(wrap_u, get_wrap_u, set_wrap_u);
327 MAKE_PROPERTY(wrap_v, get_wrap_v, set_wrap_v);
328 MAKE_PROPERTY(wrap_w, get_wrap_w, set_wrap_w);
329 MAKE_PROPERTY(minfilter, get_minfilter, set_minfilter);
330 MAKE_PROPERTY(magfilter, get_magfilter, set_magfilter);
331 MAKE_PROPERTY2(anisotropic_degree, has_anisotropic_degree, get_anisotropic_degree,
333 MAKE_PROPERTY(env_type, get_env_type, set_env_type);
334 MAKE_PROPERTY(saved_result, get_saved_result, set_saved_result);
335 MAKE_PROPERTY(tex_gen, get_tex_gen, set_tex_gen);
336 MAKE_PROPERTY(quality_level, get_quality_level, set_quality_level);
337 MAKE_PROPERTY2(stage_name, has_stage_name, get_stage_name,
339 MAKE_PROPERTY2(priority, has_priority, get_priority,
341 MAKE_PROPERTY2(color, has_color, get_color,
342 set_color, clear_color);
343 MAKE_PROPERTY2(border_color, has_border_color, get_border_color,
344 set_border_color, clear_border_color);
345 MAKE_PROPERTY2(uv_name, has_uv_name, get_uv_name,
347 MAKE_PROPERTY2(rgb_scale, has_rgb_scale, get_rgb_scale,
349 MAKE_PROPERTY2(alpha_scale, has_alpha_scale, get_alpha_scale,
351 MAKE_PROPERTY2(alpha_filename, has_alpha_filename, get_alpha_filename,
352 set_alpha_filename, clear_alpha_filename);
353 MAKE_PROPERTY(alpha_fullpath, get_alpha_fullpath, set_alpha_fullpath);
354 MAKE_PROPERTY2(alpha_file_channel, has_alpha_file_channel, get_alpha_file_channel,
356 MAKE_PROPERTY(multiview, get_multiview, set_multiview);
357 MAKE_PROPERTY2(num_views, has_num_views, get_num_views,
359 MAKE_PROPERTY(read_mipmaps, get_read_mipmaps, set_read_mipmaps);
360 MAKE_PROPERTY2(min_lod, has_min_lod, get_min_lod,
362 MAKE_PROPERTY2(max_lod, has_max_lod, get_max_lod,
364 MAKE_PROPERTY2(lod_bias, has_lod_bias, get_lod_bias,
366
367 MAKE_PROPERTY(multitexture_sort, get_multitexture_sort);
368
369public:
370 virtual EggTransform *as_transform();
371
372protected:
373 virtual bool egg_start_parse_body();
374
375private:
376 typedef pset<EggTexture *> MultiTextures;
377 bool r_min_multitexture_sort(int sort, MultiTextures &cycle_detector);
378
379 enum Flags {
380 F_has_alpha_filename = 0x0002,
381 F_has_anisotropic_degree = 0x0004,
382 F_has_alpha_file_channel = 0x0008,
383 F_has_stage_name = 0x0010,
384 F_has_uv_name = 0x0020,
385 F_has_priority = 0x0040,
386 F_has_color = 0x0080,
387 F_has_rgb_scale = 0x0100,
388 F_has_alpha_scale = 0x0200,
389 F_has_border_color = 0x0400,
390 F_has_num_views = 0x0800,
391 F_has_min_lod = 0x1000,
392 F_has_max_lod = 0x2000,
393 F_has_lod_bias = 0x4000,
394 };
395
396 TextureType _texture_type;
397 Format _format;
398 CompressionMode _compression_mode;
399 WrapMode _wrap_mode, _wrap_u, _wrap_v, _wrap_w;
400 FilterType _minfilter, _magfilter;
401 int _anisotropic_degree;
402 EnvType _env_type;
403 bool _saved_result;
404 bool _multiview;
405 int _num_views;
406 TexGen _tex_gen;
407 QualityLevel _quality_level;
408 std::string _stage_name;
409 int _priority;
410 LColor _color;
411 LColor _border_color;
412 std::string _uv_name;
413 int _rgb_scale;
414 int _alpha_scale;
415 int _flags;
416 Filename _alpha_filename;
417 Filename _alpha_fullpath;
418 int _alpha_file_channel;
419 bool _read_mipmaps;
420 int _multitexture_sort;
421 double _min_lod;
422 double _max_lod;
423 double _lod_bias;
424
425 class SourceAndOperand {
426 public:
427 INLINE SourceAndOperand();
428 CombineSource _source;
429 CombineOperand _operand;
430 };
431
432 class Combiner {
433 public:
434 INLINE Combiner();
435 CombineMode _mode;
436 SourceAndOperand _ops[CI_num_indices];
437 };
438
439 Combiner _combiner[CC_num_channels];
440
441 // This is the set of all of the textures that are multitextured on top of
442 // (and under) this one. This is filled in by multitexture_over().
443 MultiTextures _over_textures, _under_textures;
444
445public:
446 static TypeHandle get_class_type() {
447 return _type_handle;
448 }
449 static void init_type() {
450 EggFilenameNode::init_type();
451 EggRenderMode::init_type();
452 register_type(_type_handle, "EggTexture",
453 EggFilenameNode::get_class_type(),
454 EggRenderMode::get_class_type());
455 }
456 virtual TypeHandle get_type() const {
457 return get_class_type();
458 }
459 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
460
461private:
462 static TypeHandle _type_handle;
463};
464
465/**
466 * An STL function object for sorting textures into order by properties.
467 * Returns true if the two referenced EggTexture pointers are in sorted order,
468 * false otherwise.
469 */
470class EXPCL_PANDA_EGG UniqueEggTextures {
471public:
472 INLINE UniqueEggTextures(int eq = ~0);
473 INLINE bool operator ()(const EggTexture *t1, const EggTexture *t2) const;
474
475 int _eq;
476};
477
478INLINE std::ostream &operator << (std::ostream &out, const EggTexture &n) {
479 return out << n.get_filename();
480}
481
482EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::TextureType texture_type);
483EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::Format format);
484EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CompressionMode mode);
485EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::WrapMode mode);
486EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::FilterType type);
487EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::EnvType type);
488EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineMode cm);
489EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineChannel cc);
490EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineSource cs);
491EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineOperand co);
492EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::TexGen tex_gen);
493EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::QualityLevel quality_level);
494
495#include "eggTexture.I"
496
497#endif
const Filename & get_filename() const
Returns a nonmodifiable reference to the filename.
virtual EggTransform * as_transform()
Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform,...
void write(std::ostream &out, int indent_level) const
Writes the attributes to the indicated output stream in Egg format.
Defines a texture map that may be applied to geometry.
Definition eggTexture.h:30
static CombineOperand string_combine_operand(const std::string &string)
Returns the CombineOperand value associated with the given string representation, or CO_unspecified i...
clear_priority
Removes the specification of multitexture priority from the texture.
Definition eggTexture.h:340
get_stage_name
Returns the stage name that has been specified for this texture, or the tref name if no texture stage...
Definition eggTexture.h:338
get_read_mipmaps
Returns the current setting of the read_mipmaps flag.
Definition eggTexture.h:359
WrapMode determine_wrap_u() const
Determines the appropriate wrap in the U direction.
Definition eggTexture.I:107
has_uv_name
Returns true if a texcoord name has been explicitly specified for this texture, false otherwise.
Definition eggTexture.h:346
get_alpha_scale
Returns the alpha_scale value that has been specified for the texture, or 1 if no alpha_scale value h...
Definition eggTexture.h:350
get_wrap_w
Returns the amount specified for W wrap.
Definition eggTexture.h:328
get_uv_name
Returns the texcoord name that has been specified for this texture, or the empty string if no texcoor...
Definition eggTexture.h:346
static EnvType string_env_type(const std::string &string)
Returns the EnvType value associated with the given string representation, or ET_unspecified if the s...
static CombineSource string_combine_source(const std::string &string)
Returns the CombineSource value associated with the given string representation, or CS_unspecified if...
get_multiview
Returns the current setting of the multiview flag.
Definition eggTexture.h:356
clear_min_lod
Removes the specification of a minimum mipmap level from the texture.
Definition eggTexture.h:361
get_multitexture_sort
Returns an integer that represents the depth to which this texture is layered on all other textures i...
Definition eggTexture.h:367
has_num_views
Returns true if the number of views has been specified for the 3-D multiview texture,...
Definition eggTexture.h:358
set_num_views
When loading a 3-D multiview texture, this parameter is necessary to specify how many views will be e...
Definition eggTexture.h:358
set_stage_name
Specifies the particular TextureStage this texture will be rendered on by name.
Definition eggTexture.h:338
clear_stage_name
Removes the named TextureStage specification.
Definition eggTexture.h:338
get_lod_bias
Returns the maximum mipmap level that has been specified for this texture.
Definition eggTexture.h:365
get_alpha_file_channel
Returns the particular channel that has been specified for the alpha-file image, or 0 if no channel h...
Definition eggTexture.h:355
set_rgb_scale
Sets an additional factor that will scale all three r, g, b components after the texture has been app...
Definition eggTexture.h:348
clear_num_views
Removes the specification of the number of views for a 3-D multiview texture.
Definition eggTexture.h:358
static TextureType string_texture_type(const std::string &string)
Returns the Texture_ype value associated with the given string representation, or TT_unspecified if t...
has_anisotropic_degree
Returns true if a value for the anisotropic filtering degree has been specified for this texture,...
Definition eggTexture.h:332
get_border_color
Returns the border color if one has been specified, or (0, 0, 0, 1) otherwise.
Definition eggTexture.h:344
set_alpha_scale
Sets an additional factor that will scale the alpha component after the texture has been applied.
Definition eggTexture.h:350
get_min_lod
Returns the minimum mipmap level that has been specified for this texture.
Definition eggTexture.h:361
clear_lod_bias
Removes the specification of a maximum mipmap level from the texture.
Definition eggTexture.h:365
clear_alpha_scale
Removes the alpha_scale from the texture and restores it to the default value of 1.
Definition eggTexture.h:350
set_uv_name
Specifies the named set of texture coordinates that this texture will use when it is applied to geome...
Definition eggTexture.h:346
set_min_lod
Sets the minimum mipmap level that may be sampled.
Definition eggTexture.h:361
static Format string_format(const std::string &string)
Returns the Format value associated with the given string representation, or F_unspecified if the str...
get_wrap_u
Returns the amount specified for U wrap.
Definition eggTexture.h:326
clear_uv_name
Removes the restriction to a particular named set of texture coordinates and restores the texture to ...
Definition eggTexture.h:346
WrapMode determine_wrap_w() const
Determines the appropriate wrap in the W direction.
Definition eggTexture.I:161
static QualityLevel string_quality_level(const std::string &string)
Returns the TexGen value associated with the given string representation, or ET_unspecified if the st...
set_anisotropic_degree
Sets the degree of anisotropic filtering for this texture.
Definition eggTexture.h:332
bool has_alpha_channel(int num_components) const
Given the number of color components (channels) in the image file as actually read from the disk,...
has_min_lod
Returns true if a value for the minimum mipmap level has been specified for this texture,...
Definition eggTexture.h:361
get_max_lod
Returns the maximum mipmap level that has been specified for this texture.
Definition eggTexture.h:363
bool is_equivalent_to(const EggTexture &other, int eq) const
Returns true if the two textures are equivalent in all relevant properties (according to eq),...
static FilterType string_filter_type(const std::string &string)
Returns the FilterType value associated with the given string representation, or FT_unspecified if th...
static CombineMode string_combine_mode(const std::string &string)
Returns the CombineMode value associated with the given string representation, or CM_unspecified if t...
bool multitexture_over(EggTexture *other)
Indicates that this texture should be layered on top of the other texture.
clear_rgb_scale
Removes the rgb_scale from the texture and restores it to the default value of 1.
Definition eggTexture.h:348
set_read_mipmaps
Sets the read_mipmaps flag.
Definition eggTexture.h:359
set_alpha_file_channel
If a separate alpha-file is specified, this indicates which channel number should be extracted from t...
Definition eggTexture.h:355
WrapMode determine_wrap_v() const
Determines the appropriate wrap in the V direction.
Definition eggTexture.I:134
clear_anisotropic_degree
Removes the specification of anisotropic filtering from the texture.
Definition eggTexture.h:332
get_anisotropic_degree
Returns the anisotropic filtering degree that has been specified for this texture,...
Definition eggTexture.h:332
has_color
Returns true if a blend color has been specified for the texture.
Definition eggTexture.h:342
has_lod_bias
Returns true if a value for the maximum mipmap level has been specified for this texture,...
Definition eggTexture.h:365
set_multiview
Sets the multiview flag.
Definition eggTexture.h:356
get_alpha_filename
Returns the separate file assigned for the alpha channel.
Definition eggTexture.h:352
has_alpha_file_channel
Returns true if a particular channel has been specified for the alpha-file image, false otherwise.
Definition eggTexture.h:355
has_priority
Returns true if a priority value for multitexture importance has been specified for the texture,...
Definition eggTexture.h:340
set_max_lod
Sets the maximum mipmap level that may be sampled.
Definition eggTexture.h:363
get_alpha_fullpath
Returns the full pathname to the alpha file, if it is known; otherwise, returns the same thing as get...
Definition eggTexture.h:353
bool affects_polygon_alpha() const
Returns true if this texture's environment type or combine mode allows the texture to have an effect ...
has_rgb_scale
Returns true if an rgb_scale has been specified for the texture, false otherwise.
Definition eggTexture.h:348
void clear_multitexture()
Resets the multitexture flags set by multitexture_over().
bool sorts_less_than(const EggTexture &other, int eq) const
An ordering operator to compare two textures for sorting order.
has_alpha_scale
Returns true if an alpha_scale has been specified for the texture, false otherwise.
Definition eggTexture.h:350
get_color
Returns the blend color if one has been specified, or (0, 0, 0, 1) otherwise.
Definition eggTexture.h:342
set_lod_bias
Sets the mipmap level bias that is added to the mipmap level to be sampled.
Definition eggTexture.h:365
static TexGen string_tex_gen(const std::string &string)
Returns the TexGen value associated with the given string representation, or ET_unspecified if the st...
static CompressionMode string_compression_mode(const std::string &string)
Returns the CompressionMode value associated with the given string representation,...
get_wrap_v
Returns the amount specified for V wrap.
Definition eggTexture.h:327
has_max_lod
Returns true if a value for the maximum mipmap level has been specified for this texture,...
Definition eggTexture.h:363
set_saved_result
Sets the saved_result flag.
Definition eggTexture.h:334
set_priority
Sets the importance of this texture with respect to other textures also applied on the same geometry.
Definition eggTexture.h:340
get_rgb_scale
Returns the rgb_scale value that has been specified for the texture, or 1 if no rgb_scale value has b...
Definition eggTexture.h:348
clear_max_lod
Removes the specification of a maximum mipmap level from the texture.
Definition eggTexture.h:363
static WrapMode string_wrap_mode(const std::string &string)
Returns the WrapMode value associated with the given string representation, or WM_unspecified if the ...
set_alpha_fullpath
Records the full pathname to the file, for the benefit of get_alpha_fullpath().
Definition eggTexture.h:353
clear_alpha_file_channel
Removes the specification of a particular channel to use from the alpha- file image.
Definition eggTexture.h:355
has_border_color
Returns true if a border color has been specified for the texture.
Definition eggTexture.h:344
set_alpha_filename
Specifies a separate file that will be loaded in with the 1- or 3-component texture and applied as th...
Definition eggTexture.h:352
get_priority
Returns the multitexture importance value that has been specified for the texture,...
Definition eggTexture.h:340
has_stage_name
Returns true if a stage name has been explicitly specified for this texture, false otherwise.
Definition eggTexture.h:338
has_alpha_filename
Returns true if a separate file for the alpha component has been applied, false otherwise.
Definition eggTexture.h:352
get_num_views
Returns the specified number of views specified for the 3-D multiview texture.
Definition eggTexture.h:358
get_saved_result
Returns the current setting of the saved_result flag.
Definition eggTexture.h:334
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...