Panda3D
Public Member Functions | List of all members
MultitexReducer Class Reference

This object presents an interface for generating new texture images that represent the combined images from one or more individual textures, reproducing certain kinds of multitexture effects without depending on multitexture support in the hardware. More...

Public Member Functions

 __init__ ()
 
 __init__ (const MultitexReducer)
 
 clear ()
 
 flatten (GraphicsOutput window)
 
 scan (const NodePath node)
 Starts scanning the hierarchy beginning at the indicated node. More...
 
 scan (const NodePath node, const NodePath state_from)
 Starts scanning the hierarchy beginning at the indicated node. More...
 
 scan (PandaNode node, const RenderState state, const TransformState transform)
 
 setAllowTexMat (bool allow_tex_mat)
 
 setTarget (TextureStage stage)
 
 setUseGeom (bool use_geom)
 

Detailed Description

This object presents an interface for generating new texture images that represent the combined images from one or more individual textures, reproducing certain kinds of multitexture effects without depending on multitexture support in the hardware.

This also flattens out texture matrices and removes extra texture coordinates from the Geoms. It is thus not a complete substitute for true multitexturing, because it does not lend itself well to dynamic animation of the textures once they have been flattened. It is, however, useful for "baking in" a particular multitexture effect.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const  MultitexReducer)

◆ clear()

clear ( )

◆ flatten()

flatten ( GraphicsOutput  window)

◆ scan() [1/3]

scan ( const NodePath  node)

Starts scanning the hierarchy beginning at the indicated node.

Any GeomNodes discovered in the hierarchy with multitexture will be added to internal structures in the MultitexReducer so that a future call to flatten() will operate on all of these at once.

This version of this method does not accumulate state from the parents of the indicated node; thus, only multitexture effects that have been applied at node and below will be considered.

◆ scan() [2/3]

scan ( const NodePath  node,
const NodePath  state_from 
)

Starts scanning the hierarchy beginning at the indicated node.

Any GeomNodes discovered in the hierarchy with multitexture will be added to internal structures in the MultitexReducer so that a future call to flatten() will operate on all of these at once.

The second parameter represents the NodePath from which to accumulate the state that is considered for the multitexture. Pass an empty NodePath to accumulate all the state from the root of the graph, or you may specify some other node here in order to not consider nodes above that as contributing to the state to be flattened. This is particularly useful if you have some texture stage which is applied globally to a scene (for instance, a caustics effect), which you don't want to be considered for flattening by the MultitexReducer.

◆ scan() [3/3]

scan ( PandaNode  node,
const RenderState  state,
const TransformState  transform 
)

◆ setAllowTexMat()

setAllowTexMat ( bool  allow_tex_mat)

◆ setTarget()

setTarget ( TextureStage  stage)

◆ setUseGeom()

setUseGeom ( bool  use_geom)