Panda3D
|
Defines the properties of a named stage of the multitexture pipeline. More...
#include <pandadoc.hpp>
Public Types | |
enum | CombineMode { CM_undefined = 0 , CM_replace = 1 , CM_modulate = 2 , CM_add = 3 , CM_add_signed = 4 , CM_interpolate = 5 , CM_subtract = 6 , CM_dot3_rgb = 7 , CM_dot3_rgba = 8 } |
enum | CombineOperand { CO_undefined = 0 , CO_src_color = 1 , CO_one_minus_src_color = 2 , CO_src_alpha = 3 , CO_one_minus_src_alpha = 4 } |
enum | CombineSource { CS_undefined = 0 , CS_texture = 1 , CS_constant = 2 , CS_primary_color = 3 , CS_previous = 4 , CS_constant_color_scale = 5 , CS_last_saved_result = 6 } |
enum | Mode { M_modulate = 0 , M_decal = 1 , M_blend = 2 , M_replace = 3 , M_add = 4 , M_combine = 5 , M_blend_color_scale = 6 , M_modulate_glow = 7 , M_modulate_gloss = 8 , M_normal = 9 , M_normal_height = 10 , M_glow = 11 , M_gloss = 12 , M_height = 13 , M_selector = 14 , M_normal_gloss = 15 , M_emission = 16 } |
Public Member Functions | |
__init__ (const TextureStage copy) | |
Initialize the texture stage from other. More... | |
__init__ (str name) | |
Initialize the texture stage at construction. More... | |
int | compareTo (const TextureStage other) |
Returns a number less than zero if this TextureStage sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent. More... | |
int | getAlphaScale () |
See set_alpha_scale(). More... | |
InternalName | getBinormalName () |
Returns the set of binormals this texture stage will use. More... | |
LColor | getColor () |
return the color for this stage More... | |
TextureStage::CombineMode | getCombineAlphaMode () |
Get combine_alpha_mode. More... | |
TextureStage::CombineOperand | getCombineAlphaOperand0 () |
Get operand0 of combine_alpha_mode. More... | |
TextureStage::CombineOperand | getCombineAlphaOperand1 () |
Get operand1 of combine_alpha_mode. More... | |
TextureStage::CombineOperand | getCombineAlphaOperand2 () |
Get operand2 of combine_alpha_mode. More... | |
TextureStage::CombineSource | getCombineAlphaSource0 () |
Get source0 of combine_alpha_mode. More... | |
TextureStage::CombineSource | getCombineAlphaSource1 () |
Get source1 of combine_alpha_mode. More... | |
TextureStage::CombineSource | getCombineAlphaSource2 () |
Get source2 of combine_alpha_mode. More... | |
TextureStage::CombineMode | getCombineRgbMode () |
Get the combine_rgb_mode. More... | |
TextureStage::CombineOperand | getCombineRgbOperand0 () |
Get operand0 of combine_rgb_mode. More... | |
TextureStage::CombineOperand | getCombineRgbOperand1 () |
Get operand1 of combine_rgb_mode. More... | |
TextureStage::CombineOperand | getCombineRgbOperand2 () |
Get operand2 of combine_rgb_mode. More... | |
TextureStage::CombineSource | getCombineRgbSource0 () |
Get source0 of combine_rgb_mode. More... | |
TextureStage::CombineSource | getCombineRgbSource1 () |
Get source1 of combine_rgb_mode. More... | |
TextureStage::CombineSource | getCombineRgbSource2 () |
Get source2 of combine_rgb_mode. More... | |
TextureStage::Mode | getMode () |
Return the mode of this stage. More... | |
str | getName () |
Returns the name of this texture stage. More... | |
int | getNumCombineAlphaOperands () |
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and get_combine_alpha_operandN(). More... | |
int | getNumCombineRgbOperands () |
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get_combine_rgb_operandN(). More... | |
int | getPriority () |
Returns the priority associated with this stage. More... | |
int | getRgbScale () |
See set_rgb_scale(). More... | |
bool | getSavedResult () |
Returns the current setting of the saved_result flag. More... | |
int | getSort () |
Returns the sort order of this texture stage. More... | |
InternalName | getTangentName () |
Returns the set of tangents this texture stage will use. More... | |
InternalName | getTexcoordName () |
See set_texcoord_name. More... | |
int | getTexViewOffset () |
Returns the current setting of the tex_view_offset. More... | |
bool | involvesColorScale () |
Returns true if the TextureStage is affected by the setting of the current ColorScaleAttrib, false otherwise. More... | |
bool | isFixedFunction () |
Returns true if the TextureStage is relevant to the classic fixed function pipeline. More... | |
bool | operator!= (const TextureStage other) |
bool | operator< (const TextureStage other) |
TextureStage | operator= (const TextureStage copy) |
bool | operator== (const TextureStage other) |
output (Ostream out) | |
Just a single line output. More... | |
setAlphaScale (int alpha_scale) | |
Sets an additional factor that will scale the alpha component after the texture has been applied. More... | |
setColor (const LColor color) | |
Set the color for this stage. More... | |
setCombineAlpha (TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0) | |
Specifies any of the CombineMode values that represent a one-parameter operation. More... | |
setCombineAlpha (TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0, TextureStage::CombineSource source1, TextureStage::CombineOperand operand1) | |
Specifies any of the CombineMode values that represent a two-parameter operation. More... | |
setCombineAlpha (TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0, TextureStage::CombineSource source1, TextureStage::CombineOperand operand1, TextureStage::CombineSource source2, TextureStage::CombineOperand operand2) | |
Specifies any of the CombineMode values that represent a one-parameter operation. More... | |
setCombineRgb (TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0) | |
Specifies any of the CombineMode values that represent a one-parameter operation. More... | |
setCombineRgb (TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0, TextureStage::CombineSource source1, TextureStage::CombineOperand operand1) | |
Specifies any of the CombineMode values that represent a two-parameter operation. More... | |
setCombineRgb (TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0, TextureStage::CombineSource source1, TextureStage::CombineOperand operand1, TextureStage::CombineSource source2, TextureStage::CombineOperand operand2) | |
Specifies any of the CombineMode values that represent a one-parameter operation. More... | |
setMode (TextureStage::Mode mode) | |
Set the mode of this texture stage. More... | |
setName (str name) | |
Changes the name of this texture stage. More... | |
setPriority (int priority) | |
Changes the relative importance of the texture associated with this stage relative to the other texture stages that are applied simultaneously. More... | |
setRgbScale (int rgb_scale) | |
Sets an additional factor that will scale all three r, g, b components after the texture has been applied. More... | |
setSavedResult (bool saved_result) | |
Sets the saved_result flag. More... | |
setSort (int sort) | |
Changes the order in which the texture associated with this stage is rendered relative to the other texture stages. More... | |
setTexcoordName (InternalName name) | |
Indicate which set of UV's this texture stage will use. More... | |
setTexcoordName (str texcoord_name) | |
Indicate which set of UV's this texture stage will use. More... | |
setTexViewOffset (int tex_view_offset) | |
Sets the tex_view_offset value. More... | |
bool | usesColor () |
Returns true if the TextureStage makes use of whatever color is specified in set_color(), false otherwise. More... | |
bool | usesLastSavedResult () |
Returns true if the TextureStage makes use of the CS_primary_color combine source. More... | |
bool | usesPrimaryColor () |
Returns true if the TextureStage makes use of the CS_primary_color combine source. More... | |
write (Ostream out) | |
Writes the details of this stage. More... | |
![]() | |
object | __reduce__ () |
object | __reduce_persist__ (object pickler) |
VectorUchar | encodeToBamStream () |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More... | |
bool | encodeToBamStream (VectorUchar data, BamWriter writer) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More... | |
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 of the relevant data from the BamFile for the new object. More... | |
UpdateSeq | getBamModified () |
Returns the current bam_modified counter. More... | |
markBamModified () | |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More... | |
![]() | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. More... | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. More... | |
![]() | |
int | getRefCount () |
Returns the current reference count. More... | |
ref () | |
Explicitly increments the reference count. More... | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
bool | unref () |
Explicitly decrements the reference count. More... | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static TextureStage | getDefault () |
Returns the default TextureStage that will be used for all texturing that does not name a particular stage. More... | |
![]() | |
static TypedWritableReferenceCount | decodeFromBamStream (VectorUchar data, BamReader reader) |
Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on those bytes. More... | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
Public Attributes | |
int | alpha_scale |
See set_alpha_scale(). More... | |
InternalName | binormal_name |
Returns the set of binormals this texture stage will use. More... | |
LColor | color |
return the color for this stage More... | |
TextureStage | default |
Returns the default TextureStage that will be used for all texturing that does not name a particular stage. More... | |
TextureStage::Mode | mode |
Return the mode of this stage. More... | |
const String | name |
Returns the name of this texture stage. More... | |
int | priority |
Returns the priority associated with this stage. More... | |
int | rgb_scale |
See set_rgb_scale(). More... | |
bool | saved_result |
Returns the current setting of the saved_result flag. More... | |
int | sort |
Returns the sort order of this texture stage. More... | |
InternalName | tangent_name |
Returns the set of tangents this texture stage will use. More... | |
int | tex_view_offset |
Returns the current setting of the tex_view_offset. More... | |
InternalName | texcoord_name |
See set_texcoord_name. More... | |
![]() | |
TypeHandle | type |
Returns the TypeHandle representing this object's type. More... | |
![]() | |
int | ref_count |
The current reference count. More... | |
Defines the properties of a named stage of the multitexture pipeline.
The TextureAttrib will associated a number of these stages with Texture objects, and the GSG will render geometry by sorting all of the currently active TextureStages in order and then issuing the appropriate rendering calls to activate them.
enum CombineMode |
enum CombineOperand |
enum CombineSource |
enum Mode |
__init__ | ( | const TextureStage | copy | ) |
Initialize the texture stage from other.
__init__ | ( | str | name | ) |
Initialize the texture stage at construction.
int compareTo | ( | const TextureStage | other | ) |
Returns a number less than zero if this TextureStage sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
The sorting order is arbitrary and largely meaningless, except to differentiate different stages.
int getAlphaScale | ( | ) |
See set_alpha_scale().
InternalName getBinormalName | ( | ) |
Returns the set of binormals this texture stage will use.
This is the same as get_binormal_name(), except that the first part is "binormal".
|
static |
LColor getColor | ( | ) |
return the color for this stage
TextureStage::CombineMode getCombineAlphaMode | ( | ) |
Get combine_alpha_mode.
TextureStage::CombineOperand getCombineAlphaOperand0 | ( | ) |
Get operand0 of combine_alpha_mode.
TextureStage::CombineOperand getCombineAlphaOperand1 | ( | ) |
Get operand1 of combine_alpha_mode.
TextureStage::CombineOperand getCombineAlphaOperand2 | ( | ) |
Get operand2 of combine_alpha_mode.
TextureStage::CombineSource getCombineAlphaSource0 | ( | ) |
Get source0 of combine_alpha_mode.
TextureStage::CombineSource getCombineAlphaSource1 | ( | ) |
Get source1 of combine_alpha_mode.
TextureStage::CombineSource getCombineAlphaSource2 | ( | ) |
Get source2 of combine_alpha_mode.
TextureStage::CombineMode getCombineRgbMode | ( | ) |
Get the combine_rgb_mode.
TextureStage::CombineOperand getCombineRgbOperand0 | ( | ) |
Get operand0 of combine_rgb_mode.
TextureStage::CombineOperand getCombineRgbOperand1 | ( | ) |
Get operand1 of combine_rgb_mode.
TextureStage::CombineOperand getCombineRgbOperand2 | ( | ) |
Get operand2 of combine_rgb_mode.
TextureStage::CombineSource getCombineRgbSource0 | ( | ) |
Get source0 of combine_rgb_mode.
TextureStage::CombineSource getCombineRgbSource1 | ( | ) |
Get source1 of combine_rgb_mode.
TextureStage::CombineSource getCombineRgbSource2 | ( | ) |
Get source2 of combine_rgb_mode.
|
static |
Returns the default TextureStage that will be used for all texturing that does not name a particular stage.
This generally handles the normal single-texture case.
TextureStage::Mode getMode | ( | ) |
Return the mode of this stage.
str getName | ( | ) |
Returns the name of this texture stage.
int getNumCombineAlphaOperands | ( | ) |
Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and get_combine_alpha_operandN().
int getNumCombineRgbOperands | ( | ) |
Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get_combine_rgb_operandN().
int getPriority | ( | ) |
Returns the priority associated with this stage.
This is specially helpful for cards that do not support more than n stages of multi-texturing.
int getRgbScale | ( | ) |
See set_rgb_scale().
bool getSavedResult | ( | ) |
Returns the current setting of the saved_result flag.
See set_saved_result().
int getSort | ( | ) |
Returns the sort order of this texture stage.
InternalName getTangentName | ( | ) |
Returns the set of tangents this texture stage will use.
This is the same as get_texcoord_name(), except that the first part is "tangent".
InternalName getTexcoordName | ( | ) |
See set_texcoord_name.
The default is InternalName::get_texcoord().
int getTexViewOffset | ( | ) |
Returns the current setting of the tex_view_offset.
See set_tex_view_offset().
bool involvesColorScale | ( | ) |
Returns true if the TextureStage is affected by the setting of the current ColorScaleAttrib, false otherwise.
bool isFixedFunction | ( | ) |
Returns true if the TextureStage is relevant to the classic fixed function pipeline.
This excludes texture stages such as normal mapping and the like.
bool operator!= | ( | const TextureStage | other | ) |
bool operator< | ( | const TextureStage | other | ) |
TextureStage operator= | ( | const TextureStage | copy | ) |
bool operator== | ( | const TextureStage | other | ) |
output | ( | Ostream | out | ) |
Just a single line output.
setAlphaScale | ( | int | alpha_scale | ) |
Sets an additional factor that will scale the alpha component after the texture has been applied.
This is used only when the mode is CM_combine.
The only legal values are 1, 2, or 4.
setColor | ( | const LColor | color | ) |
Set the color for this stage.
setCombineAlpha | ( | TextureStage::CombineMode | mode, |
TextureStage::CombineSource | source0, | ||
TextureStage::CombineOperand | operand0 | ||
) |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_replace only.
setCombineAlpha | ( | TextureStage::CombineMode | mode, |
TextureStage::CombineSource | source0, | ||
TextureStage::CombineOperand | operand0, | ||
TextureStage::CombineSource | source1, | ||
TextureStage::CombineOperand | operand1 | ||
) |
Specifies any of the CombineMode values that represent a two-parameter operation.
Specifically, this is everything except for CM_replace and CM_interpolate.
setCombineAlpha | ( | TextureStage::CombineMode | mode, |
TextureStage::CombineSource | source0, | ||
TextureStage::CombineOperand | operand0, | ||
TextureStage::CombineSource | source1, | ||
TextureStage::CombineOperand | operand1, | ||
TextureStage::CombineSource | source2, | ||
TextureStage::CombineOperand | operand2 | ||
) |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_interpolate only.
setCombineRgb | ( | TextureStage::CombineMode | mode, |
TextureStage::CombineSource | source0, | ||
TextureStage::CombineOperand | operand0 | ||
) |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_replace only.
setCombineRgb | ( | TextureStage::CombineMode | mode, |
TextureStage::CombineSource | source0, | ||
TextureStage::CombineOperand | operand0, | ||
TextureStage::CombineSource | source1, | ||
TextureStage::CombineOperand | operand1 | ||
) |
Specifies any of the CombineMode values that represent a two-parameter operation.
Specifically, this is everything except for CM_replace and CM_interpolate.
setCombineRgb | ( | TextureStage::CombineMode | mode, |
TextureStage::CombineSource | source0, | ||
TextureStage::CombineOperand | operand0, | ||
TextureStage::CombineSource | source1, | ||
TextureStage::CombineOperand | operand1, | ||
TextureStage::CombineSource | source2, | ||
TextureStage::CombineOperand | operand2 | ||
) |
Specifies any of the CombineMode values that represent a one-parameter operation.
Specifically, this is CM_interpolate only.
setMode | ( | TextureStage::Mode | mode | ) |
Set the mode of this texture stage.
setName | ( | str | name | ) |
Changes the name of this texture stage.
setPriority | ( | int | priority | ) |
Changes the relative importance of the texture associated with this stage relative to the other texture stages that are applied simultaneously.
This is unrelated to set_sort(), which controls the order in which multiple textures are applied. The priority number is used to decide which of the requested textures are to be selected for rendering when more textures are requested than the hardware will support. The highest-priority n textures are selected for rendering, and then rendered in order by their sort factor.
setRgbScale | ( | int | rgb_scale | ) |
Sets an additional factor that will scale all three r, g, b components after the texture has been applied.
This is used only when the mode is CM_combine.
The only legal values are 1, 2, or 4.
setSavedResult | ( | bool | saved_result | ) |
Sets the saved_result flag.
When this is true, the output of this stage will be supplied as the "last_saved_result" source for any future stages, until the next TextureStage with a saved_result set true is encountered.
This can be used to reuse the results of this texture stage as input to more than one stage later in the pipeline.
The last texture in the pipeline (the one with the highest sort value) should not have this flag set.
setSort | ( | int | sort | ) |
Changes the order in which the texture associated with this stage is rendered relative to the other texture stages.
When geometry is rendered with multiple textures, the textures are rendered in order from the lowest sort number to the highest sort number.
Also see set_priority(), which is used to select the most important textures for rendering when some must be omitted because of hardware limitations.
setTexcoordName | ( | InternalName | name | ) |
Indicate which set of UV's this texture stage will use.
Geometry may have any number of associated UV sets, each of which must have a unique name.
setTexcoordName | ( | str | texcoord_name | ) |
Indicate which set of UV's this texture stage will use.
Geometry may have any number of associated UV sets, each of which must have a unique name.
setTexViewOffset | ( | int | tex_view_offset | ) |
Sets the tex_view_offset value.
This is used only when a special multiview texture is bound to the TextureStage, and it selects the particular view of the texture that is to be used.
This value is added to the similar parameter on DisplayRegion to derive the final texture view index that is selected for rendering.
bool usesColor | ( | ) |
Returns true if the TextureStage makes use of whatever color is specified in set_color(), false otherwise.
bool usesLastSavedResult | ( | ) |
Returns true if the TextureStage makes use of the CS_primary_color combine source.
bool usesPrimaryColor | ( | ) |
Returns true if the TextureStage makes use of the CS_primary_color combine source.
write | ( | Ostream | out | ) |
Writes the details of this stage.
int alpha_scale |
See set_alpha_scale().
InternalName binormal_name |
Returns the set of binormals this texture stage will use.
This is the same as get_binormal_name(), except that the first part is "binormal".
LColor color |
return the color for this stage
TextureStage default |
Returns the default TextureStage that will be used for all texturing that does not name a particular stage.
This generally handles the normal single-texture case.
TextureStage::Mode mode |
Return the mode of this stage.
const String name |
Returns the name of this texture stage.
int priority |
Returns the priority associated with this stage.
This is specially helpful for cards that do not support more than n stages of multi-texturing.
int rgb_scale |
See set_rgb_scale().
bool saved_result |
Returns the current setting of the saved_result flag.
See set_saved_result().
int sort |
Returns the sort order of this texture stage.
InternalName tangent_name |
Returns the set of tangents this texture stage will use.
This is the same as get_texcoord_name(), except that the first part is "tangent".
int tex_view_offset |
Returns the current setting of the tex_view_offset.
See set_tex_view_offset().
InternalName texcoord_name |
See set_texcoord_name.
The default is InternalName::get_texcoord().