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_shader () const
 If true, then this ShaderAttrib does not contain an explicit shader - instead, it requests the automatic generation of a shader.
 CPT (RenderAttrib) set_shader(const Shader *s
 CPT (RenderAttrib) clear_shader() const
 CPT (RenderAttrib) set_shader_input(const string &id
 CPT (RenderAttrib) set_shader_input(const string &id
 CPT (RenderAttrib) set_shader_input(const ShaderInput *inp) const
 CPT (RenderAttrib) set_instance_count(int instance_count) const
 CPT (RenderAttrib) set_flag(int flag
 CPT (RenderAttrib) set_shader_input(InternalName *id
 CPT (RenderAttrib) clear_flag(int flag) const
 CPT (RenderAttrib) clear_shader_input(InternalName *id) const
 CPT (RenderAttrib) set_shader_input(InternalName *id
 CPT (RenderAttrib) clear_shader_input(const string &id) const
 CPT (RenderAttrib) clear_all_shader_inputs() const
 CPT (RenderAttrib) set_shader_off(int priority=0) const
 CPT (RenderAttrib) set_shader_input(InternalName *id
 CPT (RenderAttrib) set_shader_input(InternalName *id
 CPT (RenderAttrib) set_shader_auto(int priority=0) const
 CPT (RenderAttrib) set_shader_input(const string &id
 CPT (RenderAttrib) set_shader_input(const string &id
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 string &id) const
 Returns the ShaderInput of the given name.
const ShaderInputget_shader_input (InternalName *id) const
 Returns the ShaderInput of the given name.
const NodePathget_shader_input_nodepath (InternalName *id) const
 Returns the ShaderInput as a nodepath.
Textureget_shader_input_texture (InternalName *id) const
 Returns the ShaderInput as a texture.
const LVector4fget_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
int priority = 0) const
const LVector4f int priority = 0) const
Texture int priority = 0) const
const NodePath int priority = 0) const
double double double double int priority = 0) const
Texturetex
const LVector4fv

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) compose_impl(const RenderAttrib *other) const

Detailed Description

Definition at line 29 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 70 of file shaderAttrib.I.

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 451 of file shaderAttrib.cxx.

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 91 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 431 of file shaderAttrib.cxx.

const ShaderInput * ShaderAttrib::get_shader_input ( 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 318 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 335 of file shaderAttrib.cxx.

References get_shader_input().

const NodePath & ShaderAttrib::get_shader_input_nodepath ( 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 346 of file shaderAttrib.cxx.

Texture * ShaderAttrib::get_shader_input_texture ( 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 403 of file shaderAttrib.cxx.

const LVector4f & 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 376 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 58 of file shaderAttrib.I.

void ShaderAttrib::register_with_read_factory ( ) [static]

Factory method to generate a Shader object.

Definition at line 546 of file shaderAttrib.cxx.


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