Rendu
A lightweight rendering engine for experimentations
|
Renders the main game scene. More...
#include <GameRenderer.hpp>
Public Member Functions | |
GameRenderer (const glm::vec2 &resolution) | |
void | drawPlayer (const Player &player, Texture &dst) const |
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 | |
Renderer & | operator= (const Renderer &)=delete |
Renderer (Renderer &&)=delete | |
Renderer & | operator= (Renderer &&)=delete |
Layout | outputColorFormat () const |
Layout | outputDepthFormat () const |
Private Member Functions | |
void | drawScene (const Player &player) const |
Private Attributes | |
Texture | _sceneNormal |
Scene normal texture. | |
Texture | _sceneMaterial |
Scene material texture. | |
Texture | _sceneDepth |
Scene depth texture. | |
Texture | _lighting |
Texture containing the lit result. | |
std::unique_ptr< SSAO > | _ssaoPass |
Screen space ambient occlusion pass. | |
Program * | _fxaaProgram |
Antialiasing program. | |
Program * | _coloredProgram |
Base scene rendering program. | |
Program * | _compositingProgram |
Lighting program. | |
const Mesh * | _ground |
Terrain mesh. | |
const Mesh * | _head |
Snake head mesh. | |
const Mesh * | _bodyElement |
Body elements and items mesh. | |
Camera | _playerCamera |
The player camera (fixed). | |
const Texture * | _cubemap |
Environment map for reflections. | |
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. | |
Renders the main game scene.
Inherits Renderer.
|
explicit |
Constructor
resolution | the rendering resolution |
Draw the game scene
player | the state of the game and player |
dst | the destination texture |
|
private |
Draw the scene to the current bound framebuffer.
player | the player state |
|
overridevirtual |
Resize internal buffers based on new window size.
width | new width |
height | new height |
Reimplemented from Renderer.