Panda3D
Functions
textureAttrib.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "textureAttrib.h"
#include "graphicsStateGuardianBase.h"
#include "internalName.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "datagram.h"
#include "datagramIterator.h"
#include "dcast.h"
#include "textureStagePool.h"

Go to the source code of this file.

Functions

 CPT (RenderAttrib) TextureAttrib
 Constructs a new TextureAttrib object suitable for rendering the indicated texture onto geometry, using the default TextureStage. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2002-02-21

Definition in file textureAttrib.cxx.

Function Documentation

◆ CPT()

CPT ( RenderAttrib  )

Constructs a new TextureAttrib object suitable for rendering the indicated texture onto geometry, using the default TextureStage.

Returns a new TextureAttrib, just like this one, but with the indicated stage added to the list of stages turned on by this attrib.

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Constructs a new TextureAttrib object that turns off all stages (and hence disables texturing).

Constructs a new TextureAttrib object that does nothing.

Constructs a new TextureAttrib object suitable for rendering untextured geometry.

Returns a new TextureAttrib, just like this one, but with the indicated stage added to the list of stages turned on by this attrib. Returns a new TextureAttrib, just like this one, but with the indicated stage removed from the list of stages turned on by this attrib. Returns a new TextureAttrib, just like this one, but with the indicated stage added to the list of stages turned off by this attrib. Returns a new TextureAttrib, just like this one, but with the indicated stage removed from the list of stages turned off by this attrib. Returns a new TextureAttrib, just like this one, but with any included TextureAttribs that happen to have the same name as the given object replaced with the object. Returns a new TextureAttrib, very much like this one, but with the number of on_stages reduced to be no more than max_texture_stages. The number of off_stages in the new TextureAttrib is undefined. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

This should return false if a RenderAttrib on a higher node will compose into a RenderAttrib on a lower node that has a higher override value, or false if the lower RenderAttrib will completely replace the state.

The default behavior is false: normally, a RenderAttrib in the graph cannot completely override a RenderAttrib above it, regardless of its override value–instead, the two attribs are composed. But for some kinds of RenderAttribs, it is useful to allow this kind of override.

This method only handles the one special case of a lower RenderAttrib with a higher override value. If the higher RenderAttrib has a higher override value, it always completely overrides. And if both RenderAttribs have the same override value, they are always composed. Should be overridden by derived classes to return true if cull_callback() has been defined. Otherwise, returns false to indicate cull_callback() does not need to be called for this node during the cull traversal. If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

This is called each time the RenderAttrib is discovered applied to a Geom in the traversal. It should return true if the Geom is visible, false if it should be omitted. Intended to be overridden by derived TextureAttrib types to return a unique number indicating whether this TextureAttrib is equivalent to the other one.

This should return 0 if the two TextureAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.

This will only be called with two TextureAttrib objects whose get_type() functions return the same. Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties. RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

This should return the result of applying the other RenderAttrib to a node in the scene graph below this RenderAttrib, which was already applied. In most cases, the result is the same as the other RenderAttrib (that is, a subsequent RenderAttrib completely replaces the preceding one). On the other hand, some kinds of RenderAttrib (for instance, ColorTransformAttrib) might combine in meaningful ways. Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib objects of the same type interact.

See invert_compose() and compose_impl(). Tells the BamReader how to create objects of type TextureAttrib.

Definition at line 34 of file textureAttrib.cxx.