Version

Renderer

Renderer is the low-level graphic API abstraction.

This is the class to use when you need to perform low-level drawing operations at the same level of control as the native API would provide. You are responsible for creating graphic objects, managing render state and dealing with matrices, geometry and shaders.

This interface abstracts many of the functionalities of modern graphic APIs and serves as the base for the high-level render system.

Renderer classes

The renderer provides the following classes:

  • Texture represents a 2D or 3D texture on the GPU.
  • GpuBuffer is a block of data to be consumed by the GPU such as an index or a vertex buffer.
  • Shader is a program used to compute the attributes (such as the color) of a primitive fragment (cf. Shader).
  • RenderTarget is used to perform off-screen drawing to one or more texture.

See the An application using the renderer example.

RenderSystem

This is the high-level graphic API of the library built on top of the renderer interface. It provides helper functions to draw primitives without having to manually build gpu buffers and bind shaders. It also provide functions to efficiently display text using rasterized TTF fonts (RasterFont).

But the render system does not only simplify the renderer API, it also implements a modern rendering pipeline to display complex scenes using rendering techniques such as forward and deferred shading.

When using the render system displaying a scene does not require any work besides providing a correct scene description.

Core resources

To properly initialize, the render system requires access to a set of core resources which must be found under the @core mount point (see The file system for explanations on mount points). These files are usually stored in a directory called pkg.core inside the project tree.

Render system classes

The render system introduces the following high-level classes:

  • SurfaceShader handles variant of a shader for the different passes the render system implements (cf. Surface shader).
  • RenderMaterial provides values for the variables of a surface shader.
  • RenderGeometry associate primitives and materials to represent complex composite shapes.

See the An application using the render system example.

Multi-threading and the graphic stack

Information on the RendererAsync and RenderSystemAsync asynchronous wrappers can be found in the Harfang multi-threading model page.