Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Scene.h
Go to the documentation of this file.
1#pragma once
2
3#include "Math/math_fwd.h"
5
6#include <Common/assertion.h>
7#include <Common/primitive_type.h>
8
9namespace ph
10{
11
12class Intersector;
13class EmitterSampler;
14class HitProbe;
15class DirectEnergySampleQuery;
16class DirectEnergyPdfQuery;
17class EnergyEmissionSampleQuery;
18class Ray;
19class Emitter;
20class Primitive;
21class SurfaceHit;
22class SampleFlow;
23
26class Scene final
27{
28public:
29 Scene();
30 Scene(const Intersector* intersector, const EmitterSampler* emitterSampler);
31
32 bool isOccluding(const Ray& ray) const;
33 bool isIntersecting(const Ray& ray, HitProbe* out_probe) const;
34
35 const Emitter* pickEmitter(SampleFlow& sampleFlow, real* out_PDF) const;
36
40 void genDirectSample(
42 SampleFlow& sampleFlow,
43 HitProbe& probe) const;
44
47 void calcDirectPdf(DirectEnergyPdfQuery& query) const;
48
52 void emitRay(
54 SampleFlow& sampleFlow,
55 HitProbe& probe) const;
56
57 void setBackgroundPrimitive(const Primitive* const primitive);
58
59private:
60 const Intersector* m_intersector;
61 const EmitterSampler* m_emitterSampler;
62 const Primitive* m_backgroundPrimitive;
63};
64
65// In-header Implementations:
66
67inline void Scene::setBackgroundPrimitive(const Primitive* const primitive)
68{
69 m_backgroundPrimitive = primitive;
70}
71
72}// end namespace ph
Information for the probability of generating a specific sample for direct energy estimation.
Definition DirectEnergyPdfQuery.h:81
Information for generating a sample for direct energy estimation.
Definition DirectEnergySampleQuery.h:89
An electromagnetic energy emitting source. The emitted energy can be captured by a Receiver.
Definition Emitter.h:68
Definition EmitterSampler.h:22
Information for generating a sample for energy emission.
Definition EnergyEmissionSampleQuery.h:63
Lightweight ray intersection testing and reporting object. If an intersection is found,...
Definition HitProbe.h:27
Definition Intersector.h:14
A physical shape in the scene.
Definition Primitive.h:23
Represents a ray in space.
Definition Ray.h:21
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
A unified interface for accessing cooked content in a visual world.
Definition Scene.h:27
bool isOccluding(const Ray &ray) const
Definition Scene.cpp:54
bool isIntersecting(const Ray &ray, HitProbe *out_probe) const
Definition Scene.cpp:36
void calcDirectPdf(DirectEnergyPdfQuery &query) const
Calculate the PDF of direct lighting for a target position.
Definition Scene.cpp:85
Scene()
Definition Scene.cpp:18
void setBackgroundPrimitive(const Primitive *const primitive)
Definition Scene.h:67
void genDirectSample(DirectEnergySampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const
Sample direct lighting for a target position.
Definition Scene.cpp:77
const Emitter * pickEmitter(SampleFlow &sampleFlow, real *out_PDF) const
Definition Scene.cpp:70
void emitRay(EnergyEmissionSampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const
Emit a ray that carries some amount of energy from an emitter.
Definition Scene.cpp:90
The root for all renderer implementations.
Definition EEngineProject.h:6