Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PBRDemo Class Referencefinal

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 ()
 
Windowwindow ()
 
virtual ~Application ()
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (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.
 

Detailed Description

PBR rendering demonstration and interactions.

Inherits CameraApp.

Member Enumeration Documentation

◆ RendererMode

enum class PBRDemo::RendererMode : int
strongprivate

The type of renderer used to display the scene.

Constructor & Destructor Documentation

◆ PBRDemo()

PBRDemo::PBRDemo ( RenderingConfig config,
Window window 
)
explicit

Constructor.

Parameters
configthe configuration to apply when setting up
windowthe window to render to

Member Function Documentation

◆ createShadowMaps()

void PBRDemo::createShadowMaps ( ShadowMode  mode)
private

Create shadow maps for the current scene, for a given mode.

Parameters
modethe shadow type to prepare for when creating the shadow maps

◆ draw()

void PBRDemo::draw ( )
overridevirtual

Draw call.

Implements Application.

◆ physics()

void PBRDemo::physics ( double  fullTime,
double  frameTime 
)
overridevirtual

Perform physics simulation update.

Parameters
fullTimethe time elapsed since the beginning of the render loop
frameTimethe duration of the last frame
Note
This function can be called multiple times per frame.

Reimplemented from CameraApp.

◆ resize()

void PBRDemo::resize ( )
overridevirtual

Handle a window resize event, the configuration has been updated with the new size.

Implements Application.

◆ setScene()

void PBRDemo::setScene ( const std::shared_ptr< Scene > &  scene)
private

Select the scene to display.

Parameters
scenethe scene to use

◆ update()

void PBRDemo::update ( )
overridevirtual

Per-frame update.

Reimplemented from CameraApp.

◆ updateMaps()

void PBRDemo::updateMaps ( )
private

Update the real-time shadow maps and probes.


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