17 INLINE
void EggTexture::
18 set_texture_type(TextureType texture_type) {
19 _texture_type = texture_type;
21 bool pattern_filename =
22 (_texture_type == TT_3d_texture || _texture_type == TT_cube_map);
24 _filename.set_pattern(pattern_filename);
25 _fullpath.set_pattern(pattern_filename);
31 INLINE EggTexture::TextureType EggTexture::
32 get_texture_type()
const {
39 INLINE
void EggTexture::
40 set_format(Format format) {
47 INLINE EggTexture::Format EggTexture::
55 INLINE
void EggTexture::
56 set_compression_mode(CompressionMode mode) {
57 _compression_mode = mode;
63 INLINE EggTexture::CompressionMode EggTexture::
64 get_compression_mode()
const {
65 return _compression_mode;
71 INLINE
void EggTexture::
72 set_wrap_mode(WrapMode mode) {
79 INLINE EggTexture::WrapMode EggTexture::
80 get_wrap_mode()
const {
87 INLINE
void EggTexture::
88 set_wrap_u(WrapMode mode) {
96 INLINE EggTexture::WrapMode EggTexture::
108 return (_wrap_u == WM_unspecified) ? get_wrap_mode() :
get_wrap_u();
114 INLINE
void EggTexture::
115 set_wrap_v(WrapMode mode) {
123 INLINE EggTexture::WrapMode EggTexture::
135 return (_wrap_v == WM_unspecified) ? get_wrap_mode() :
get_wrap_v();
141 INLINE
void EggTexture::
142 set_wrap_w(WrapMode mode) {
150 INLINE EggTexture::WrapMode EggTexture::
162 return (_wrap_w == WM_unspecified) ? get_wrap_mode() :
get_wrap_w();
168 INLINE
void EggTexture::
169 set_minfilter(FilterType type) {
176 INLINE EggTexture::FilterType EggTexture::
177 get_minfilter()
const {
184 INLINE
void EggTexture::
185 set_magfilter(FilterType type) {
192 INLINE EggTexture::FilterType EggTexture::
193 get_magfilter()
const {
203 _anisotropic_degree = anisotropic_degree;
204 _flags |= F_has_anisotropic_degree;
210 INLINE
void EggTexture::
211 clear_anisotropic_degree() {
212 _anisotropic_degree = 0;
213 _flags &= ~F_has_anisotropic_degree;
220 INLINE
bool EggTexture::
221 has_anisotropic_degree()
const {
222 return (_flags & F_has_anisotropic_degree) != 0;
229 INLINE
int EggTexture::
230 get_anisotropic_degree()
const {
233 return _anisotropic_degree;
239 INLINE
void EggTexture::
240 set_env_type(EnvType type) {
247 INLINE EggTexture::EnvType EggTexture::
248 get_env_type()
const {
255 INLINE
void EggTexture::
256 set_combine_mode(CombineChannel channel, CombineMode cm) {
257 nassertv((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels);
258 _combiner[channel]._mode = cm;
264 INLINE EggTexture::CombineMode EggTexture::
265 get_combine_mode(CombineChannel channel)
const {
266 nassertr((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels, CM_unspecified);
267 return _combiner[channel]._mode;
273 INLINE
void EggTexture::
274 set_combine_source(CombineChannel channel,
int n, CombineSource cs) {
275 nassertv((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels);
276 nassertv(n >= 0 && n < (
int)CI_num_indices);
277 _combiner[channel]._ops[n]._source = cs;
283 INLINE EggTexture::CombineSource EggTexture::
284 get_combine_source(CombineChannel channel,
int n)
const {
285 nassertr((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels, CS_unspecified);
286 nassertr(n >= 0 && n < (
int)CI_num_indices, CS_unspecified);
287 return _combiner[channel]._ops[n]._source;
293 INLINE
void EggTexture::
294 set_combine_operand(CombineChannel channel,
int n, CombineOperand co) {
295 nassertv((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels);
296 nassertv(n >= 0 && n < (
int)CI_num_indices);
297 _combiner[channel]._ops[n]._operand = co;
303 INLINE EggTexture::CombineOperand EggTexture::
304 get_combine_operand(CombineChannel channel,
int n)
const {
305 nassertr((
int)channel >= 0 && (
int)channel < (
int)CC_num_channels, CO_unspecified);
306 nassertr(n >= 0 && n < (
int)CI_num_indices, CO_unspecified);
307 return _combiner[channel]._ops[n]._operand;
325 _saved_result = saved_result;
332 INLINE
bool EggTexture::
333 get_saved_result()
const {
334 return _saved_result;
340 INLINE
void EggTexture::
341 set_tex_gen(TexGen tex_gen) {
348 INLINE EggTexture::TexGen EggTexture::
349 get_tex_gen()
const {
356 INLINE
void EggTexture::
357 set_quality_level(QualityLevel quality_level) {
358 _quality_level = quality_level;
364 INLINE EggTexture::QualityLevel EggTexture::
365 get_quality_level()
const {
366 return _quality_level;
380 _stage_name = stage_name;
381 _flags |= F_has_stage_name;
387 INLINE
void EggTexture::
389 _stage_name = std::string();
390 _flags &= ~F_has_stage_name;
397 INLINE
bool EggTexture::
398 has_stage_name()
const {
399 return (_flags & F_has_stage_name) != 0;
406 INLINE
const std::string &EggTexture::
407 get_stage_name()
const {
418 _priority = priority;
419 _flags |= F_has_priority;
426 INLINE
void EggTexture::
429 _flags &= ~F_has_priority;
436 INLINE
bool EggTexture::
437 has_priority()
const {
438 return (_flags & F_has_priority) != 0;
445 INLINE
int EggTexture::
446 get_priority()
const {
453 INLINE
void EggTexture::
454 set_color(
const LColor &color) {
456 _flags |= F_has_color;
462 INLINE
void EggTexture::
464 _color.set(0.0f, 0.0f, 0.0f, 1.0f);
465 _flags &= ~F_has_color;
471 INLINE
bool EggTexture::
473 return (_flags & F_has_color) != 0;
480 INLINE
const LColor &EggTexture::
488 INLINE
void EggTexture::
489 set_border_color(
const LColor &border_color) {
490 _border_color = border_color;
491 _flags |= F_has_border_color;
497 INLINE
void EggTexture::
498 clear_border_color() {
499 _border_color.set(0.0f, 0.0f, 0.0f, 1.0f);
500 _flags &= ~F_has_border_color;
506 INLINE
bool EggTexture::
507 has_border_color()
const {
508 return (_flags & F_has_border_color) != 0;
515 INLINE
const LColor &EggTexture::
516 get_border_color()
const {
517 return _border_color;
530 if (uv_name ==
"default" || uv_name.empty()) {
534 _flags |= F_has_uv_name;
542 INLINE
void EggTexture::
544 _uv_name = std::string();
545 _flags &= ~F_has_uv_name;
552 INLINE
bool EggTexture::
553 has_uv_name()
const {
554 return (_flags & F_has_uv_name) != 0;
561 INLINE
const std::string &EggTexture::
562 get_uv_name()
const {
575 _rgb_scale = rgb_scale;
576 _flags |= F_has_rgb_scale;
583 INLINE
void EggTexture::
586 _flags &= ~F_has_rgb_scale;
593 INLINE
bool EggTexture::
594 has_rgb_scale()
const {
595 return (_flags & F_has_rgb_scale) != 0;
602 INLINE
int EggTexture::
603 get_rgb_scale()
const {
616 _alpha_scale = alpha_scale;
617 _flags |= F_has_alpha_scale;
624 INLINE
void EggTexture::
625 clear_alpha_scale() {
627 _flags &= ~F_has_alpha_scale;
634 INLINE
bool EggTexture::
635 has_alpha_scale()
const {
636 return (_flags & F_has_alpha_scale) != 0;
643 INLINE
int EggTexture::
644 get_alpha_scale()
const {
655 _alpha_filename = alpha_filename;
656 _alpha_fullpath = alpha_filename;
657 _flags |= F_has_alpha_filename;
663 INLINE
void EggTexture::
664 clear_alpha_filename() {
667 _flags &= ~F_has_alpha_filename;
674 INLINE
bool EggTexture::
675 has_alpha_filename()
const {
676 return (_flags & F_has_alpha_filename) != 0;
685 get_alpha_filename()
const {
687 return _alpha_filename;
701 get_alpha_fullpath()
const {
702 return _alpha_fullpath;
711 _alpha_fullpath = alpha_fullpath;
724 _alpha_file_channel = alpha_file_channel;
725 _flags |= F_has_alpha_file_channel;
732 INLINE
void EggTexture::
733 clear_alpha_file_channel() {
734 _alpha_file_channel = 0;
735 _flags &= ~F_has_alpha_file_channel;
742 INLINE
bool EggTexture::
743 has_alpha_file_channel()
const {
744 return (_flags & F_has_alpha_file_channel) != 0;
752 INLINE
int EggTexture::
753 get_alpha_file_channel()
const {
754 return _alpha_file_channel;
769 _multiview = multiview;
775 INLINE
bool EggTexture::
776 get_multiview()
const {
787 _num_views = num_views;
788 _flags |= F_has_num_views;
795 INLINE
void EggTexture::
798 _flags &= ~F_has_num_views;
805 INLINE
bool EggTexture::
806 has_num_views()
const {
807 return (_flags & F_has_num_views) != 0;
814 INLINE
int EggTexture::
815 get_num_views()
const {
833 _read_mipmaps = read_mipmaps;
840 INLINE
bool EggTexture::
841 get_read_mipmaps()
const {
842 return _read_mipmaps;
851 _flags |= F_has_min_lod;
857 INLINE
void EggTexture::
860 _flags &= ~F_has_min_lod;
867 INLINE
bool EggTexture::
868 has_min_lod()
const {
869 return (_flags & F_has_min_lod) != 0;
875 INLINE
double EggTexture::
876 get_min_lod()
const {
886 _flags |= F_has_max_lod;
892 INLINE
void EggTexture::
895 _flags &= ~F_has_max_lod;
902 INLINE
bool EggTexture::
903 has_max_lod()
const {
904 return (_flags & F_has_max_lod) != 0;
910 INLINE
double EggTexture::
911 get_max_lod()
const {
920 _lod_bias = lod_bias;
921 _flags |= F_has_lod_bias;
927 INLINE
void EggTexture::
930 _flags &= ~F_has_lod_bias;
937 INLINE
bool EggTexture::
938 has_lod_bias()
const {
939 return (_flags & F_has_lod_bias) != 0;
945 INLINE
double EggTexture::
946 get_lod_bias()
const {
957 INLINE
int EggTexture::
958 get_multitexture_sort()
const {
959 return _multitexture_sort;
965 INLINE EggTexture::SourceAndOperand::
967 _source(CS_unspecified),
968 _operand(CO_unspecified)
975 INLINE EggTexture::Combiner::
977 _mode(CM_unspecified)
984 INLINE UniqueEggTextures::
985 UniqueEggTextures(
int eq) : _eq(eq) {
991 INLINE
bool UniqueEggTextures::
set_min_lod
Sets the minimum mipmap level that may be sampled.
set_priority
Sets the importance of this texture with respect to other textures also applied on the same geometry.
has_alpha_filename
Returns true if a separate file for the alpha component has been applied, false otherwise.
Defines a texture map that may be applied to geometry.
set_read_mipmaps
Sets the read_mipmaps flag.
set_alpha_fullpath
Records the full pathname to the file, for the benefit of get_alpha_fullpath().
get_wrap_u
Returns the amount specified for U wrap.
set_saved_result
Sets the saved_result flag.
has_stage_name
Returns true if a stage name has been explicitly specified for this texture, false otherwise.
set_anisotropic_degree
Sets the degree of anisotropic filtering for this texture.
set_stage_name
Specifies the particular TextureStage this texture will be rendered on by name.
WrapMode determine_wrap_w() const
Determines the appropriate wrap in the W direction.
set_multiview
Sets the multiview flag.
WrapMode determine_wrap_v() const
Determines the appropriate wrap in the V direction.
set_num_views
When loading a 3-D multiview texture, this parameter is necessary to specify how many views will be e...
The name of a file, such as a texture file or an Egg file.
set_max_lod
Sets the maximum mipmap level that may be sampled.
set_alpha_scale
Sets an additional factor that will scale the alpha component after the texture has been applied.
bool sorts_less_than(const EggTexture &other, int eq) const
An ordering operator to compare two textures for sorting order.
set_uv_name
Specifies the named set of texture coordinates that this texture will use when it is applied to geome...
get_wrap_v
Returns the amount specified for V wrap.
WrapMode determine_wrap_u() const
Determines the appropriate wrap in the U direction.
clear_uv_name
Removes the restriction to a particular named set of texture coordinates and restores the texture to ...
set_alpha_filename
Specifies a separate file that will be loaded in with the 1- or 3-component texture and applied as th...
set_alpha_file_channel
If a separate alpha-file is specified, this indicates which channel number should be extracted from t...
set_rgb_scale
Sets an additional factor that will scale all three r, g, b components after the texture has been app...
get_wrap_w
Returns the amount specified for W wrap.
set_lod_bias
Sets the mipmap level bias that is added to the mipmap level to be sampled.