Panda3D
Public Member Functions | Static Public Member Functions | List of all members
ShaderGenerator Class Reference

The ShaderGenerator is a device that effectively replaces the classic fixed function pipeline with a 'next-gen' fixed function pipeline. More...

#include "shaderGenerator.h"

Inheritance diagram for ShaderGenerator:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Public Member Functions

 ShaderGenerator (GraphicsStateGuardianBase *gsg, GraphicsOutputBase *host)
 Create a ShaderGenerator. More...
 
virtual ~ShaderGenerator ()
 Destroy a ShaderGenerator. More...
 
virtual CPT (ShaderAttrib) synthesize_shader(const RenderState *rs)
 
virtual TypeHandle force_init_type ()
 
virtual TypeHandle get_type () const
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

The ShaderGenerator is a device that effectively replaces the classic fixed function pipeline with a 'next-gen' fixed function pipeline.

The next-gen fixed function pipeline supports features like normal mapping, gloss mapping, cartoon lighting, and so forth. It works by automatically generating a shader from a given RenderState.

Currently, there is one ShaderGenerator object per GraphicsStateGuardian. It is our intent that in time, people will write classes that derive from ShaderGenerator but which yield slightly different results.

The ShaderGenerator owes its existence to the 'Bamboo Team' at Carnegie Mellon's Entertainment Technology Center. This is a group of students who, as a semester project, decided that next-gen graphics should be accessible to everyone, even if they don't know shader programming. The group consisted of:

Aaron Lo, Programmer Heegun Lee, Programmer Erin Fernandez, Artist/Tester Joe Grubb, Artist/Tester Ivan Ortega, Technical Artist/Tester

Thanks to them!

Definition at line 66 of file shaderGenerator.h.

Constructor & Destructor Documentation

◆ ShaderGenerator()

ShaderGenerator::ShaderGenerator ( GraphicsStateGuardianBase gsg,
GraphicsOutputBase host 
)

Create a ShaderGenerator.

This has no state, except possibly to cache certain results. The parameter that must be passed is the GSG to which the shader generator belongs.

Definition at line 56 of file shaderGenerator.cxx.

References ~ShaderGenerator().

◆ ~ShaderGenerator()

ShaderGenerator::~ShaderGenerator ( )
virtual

Destroy a ShaderGenerator.

Definition at line 66 of file shaderGenerator.cxx.

References ShaderAttrib::auto_shader(), TextureStage::get_alpha_scale(), Material::get_ambient(), TextureStage::get_color(), ColorAttrib::get_color_type(), TextureStage::get_combine_alpha_mode(), TextureStage::get_combine_alpha_operand0(), TextureStage::get_combine_alpha_operand1(), TextureStage::get_combine_alpha_operand2(), TextureStage::get_combine_alpha_source0(), TextureStage::get_combine_alpha_source1(), TextureStage::get_combine_alpha_source2(), TextureStage::get_combine_rgb_mode(), TextureStage::get_combine_rgb_operand0(), TextureStage::get_combine_rgb_operand1(), TextureStage::get_combine_rgb_operand2(), TextureStage::get_combine_rgb_source0(), TextureStage::get_combine_rgb_source1(), TextureStage::get_combine_rgb_source2(), Material::get_default(), Material::get_diffuse(), Material::get_emission(), FogAttrib::get_fog(), LightRampAttrib::get_level(), Material::get_local(), MaterialAttrib::get_material(), AlphaTestAttrib::get_mode(), LightRampAttrib::get_mode(), TransparencyAttrib::get_mode(), ColorBlendAttrib::get_mode(), TextureStage::get_mode(), LightAttrib::get_num_on_lights(), ClipPlaneAttrib::get_num_on_planes(), TextureAttrib::get_num_on_stages(), LightAttrib::get_on_light(), TextureAttrib::get_on_stage(), TextureAttrib::get_on_texture(), AuxBitplaneAttrib::get_outputs(), AlphaTestAttrib::get_reference_alpha(), TextureStage::get_rgb_scale(), TextureStage::get_saved_result(), Material::get_specular(), TextureStage::get_texcoord_name(), Texture::get_texture_type(), LightRampAttrib::get_threshold(), Material::has_ambient(), Material::has_diffuse(), Material::has_emission(), Material::has_specular(), NodePath::is_empty(), TypedObject::is_of_type(), FogAttrib::is_off(), MaterialAttrib::is_off(), NodePath::node(), ReferenceCount::ref(), TextureStage::uses_last_saved_result(), and TextureStage::uses_primary_color().

Referenced by ShaderGenerator().


The documentation for this class was generated from the following files: