Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Receiver.h
Go to the documentation of this file.
1#pragma once
2
3#include "Math/TVector2.h"
4#include "Math/TVector3.h"
6
7#include <Common/assertion.h>
8#include <Common/primitive_type.h>
9
10namespace ph::math { class RigidTransform; }
11
12namespace ph
13{
14
15class Ray;
16class RayDifferential;
17
22{
23 // TODO: time
24 // TODO: sample flow
25
26public:
27 explicit Receiver(const math::RigidTransform* receiverToWorld);
28
29 inline virtual ~Receiver() = default;
30
41 virtual math::Spectrum receiveRay(const math::Vector2D& rasterCoord, Ray* out_ray) const = 0;
42
43 // Given a ray generated by receiveRay() along with the parameters for it,
44 // calculates differential information on the origin of the ray.
45 // The default implementation uses numerical differentiation for
46 // the differentials.
47 /*virtual void calcSensedRayDifferentials(const math::Vector2R& filmNdcPos, const Ray& sensedRay,
48 RayDifferential* out_result) const;*/
49
50 virtual void evalEmittedImportanceAndPdfW(const math::Vector3R& targetPos, math::Vector2R* const out_filmCoord, math::Vector3R* const out_importance, real* out_filmArea, real* const out_pdfW) const = 0;
51
53
54private:
55 const math::RigidTransform* m_receiverToWorld;
56};
57
58// In-header Implementations:
59
61{
62 PH_ASSERT(m_receiverToWorld);
63
64 return *m_receiverToWorld;
65}
66
67}// end namespace ph
Represents a ray in space.
Definition Ray.h:21
A target that can receive any physical quantity, typically electromagnetic energy....
Definition Receiver.h:22
Receiver(const math::RigidTransform *receiverToWorld)
Definition Receiver.cpp:14
const math::RigidTransform & getReceiverToWorld() const
Definition Receiver.h:60
virtual math::Spectrum receiveRay(const math::Vector2D &rasterCoord, Ray *out_ray) const =0
Generate a ray received by the receiver.
virtual ~Receiver()=default
virtual void evalEmittedImportanceAndPdfW(const math::Vector3R &targetPos, math::Vector2R *const out_filmCoord, math::Vector3R *const out_importance, real *out_filmArea, real *const out_pdfW) const =0
Definition RigidTransform.h:14
Definition TTristimulusSpectrum.h:11
Math functions and utilities.
Definition TransformInfo.h:10
The root for all renderer implementations.
Definition EEngineProject.h:6