Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
PathTracerApp.hpp
1#pragma once
2#include "PathTracer.hpp"
3#include "BVHRenderer.hpp"
4
5#include "Application.hpp"
6#include "scene/Scene.hpp"
7#include "resources/Texture.hpp"
8#include "input/ControllableCamera.hpp"
9
10#include "Common.hpp"
11
17class PathTracerApp final : public CameraApp {
18
19public:
25 explicit PathTracerApp(RenderingConfig & config, Window & window, const std::shared_ptr<Scene> & scene);
26
28 void draw() override;
29
32 void update() override;
33
36 void physics(double fullTime, double frameTime) override;
37
40 void resize() override;
41
42private:
43
46
47 std::shared_ptr<Scene> _scene;
48 std::unique_ptr<PathTracer> _pathTracer;
49 std::unique_ptr<BVHRenderer> _bvhRenderer;
52
53 int _samples = 8;
54 int _depth = 5;
55 float _exposure = 1.f;
56 bool _showRender = false;
57 bool _lockLevel = true;
58 bool _liveRender = false;
59};
double frameTime()
Definition: Application.cpp:87
Window & window()
Definition: Application.cpp:95
Application with an interactive camera.
Definition: Application.hpp:89
Viewer coupled with a basic diffuse path tracer. The user can move the camera anywhere and trigger a ...
Definition: PathTracerApp.hpp:17
Texture _sceneColor
Scene color texture.
Definition: PathTracerApp.hpp:50
void draw() override
Definition: PathTracerApp.cpp:47
Texture _sceneDepth
Scene depth texture.
Definition: PathTracerApp.hpp:51
Texture _renderTex
The result texture and image.
Definition: PathTracerApp.hpp:45
int _samples
Samples count.
Definition: PathTracerApp.hpp:53
void physics(double fullTime, double frameTime) override
Definition: PathTracerApp.cpp:219
int _depth
Depth of each ray.
Definition: PathTracerApp.hpp:54
bool _lockLevel
Lock the range of the BVH visualisation.
Definition: PathTracerApp.hpp:57
std::unique_ptr< BVHRenderer > _bvhRenderer
The scene debug viewer.
Definition: PathTracerApp.hpp:49
std::unique_ptr< PathTracer > _pathTracer
The scene specific path tracer.
Definition: PathTracerApp.hpp:48
std::shared_ptr< Scene > _scene
The scene to render.
Definition: PathTracerApp.hpp:47
void update() override
Definition: PathTracerApp.cpp:100
Program * _passthrough
Passthrough program.
Definition: PathTracerApp.hpp:44
void resize() override
Definition: PathTracerApp.cpp:226
bool _liveRender
Display the result in real-time.
Definition: PathTracerApp.hpp:58
bool _showRender
Should the result be displayed.
Definition: PathTracerApp.hpp:56
float _exposure
Exposure of the displayed result.
Definition: PathTracerApp.hpp:55
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Configuration containing parameters for windows and renderers.
Definition: Config.hpp:113
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12
Represent an OS window and its associated rendering context.
Definition: Window.hpp:14