Skip to content

Using the DrawSkybox function

theproadam edited this page May 3, 2020 · 4 revisions

As renderXF is pixel fill rate limited. Drawing objects that consume the entire screen (such as a skybox) is very costly - in terms of performance. Because of this, renderXF has a built in skybox drawing function that uses parallelized pixel filling, no depth testing, and fixed data interpolation.

Creating a Cubemap

Before drawing a skybox, renderXF needs a Cubemap to draw.

GLCubemap mySkybox = new GLCubemap("skybox_data");

The folder that contains the skybox images needs to have the individual images named like this:

FRONT.jpg
BACK.jpg
TOP.jpg
BOTTOM.jpg
LEFT.jpg
RIGHT.jpg
Currently renderXF only supports loading cubemaps from a folder

Drawing the Skybox

To draw a skybox, renderXF just needs the GLCubemap instance to draw from.

GL.DrawSkybox(mySkybox);
Expect 1.2ms to 4ms draw time on 1920x1017 draw