Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

ShaderAttrib Class Reference

Inheritance diagram for ShaderAttrib:
RenderAttrib TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Types

enum  { F_disable_alpha_write = 0, F_subsume_alpha_test = 1 }

Public Member Functions

bool auto_gloss_on () const
bool auto_glow_on () const
bool auto_normal_on () const
bool auto_ramp_on () const
bool auto_shader () const
 If true, then this ShaderAttrib does not contain an explicit shader - instead, it requests the automatic generation of a shader.
bool auto_shadow_on () const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_flag(int flag
 CPT (RenderAttrib) clear_flag(int flag) const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) clear_shader_input(const InternalName *id) const
 CPT (RenderAttrib) clear_shader_input(const string &id) const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) clear_all_shader_inputs() const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader(const Shader *s
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_instance_count(int instance_count) const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_off(int priority=0) const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_auto(int priority=0) const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_auto(BitMask32 shader_switch
 CPT (RenderAttrib) clear_shader() const
 CPT (RenderAttrib) set_shader_input(const InternalName *id
 CPT (RenderAttrib) set_shader_input(const ShaderInput *inp) const
virtual TypeHandle force_init_type ()
bool get_flag (int flag) const
int get_instance_count () const
 Returns the number of geometry instances.
const Shaderget_shader () const
 Returns the shader object associated with the node.
const ShaderInputget_shader_input (const InternalName *id) const
 Returns the ShaderInput of the given name.
const ShaderInputget_shader_input (const string &id) const
 Returns the ShaderInput of the given name.
const NodePathget_shader_input_nodepath (const InternalName *id) const
 Returns the ShaderInput as a nodepath.
const Shader::ShaderPtrDataget_shader_input_ptr (const InternalName *id) const
 Returns the ShaderInput as a ShaderPtrData struct.
Textureget_shader_input_texture (const InternalName *id) const
 Returns the ShaderInput as a texture.
const LVecBase4get_shader_input_vector (InternalName *id) const
 Returns the ShaderInput as a vector.
int get_shader_priority () const
virtual int get_slot () const
virtual TypeHandle get_type () const
bool has_shader () const
 If true, the shader field of this attribute overrides the shader field of the parent attribute.

Static Public Member Functions

static CPT (RenderAttrib) make()
static CPT (RenderAttrib) make_off()
static CPT (RenderAttrib) make_default()
static int get_class_slot ()
static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Factory method to generate a Shader object.

Public Attributes

bool value const
double n1 = 0
double double n2 = 0
double double double n3 = 0
double double double double n4 = 1
const NodePathnp
const PTA_LVecBase4 int priority = 0) const
const PTA_LVecBase3 int priority = 0) const
double double double double int priority = 0) const
const PTA_double int priority = 0) const
int priority = 0) const
const PTA_LVecBase2 int priority = 0) const
const NodePath int priority = 0) const
const LVecBase4 int priority = 0) const
const PTA_LMatrix4 int priority = 0) const
const LVecBase3 int priority = 0) const
const PTA_float int priority = 0) const
const PTA_LMatrix3 int priority = 0) const
const LVecBase2 int priority = 0) const
const LMatrix4 int priority = 0) const
const LMatrix3 int priority = 0) const
Texture int priority = 0) const
Texturetex
const PTA_float & v
const LVecBase4v
const LVecBase2v
const PTA_LMatrix3 & v
const LMatrix4v
const LMatrix3v
const PTA_LVecBase3 & v
const PTA_LVecBase2 & v
const LVecBase3v
const PTA_LMatrix4 & v
const PTA_LVecBase4 & v
const PTA_double & v

Protected Member Functions

virtual int compare_to_impl (const RenderAttrib *other) const
 Intended to be overridden by derived ShaderAttrib types to return a unique number indicating whether this ShaderAttrib is equivalent to the other one.
virtual CPT (RenderAttrib) get_auto_shader_attrib_impl(const RenderState *state) const
virtual CPT (RenderAttrib) compose_impl(const RenderAttrib *other) const
virtual size_t get_hash_impl () const
 Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

Detailed Description

Definition at line 39 of file shaderAttrib.h.


Member Function Documentation

bool ShaderAttrib::auto_shader ( ) const [inline]

If true, then this ShaderAttrib does not contain an explicit shader - instead, it requests the automatic generation of a shader.

Definition at line 81 of file shaderAttrib.I.

Referenced by ShaderGenerator::analyze_renderstate().

int ShaderAttrib::compare_to_impl ( const RenderAttrib other) const [protected, virtual]

Intended to be overridden by derived ShaderAttrib types to return a unique number indicating whether this ShaderAttrib is equivalent to the other one.

This should return 0 if the two ShaderAttrib 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 ShaderAttrib objects whose get_type() functions return the same.

Reimplemented from RenderAttrib.

Definition at line 592 of file shaderAttrib.cxx.

size_t ShaderAttrib::get_hash_impl ( ) const [protected, virtual]

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.

Reimplemented from RenderAttrib.

Definition at line 663 of file shaderAttrib.cxx.

References integer_hash< Key, Compare >::add_hash(), and pointer_hash::add_hash().

int ShaderAttrib::get_instance_count ( ) const [inline]

Returns the number of geometry instances.

A value of 0 means not to use instancing at all.

Definition at line 102 of file shaderAttrib.I.

Referenced by NodePath::get_instance_count().

const Shader * ShaderAttrib::get_shader ( ) const

Returns the shader object associated with the node.

If get_override returns true, but get_shader returns NULL, that means that this attribute should disable the shader.

Definition at line 572 of file shaderAttrib.cxx.

const ShaderInput * ShaderAttrib::get_shader_input ( const InternalName id) const

Returns the ShaderInput of the given name.

If no such name is found, this function does not return NULL --- it returns the "blank" ShaderInput.

Definition at line 432 of file shaderAttrib.cxx.

References ShaderInput::get_blank().

Referenced by get_shader_input().

const ShaderInput * ShaderAttrib::get_shader_input ( const string &  id) const

Returns the ShaderInput of the given name.

If no such name is found, this function does not return NULL --- it returns the "blank" ShaderInput.

Definition at line 449 of file shaderAttrib.cxx.

References get_shader_input().

const NodePath & ShaderAttrib::get_shader_input_nodepath ( const InternalName id) const

Returns the ShaderInput as a nodepath.

Assertion fails if there is none, or if it is not a nodepath.

Definition at line 460 of file shaderAttrib.cxx.

const Shader::ShaderPtrData * ShaderAttrib::get_shader_input_ptr ( const InternalName id) const

Returns the ShaderInput as a ShaderPtrData struct.

Assertion fails if there is none. or if it is not a PTA(double/float)

Definition at line 518 of file shaderAttrib.cxx.

Texture * ShaderAttrib::get_shader_input_texture ( const InternalName id) const

Returns the ShaderInput as a texture.

Assertion fails if there is none, or if it is not a texture.

Definition at line 544 of file shaderAttrib.cxx.

const LVecBase4 & ShaderAttrib::get_shader_input_vector ( InternalName id) const

Returns the ShaderInput as a vector.

Assertion fails if there is none, or if it is not a vector.

Definition at line 490 of file shaderAttrib.cxx.

bool ShaderAttrib::has_shader ( ) const [inline]

If true, the shader field of this attribute overrides the shader field of the parent attribute.

Definition at line 69 of file shaderAttrib.I.

void ShaderAttrib::register_with_read_factory ( ) [static]

Factory method to generate a Shader object.

Definition at line 762 of file shaderAttrib.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations