# TextureStage

from pandac.PandaModules import TextureStage

Class : TextureStage
Description : 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.

## Inheritance:

TextureStage: TypedWritableReferenceCount
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase

## Methods of TextureStage:

getAlphaScale
getClassType
getColor
getCombineAlphaMode
getCombineAlphaOperand0
getCombineAlphaOperand1
getCombineAlphaOperand2
getCombineAlphaSource0
getCombineAlphaSource1
getCombineAlphaSource2
getCombineRgbMode
getCombineRgbOperand0
getCombineRgbOperand1
getCombineRgbOperand2
getCombineRgbSource0
getCombineRgbSource1
getCombineRgbSource2
getDefault
getMode
getName
getNumCombineAlphaOperands
getNumCombineRgbOperands
getPriority
getRgbScale
getSavedResult
getSort
getTexcoordName
involvesColorScale
isFixedFunction
operator <
operator =
output
setAlphaScale
setColor
setCombineAlpha
setCombineRgb
setMode
setName
setPriority
setRgbScale
setSavedResult
setSort
setTexcoordName
usesColor
write

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

## Constants in TextureStage:

MModulate | (Mode)
MDecal | (Mode)
MBlend | (Mode)
MReplace | (Mode)
MAdd | (Mode)
MCombine | (Mode)
MBlendColorScale | (Mode)
MModulateGlow | (Mode)
MModulateGloss | (Mode)
MNormal | (Mode)
MNormalHeight | (Mode)
MGlow | (Mode)
MGloss | (Mode)
MHeight | (Mode)
MSelector | (Mode)
CMUndefined | (CombineMode)
CMReplace | (CombineMode)
CMModulate | (CombineMode)
CMAdd | (CombineMode)
CMAddSigned | (CombineMode)
CMInterpolate | (CombineMode)
CMSubtract | (CombineMode)
CMDot3Rgb | (CombineMode)
CMDot3Rgba | (CombineMode)
CSUndefined | (CombineSource)
CSTexture | (CombineSource)
CSConstant | (CombineSource)
CSPrimaryColor | (CombineSource)
CSPrevious | (CombineSource)
CSConstantColorScale | (CombineSource)
CSLastSavedResult | (CombineSource)
COUndefined | (CombineOperand)
COSrcColor | (CombineOperand)
COOneMinusSrcColor | (CombineOperand)
COSrcAlpha | (CombineOperand)
COOneMinusSrcAlpha | (CombineOperand)

getAlphaScale int TextureStage::get_alpha_scale(void) const; Description: See set_alpha_scale().

getClassType static TypeHandle TextureStage::get_class_type(void); Undocumented function.

getColor LVecBase4f TextureStage::get_color(void) const; Description: return the color for this stage

getCombineAlphaMode TextureStage::CombineMode TextureStage::get_combine_alpha_mode(void) const; Description: Get combine_alpha_mode

getCombineAlphaOperand0 TextureStage::CombineOperand TextureStage::get_combine_alpha_operand0(void) const; Description: Get operand0 of combine_alpha_mode

getCombineAlphaOperand1 TextureStage::CombineOperand TextureStage::get_combine_alpha_operand1(void) const; Description: Get operand1 of combine_alpha_mode

getCombineAlphaOperand2 TextureStage::CombineOperand TextureStage::get_combine_alpha_operand2(void) const; Description: Get operand2 of combine_alpha_mode

getCombineAlphaSource0 TextureStage::CombineSource TextureStage::get_combine_alpha_source0(void) const; Description: Get source0 of combine_alpha_mode

getCombineAlphaSource1 TextureStage::CombineSource TextureStage::get_combine_alpha_source1(void) const; Description: Get source1 of combine_alpha_mode

getCombineAlphaSource2 TextureStage::CombineSource TextureStage::get_combine_alpha_source2(void) const; Description: Get source2 of combine_alpha_mode

getCombineRgbMode TextureStage::CombineMode TextureStage::get_combine_rgb_mode(void) const; Description: Get the combine_rgb_mode

getCombineRgbOperand0 TextureStage::CombineOperand TextureStage::get_combine_rgb_operand0(void) const; Description: Get operand0 of combine_rgb_mode

getCombineRgbOperand1 TextureStage::CombineOperand TextureStage::get_combine_rgb_operand1(void) const; Description: Get operand1 of combine_rgb_mode

getCombineRgbOperand2 TextureStage::CombineOperand TextureStage::get_combine_rgb_operand2(void) const; Description: Get operand2 of combine_rgb_mode

getCombineRgbSource0 TextureStage::CombineSource TextureStage::get_combine_rgb_source0(void) const; Description: Get source0 of combine_rgb_mode

getCombineRgbSource1 TextureStage::CombineSource TextureStage::get_combine_rgb_source1(void) const; Description: Get source1 of combine_rgb_mode

getCombineRgbSource2 TextureStage::CombineSource TextureStage::get_combine_rgb_source2(void) const; Description: Get source2 of combine_rgb_mode

getDefault static TextureStage *TextureStage::get_default(void); Description: 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.

getMode TextureStage::Mode TextureStage::get_mode(void) const; Description: Return the mode of this stage

getName string const &TextureStage::get_name(void) const; Description: Returns the name of this texture stage

getNumCombineAlphaOperands int TextureStage::get_num_combine_alpha_operands(void) const; Description: Returns the number of meaningful operands that may be retrieved via get_combine_alpha_sourceN() and get_combine_alpha_operandN().

getNumCombineRgbOperands int TextureStage::get_num_combine_rgb_operands(void) const; Description: Returns the number of meaningful operands that may be retrieved via get_combine_rgb_sourceN() and get_combine_rgb_operandN().

getPriority int TextureStage::get_priority(void) const; Description: Returns the priority associated with this stage. This is specially helpful for cards that do not support more than n stages of multi-texturing.

getRgbScale int TextureStage::get_rgb_scale(void) const; Description: See set_rgb_scale().

getSavedResult bool TextureStage::get_saved_result(void) const; Description: Returns the current setting of the saved_result flag. See set_saved_result().

getSort int TextureStage::get_sort(void) const; Description: Returns the sort order of this texture stage.

getTexcoordName InternalName *TextureStage::get_texcoord_name(void) const; Description: Returns the InternalName

involvesColorScale bool TextureStage::involves_color_scale(void) const; Description: Returns true if the TextureStage is affected by the setting of the current ColorScaleAttrib, false otherwise.

isFixedFunction bool TextureStage::is_fixed_function(void) const; Description: Returns true if the TextureStage is relevant to the classic fixed function pipeline. This excludes texture stages such as normal mapping and the like.

operator < bool TextureStage::operator <(TextureStage const &other) const; Description: Compare if the sort order is lower

operator = void TextureStage::operator =(TextureStage const &copy); Description: just copy the members of other to this

output void TextureStage::output(ostream &out) const; Description: Just a single line output

setAlphaScale void TextureStage::set_alpha_scale(int alpha_scale); Description: 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 void TextureStage::set_color(LVecBase4f const &color); Description: Set the color for this stage

setCombineAlpha void TextureStage::set_combine_alpha(TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0); Description: Specifies any of the CombineMode values that represent a one-parameter operation. Specifically, this is CM_replace only. Description: Specifies any of the CombineMode values that represent a two-parameter operation. Specifically, this is everything except for CM_replace and CM_interpolate. Description: Specifies any of the CombineMode values that represent a one-parameter operation. Specifically, this is CM_interpolate only.

setCombineRgb void TextureStage::set_combine_rgb(TextureStage::CombineMode mode, TextureStage::CombineSource source0, TextureStage::CombineOperand operand0); Description: Specifies any of the CombineMode values that represent a one-parameter operation. Specifically, this is CM_replace only. Description: Specifies any of the CombineMode values that represent a two-parameter operation. Specifically, this is everything except for CM_replace and CM_interpolate. Description: Specifies any of the CombineMode values that represent a one-parameter operation. Specifically, this is CM_interpolate only.

setMode void TextureStage::set_mode(TextureStage::Mode mode); Description: Set the mode of this texture stage

setName void TextureStage::set_name(string const &name); Description: Changes the name of this texture stage

setPriority void TextureStage::set_priority(int priority); Description: 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 void TextureStage::set_rgb_scale(int rgb_scale); Description: 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 void TextureStage::set_saved_result(bool saved_result); Description: 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 void TextureStage::set_sort(int sort); Description: 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 void TextureStage::set_texcoord_name(InternalName *name); Description: 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.

usesColor bool TextureStage::uses_color(void) const; Description: Returns true if the TextureStage makes use of whatever color is specified in set_color(), false otherwise.

write void TextureStage::write(ostream &out) const; Description: Writes the details of this stage

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.