Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
|
The rendering system in Grindstone is built for flexibility and extensibility. It is structured around a core concept of Renderers, which transform camera and world data into render commands for the GPU. This document provides an overview of how rendering works within the Grindstone Engine.
A Renderer in Grindstone is responsible for turning a camera view of the world into rendered output. The engine uses a renderer associated with each camera (e.g., for split-screen game views, editor view, etc).
Renderers are created using a RendererFactory, which stores objects and settings common to all renderer instances, like shared resources or shader configurations. The RenderFactory is set by a plugin.
Every frame, the engine renders the game using the following inputs:
The renderer then does the following:
Grindstone will support two Renderer plugins out of the box:
To support rendering various asset types, Grindstone uses **AssetRenderer**s (e.g., Mesh3dRenderer
). These are specialized classes that know how to render specific asset types. We also intend to support TerrainRenderer
, ParticleRenderer
, and SkeletalMeshRenderer
.
Asset renderers are invoked using:
Render queues are used to organize the order of rendering:
GeometryDepthPrepass
: Draw all depth-tested opaque geometry to reduce the cost of drawing the pixels fullyGeometryOpaque
: For depth-tested opaque lit geometryGeometrySky
: Draw skies — this is done separately because they appear behind anything elseGeometryUnlit
: For depth-tested opaque objects that are unlitGeometryTransparent
: For blended objectsMaterials are configurable and can be edited in the Grindstone Editor’s Inspector Panel. They can be attached to an object via a MeshRendererComponent, whereas Meshes can be attached to an object via a MeshComponent. They are both required to render static geometry.
Post-Processing steps refine and stylize the rendered output after lighting is complete. These are defined by the individual renderers. These steps include Screen Space Ambient Occlusion, Screen Space Reflections, Depth of Field, Bloom, Chromatic Abberation, Vignette, Film Grain, and Tonemapping.
At the lowest level, Grindstone relies on a Render Hardware Interface (RHI) to abstract over graphics APIs. The RHI is implemented as a set of base interfaces, with concrete implementations in plugins for:
This makes the engine portable and extensible for different platforms and GPU backends. This includes objects such as Graphics Core
, Buffer
, Command Buffer
, Descriptor Set
, Descriptor Set Layout
, Framebuffer
, Graphics Pipeline
, Compute Pipeline
, Image
, RenderPass
, Sampler
, Vertex Array Object
, Window Graphics Binding
.