Support Forum G3D Web Page |
Base class for materials in G3D, mostly useful as an interface for ray tracing since hardware rasterization rendering needs to be specialized for each Surface and Material subclass.
More...
Inherits G3D::ReferenceCountedObject.
Inherited by G3D::UniversalMaterial.
Public Member Functions | |
virtual bool | coverageLessThanEqual (const float alphaThreshold, const Point2 &texCoord) const =0 |
Returns true if this material has an alpha value less than alphaThreshold at texCoord. More... | |
virtual bool | hasPartialCoverage () const =0 |
Return true if coverageLessThanEqual(1) can ever return true. More... | |
virtual const String & | name () const =0 |
virtual void | sample (const Tri &tri, float u, float v, int triIndex, const CPUVertexArray &vertexArray, bool backside, shared_ptr< Surfel > &surfel, float du=0, float dv=0, bool twoSided=true) const =0 |
virtual void | setStorage (ImageStorage s) const =0 |
Static Protected Member Functions | |
template<class T , class ... ArgTypes> | |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
Like std::make_shared, but works for protected constructors. More... | |
Base class for materials in G3D, mostly useful as an interface for ray tracing since hardware rasterization rendering needs to be specialized for each Surface and Material subclass.
Material is a lazy_ptr subclass so that classes using it mayassociate arbitrary data with UniversalMaterials or computing Materials on demand without having to subclass UniversalMaterial itself.
Subclassing UniversalMaterial is often undesirable because that class has complex initialization and data management routines. Note that UniversalMaterial itself implements lazy_ptr<UniversalMaterial>, so you can simply use a UniversalMaterial with any API (such as Tri) that requires a proxy.
|
pure virtual |
Returns true if this material has an alpha value less than alphaThreshold at texCoord.
Implemented in G3D::UniversalMaterial.
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
|
pure virtual |
Return true if coverageLessThanEqual(1) can ever return true.
Implemented in G3D::UniversalMaterial.
|
pure virtual |
Implemented in G3D::UniversalMaterial.
|
pure virtual |
Implemented in G3D::UniversalMaterial.
|
pure virtual |
Implemented in G3D::UniversalMaterial.