Table of Contents

Class CubemapSky

Namespace
PopcorningGuineaPig.Engine.Rendering
Assembly
PopcorningGuineaPig.Engine.dll

Cubemap sky loaded through IVirtualFileSystem. Six images, or one lat-long (raylib's LoadTextureCubemap has no lat-long layout, so the engine converts it). Drawn first inside BeginMode3D. The five-face Skybox stays for painted skies. IBL is a hemisphere taken from this image and is off until SetIbl(bool). See docs/architecture/skybox.md.

public sealed class CubemapSky : IDisposable
Inheritance
CubemapSky
Implements
Inherited Members

Fields

FaceSize

Face size of a generated cubemap. Six of these stay under the 2048 RGBA8 budget.

public const int FaceSize = 512

Field Value

int

Properties

Ibl

High lighting. Off leaves the sky picture and adds no light.

public bool Ibl { get; }

Property Value

bool

IsReady

public bool IsReady { get; }

Property Value

bool

Methods

CreateTestDay()

In-memory day sky so an example can show the cubemap without a file.

public static CubemapSky CreateTestDay()

Returns

CubemapSky

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Draw()

Draw inside BeginMode3D, before the world. The cube stays on the camera.

public void Draw()

Irradiance(Vector3)

Irradiance for normal. Zero while Ibl is off, so Min stays the sky with no extra light.

public Vector3 Irradiance(Vector3 normal)

Parameters

normal Vector3

Returns

Vector3

LoadFaces(IVirtualFileSystem, string, string, string, string, string, string, int)

Six face images from the VFS, order +X −X +Y −Y +Z −Z. Not Assimp.

public static CubemapSky? LoadFaces(IVirtualFileSystem vfs, string posX, string negX, string posY, string negY, string posZ, string negZ, int faceSize = 512)

Parameters

vfs IVirtualFileSystem
posX string
negX string
posY string
negY string
posZ string
negZ string
faceSize int

Returns

CubemapSky

LoadLatLong(IVirtualFileSystem, string, int)

One lat-long image (.hdr or .png) from the VFS. Not Assimp.

public static CubemapSky? LoadLatLong(IVirtualFileSystem vfs, string path, int faceSize = 512)

Parameters

vfs IVirtualFileSystem
path string
faceSize int

Returns

CubemapSky

SetIbl(bool)

public void SetIbl(bool enabled)

Parameters

enabled bool