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

Renders a scene with an alternating black and white region style, using the stencil buffer to count primitives covering each pixel. More...

#include <StenciledRenderer.hpp>

Public Member Functions

 StenciledRenderer (const glm::vec2 &resolution)
 
void setScene (const std::shared_ptr< Scene > &scene)
 
void draw (const Camera &camera, Texture *dstColor, Texture *dstDepth, uint layer=0) override
 
void resize (uint width, uint height) override
 
- Public Member Functions inherited from Renderer
 Renderer (const std::string &name)
 
virtual void draw (const Camera &camera, Texture *dstColor, Texture *dstDepth, uint layer=0)
 
virtual void resize (uint width, uint height)
 
virtual void interface ()
 
virtual ~Renderer ()=default
 
 Renderer (const Renderer &)=delete
 
Rendereroperator= (const Renderer &)=delete
 
 Renderer (Renderer &&)=delete
 
Rendereroperator= (Renderer &&)=delete
 
Layout outputColorFormat () const
 
Layout outputDepthFormat () const
 

Private Attributes

Texture _sceneColor
 Scene color texture.
 
Texture _sceneDepth
 Scene depth texture.
 
std::shared_ptr< Scene_scene
 The scene to render.
 
Program_objectProgram
 Basic stencil program.
 
Program_fillProgram
 Final screen filling.
 

Additional Inherited Members

- Protected Attributes inherited from Renderer
std::string _name
 Debug name.
 
Layout _colorFormat = Layout::NONE
 The preferred output format for a given renderer.
 
Layout _depthFormat = Layout::NONE
 The preferred output format for a given renderer.
 

Detailed Description

Renders a scene with an alternating black and white region style, using the stencil buffer to count primitives covering each pixel.

Inherits Renderer.

Constructor & Destructor Documentation

◆ StenciledRenderer()

StenciledRenderer::StenciledRenderer ( const glm::vec2 &  resolution)
explicit

Constructor.

Parameters
resolutionthe initial rendering resolution

Member Function Documentation

◆ draw()

void StenciledRenderer::draw ( const Camera camera,
Texture dstColor,
Texture dstDepth,
uint  layer = 0 
)
overridevirtual

Draw from a given viewpoint.

Parameters
camerathe rendering viewpoint
dstColorthe destination color texture (optional, see outputColorFormat)
dstDepththe destination depth texture (optional, see outputDepthFormat)
layerthe layer to write to in the target

Reimplemented from Renderer.

◆ resize()

void StenciledRenderer::resize ( uint  width,
uint  height 
)
overridevirtual

Handle a window resize event.

Parameters
widththe new width
heightthe new height

Reimplemented from Renderer.

◆ setScene()

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

Set the scene to render.

Parameters
scenethe new scene

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