Renderers

Acron draws through a graphics pipe: a plug-in that speaks one graphics API (see The Graphics Pipe). Each platform has a default, and a game can ask for another one in its configuration.

Renderer

Plug-in

Where

OpenGL

acrongl

Windows, macOS and Linux; the default there

OpenGL ES 2 and 3

acrongles2

Android; the default there

WebGL 2

built in

the web; the only renderer of a web build (see The Web)

Vulkan

p3vulkandisplay

Python games on the desktop (on macOS through MoltenVK); chosen in the configuration

GX

built in

the Wii; the only renderer of a Wii build (see Building for the Wii)

Software

p3tinydisplay

Windows and Linux; a fallback that needs no graphics driver

The web and the Wii builds are static programs with their renderer linked in, so there is nothing to choose there. On the desktop and Android, the plug-in is a library beside the engine, loaded when the first window opens.

Choosing a Renderer

The load-display variable names the plug-in tried first, and each aux-display line a fallback, tried in order when the first cannot open a window (no driver for it, for instance). Set them in the game’s configuration, or in code before the window opens:

from acron.core import load_prc_file_data
from direct.showbase.ShowBase import ShowBase

load_prc_file_data("", """
load-display p3vulkandisplay
aux-display acrongl
""")

base = ShowBase()
print(base.win.gsg.driver_renderer)

The plug-in has to be shipped with the game: a Python game names it in build_apps’ plugins option ('p3vulkandisplay' beside 'acrongl'; see List of Build Options).

Vulkan

The Vulkan renderer is the engine’s newest, and follows the Vulkan renderer under development in the engine Acron is built on. It is not the default anywhere: OpenGL remains the most complete renderer and the one this manual’s examples are written against. Use Vulkan when you have a reason to, and test the game with it on each platform you ship.

  • It comes with the acron wheel. The C++ desktop SDK is built without it, so a C++ game draws with OpenGL.

  • Shaders, GLSL or Cg, are compiled to SPIR-V by the engine’s shader pipeline when they are loaded.

  • On macOS it runs on MoltenVK, Vulkan on top of Metal.

  • With both acrongl and p3vulkandisplay loaded on macOS, the log shows warnings that a Cocoa class is implemented twice: both plug-ins carry the same window code. The warnings are harmless.

  • Its tuning variables (vulkan-memory-page-size, vulkan-staging-buffer-size, vulkan-global-uniform-buffer-size) are rarely needed; see List of All Config Variables.

What each renderer supports is compared in Table of features supported per graphic renderer.