Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::AGeometricLight Class Referenceabstract

#include <AGeometricLight.h>

Inheritance diagram for ph::AGeometricLight:
ph::ALight ph::PhysicalActor ph::Actor ph::TSdlResourceBase< ESdlTypeCategory::Ref_Actor > ph::SdlResourceBase ph::ISdlResource ph::AAreaLight ph::AModelLight ph::APointLight ph::ARectangleLight ph::ASphereLight

Public Member Functions

virtual std::shared_ptr< GeometrygetGeometry (const CookingContext &ctx) const =0
 
virtual const EmitterbuildEmitter (const CookingContext &ctx, TSpanView< const Primitive * > lightPrimitives) const =0
 
virtual std::shared_ptr< MaterialgetMaterial (const CookingContext &ctx) const
 
PreCookReport preCook (const CookingContext &ctx) const override
 Cooking supplemental data before cook(). This method allows user to specify additional configurations for the following cooking process. This method may run in parallel without taking into account resource dependencies.
 
TransientVisualElement cook (const CookingContext &ctx, const PreCookReport &report) const override
 
 PH_DEFINE_SDL_CLASS (TSdlOwnerClass< AGeometricLight >)
 
- Public Member Functions inherited from ph::ALight
 PH_DEFINE_SDL_CLASS (TSdlOwnerClass< ALight >)
 
- Public Member Functions inherited from ph::PhysicalActor
void translate (const real amountX, const real amountY, const real amountZ)
 
void translate (const math::Vector3R &amount)
 
void rotate (const math::Vector3R &axis, const real additionanDegrees)
 
void rotate (const math::QuaternionR &additionalRotation)
 
void scale (const real uniformAmount)
 
void scale (const real amountX, const real amountY, const real amountZ)
 
void scale (const math::Vector3R &amount)
 
void setBaseTransform (const math::TDecomposedTransform< real > &baseLocalToWorld)
 
 PH_DEFINE_SDL_CLASS (TSdlOwnerClass< PhysicalActor >)
 
- Public Member Functions inherited from ph::Actor
virtual void postCook (const CookingContext &ctx, TransientVisualElement &element) const
 Cooking additional data after cook(). This method provides an opportunity for user to decorate the cooked data or any post-cook operations (such as generating debug data). This method may run in parallel without taking into account resource dependencies.
 
virtual CookOrder getCookOrder () const
 
TransientVisualElement stagelessCook (const CookingContext &ctx) const
 Helper to execute the full cooking procedure in one go.
 
 PH_DEFINE_SDL_CLASS (TSdlOwnerClass< Actor >)
 
- Public Member Functions inherited from ph::TSdlResourceBase< ESdlTypeCategory::Ref_Actor >
ESdlTypeCategory getDynamicCategory () const override
 
- Public Member Functions inherited from ph::SdlResourceBase
SdlResourceId getId () const override
 Get the unique ID of this resource. The returned ID is guaranteed to be unique in the current process. Newly created resource cannot have an ID that has been used by a previous resource, even if the previous resource has ended its life cycle. See SdlResourceId.h for some utilities.
 
- Public Member Functions inherited from ph::ISdlResource
 ISdlResource (const ISdlResource &other)=default
 
 ISdlResource (ISdlResource &&other)=default
 
virtual ~ISdlResource ()=default
 
ISdlResourceoperator= (const ISdlResource &rhs)=default
 
ISdlResourceoperator= (ISdlResource &&rhs)=default
 
virtual const SdlClassgetDynamicSdlClass () const
 Get runtime SDL class of the resource.
 
virtual bool isInlinable () const
 

Static Public Member Functions

static std::shared_ptr< GeometrygetSanifiedGeometry (const std::shared_ptr< Geometry > &srcGeometry, const TransformInfo &srcLocalToWorld, math::TDecomposedTransform< real > *out_remainingLocalToWorld=nullptr)
 

Protected Member Functions

virtual EmitterFeatureSet getEmitterFeatureSet () const
 
- Protected Member Functions inherited from ph::TSdlResourceBase< ESdlTypeCategory::Ref_Actor >
 TSdlResourceBase ()=default
 
 TSdlResourceBase (const TSdlResourceBase &other)=default
 
 TSdlResourceBase (TSdlResourceBase &&other)=default
 
TSdlResourceBaseoperator= (const TSdlResourceBase &rhs)=default
 
TSdlResourceBaseoperator= (TSdlResourceBase &&rhs)=default
 
- Protected Member Functions inherited from ph::SdlResourceBase
 SdlResourceBase ()
 
 SdlResourceBase (const SdlResourceBase &other)
 
 SdlResourceBase (SdlResourceBase &&other)=default
 
SdlResourceBaseoperator= (const SdlResourceBase &rhs)
 
SdlResourceBaseoperator= (SdlResourceBase &&rhs)=default
 
- Protected Member Functions inherited from ph::ISdlResource
 ISdlResource ()=default
 

Protected Attributes

bool m_isDirectlyVisible
 
bool m_useBsdfSample
 
bool m_useDirectSample
 
bool m_useEmissionSample
 
- Protected Attributes inherited from ph::PhysicalActor
TransformInfo m_localToWorld
 

Additional Inherited Members

- Static Public Attributes inherited from ph::TSdlResourceBase< ESdlTypeCategory::Ref_Actor >
static constexpr ESdlTypeCategory CATEGORY
 Static category information of the resource. This static category information is required by ISdlResource. See its documentation for more details.
 

Member Function Documentation

◆ buildEmitter()

virtual const Emitter * ph::AGeometricLight::buildEmitter ( const CookingContext & ctx,
TSpanView< const Primitive * > lightPrimitives ) const
pure virtual

Generates the core emission part of the light source.

Implemented in ph::AAreaLight, and ph::AModelLight.

◆ cook()

TransientVisualElement ph::AGeometricLight::cook ( const CookingContext & ctx,
const PreCookReport & report ) const
overridevirtual

Guaranteed to provide primitives view if the emitters generated are based on primitives (i.e., emitting light from primitives). Emitters and primitives are either in one-to-one mapping, or in one-to-many mapping (all primitives correspond to one emitter).

Implements ph::ALight.

◆ getEmitterFeatureSet()

EmitterFeatureSet ph::AGeometricLight::getEmitterFeatureSet ( ) const
protectedvirtual
Returns
Create an emitter feature set from light settings.

Reimplemented in ph::APointLight.

◆ getGeometry()

virtual std::shared_ptr< Geometry > ph::AGeometricLight::getGeometry ( const CookingContext & ctx) const
pure virtual

A geometric source would need to place a corresponding geometry in the scene. Override this method and return a geometry for that.

Implemented in ph::AAreaLight, and ph::AModelLight.

◆ getMaterial()

std::shared_ptr< Material > ph::AGeometricLight::getMaterial ( const CookingContext & ctx) const
virtual

Generate a suitable material for the light source if physical entity will be present in the scene. The default implementation generates a pure diffuse material with moderate albedo.

Reimplemented in ph::AAreaLight, and ph::AModelLight.

◆ getSanifiedGeometry()

std::shared_ptr< Geometry > ph::AGeometricLight::getSanifiedGeometry ( const std::shared_ptr< Geometry > & srcGeometry,
const TransformInfo & srcLocalToWorld,
math::TDecomposedTransform< real > * out_remainingLocalToWorld = nullptr )
static

Tries to return a geometry suitable for emitter calculations (can be the original one if it is already suitable). If the current actor has undesired configurations, nullptr is returned.

◆ PH_DEFINE_SDL_CLASS()

ph::AGeometricLight::PH_DEFINE_SDL_CLASS ( TSdlOwnerClass< AGeometricLight > )
inline

◆ preCook()

PreCookReport ph::AGeometricLight::preCook ( const CookingContext & ctx) const
overridevirtual

Cooking supplemental data before cook(). This method allows user to specify additional configurations for the following cooking process. This method may run in parallel without taking into account resource dependencies.

Reimplemented from ph::Actor.

Member Data Documentation

◆ m_isDirectlyVisible

bool ph::AGeometricLight::m_isDirectlyVisible
protected

◆ m_useBsdfSample

bool ph::AGeometricLight::m_useBsdfSample
protected

◆ m_useDirectSample

bool ph::AGeometricLight::m_useDirectSample
protected

◆ m_useEmissionSample

bool ph::AGeometricLight::m_useEmissionSample
protected

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