Rendu
A lightweight rendering engine for experimentations
|
PBR rendering demonstration and interactions. More...
#include <PBRDemo.hpp>
Public Member Functions | |
PBRDemo (RenderingConfig &config, Window &window) | |
void | draw () override |
void | update () override |
void | physics (double fullTime, double frameTime) override |
void | resize () override |
Public Member Functions inherited from CameraApp | |
CameraApp (RenderingConfig &config, Window &window) | |
virtual void | update () override |
virtual void | physics (double fullTime, double frameTime) |
Public Member Functions inherited from Application | |
Application (RenderingConfig &config, Window &window) | |
virtual void | draw ()=0 |
virtual void | update () |
virtual void | finish () |
virtual void | resize ()=0 |
double | timeElapsed () |
double | frameTime () |
double | frameRate () |
Window & | window () |
virtual | ~Application () |
Application (const Application &)=delete | |
Application & | operator= (const Application &)=delete |
Application (Application &&)=delete | |
Application & | operator= (Application &&)=delete |
Private Types | |
enum class | RendererMode : int { DEFERRED , FORWARD } |
Private Member Functions | |
void | setScene (const std::shared_ptr< Scene > &scene) |
void | createShadowMaps (ShadowMode mode) |
void | updateMaps () |
Private Attributes | |
std::vector< std::unique_ptr< ShadowMap > > | _shadowMaps |
The lights shadow maps. | |
std::vector< std::unique_ptr< Probe > > | _probes |
The environment probes. | |
std::unique_ptr< DeferredRenderer > | _defRenderer |
Deferred PBR renderer. | |
std::unique_ptr< ForwardRenderer > | _forRenderer |
Forward PBR renderer. | |
std::unique_ptr< PostProcessStack > | _postprocess |
Post-process renderer. | |
std::shared_ptr< DeferredRenderer > | _probesRenderer |
Renderer for the light probes. | |
std::unique_ptr< DebugRenderer > | _debugRenderer |
Forward PBR renderer. | |
Texture | _finalRender |
Final texture. | |
Program * | _finalProgram |
Final display program. | |
std::vector< std::shared_ptr< Scene > > | _scenes |
The existing scenes. | |
std::vector< std::string > | _sceneNames |
The associated scene names. | |
GPUQuery | _shadowTime |
Timing for the shadow mapping. | |
GPUQuery | _probesTime |
Timing for the probe rendering. | |
GPUQuery | _inteTime |
Timing for the probe preconvolution. | |
GPUQuery | _copyTime |
Timing for the probe irradiance SH coeffs. | |
GPUQuery | _rendererTime |
Timing for the scene rendering. | |
GPUQuery | _postprocessTime |
Timing for the postprocessing. | |
Query | _copyTimeCPU |
CPU timing for the probe irradiance SH coeffs. | |
Query | _totalTime |
CPU timing for one full frame. | |
RendererMode | _mode = RendererMode::DEFERRED |
Active renderer. | |
ShadowMode | _shadowMode = ShadowMode::VARIANCE |
The shadow rendering technique. | |
size_t | _currentScene = 0 |
Currently selected scene. | |
const int | _frameCount = 2 |
Number of frames to update a probe over. | |
int | _frameID = 0 |
Current frame count (will loop) | |
bool | _paused = false |
Pause animations. | |
bool | _showDebug = false |
Debug scene objects. | |
Additional Inherited Members | |
Protected Member Functions inherited from CameraApp | |
void | freezeCamera (bool shouldFreeze) |
Protected Attributes inherited from CameraApp | |
ControllableCamera | _userCamera |
The interactive camera. | |
Protected Attributes inherited from Application | |
RenderingConfig & | _config |
The current configuration. | |
std::unique_ptr< DebugViewer > | _debug |
Debug viewer. | |
PBR rendering demonstration and interactions.
Inherits CameraApp.
|
strongprivate |
The type of renderer used to display the scene.
|
explicit |
Constructor.
config | the configuration to apply when setting up |
window | the window to render to |
|
private |
Create shadow maps for the current scene, for a given mode.
mode | the shadow type to prepare for when creating the shadow maps |
|
overridevirtual |
Draw call.
Implements Application.
|
overridevirtual |
Perform physics simulation update.
fullTime | the time elapsed since the beginning of the render loop |
frameTime | the duration of the last frame |
Reimplemented from CameraApp.
|
overridevirtual |
Handle a window resize event, the configuration has been updated with the new size.
Implements Application.
|
private |
Select the scene to display.
scene | the scene to use |
|
overridevirtual |
Per-frame update.
Reimplemented from CameraApp.
|
private |
Update the real-time shadow maps and probes.