Skip to content

[FEAT] Add cubemap loading support #567

@Miou-zora

Description

@Miou-zora

Problem Statement

The engine currently has no support for loading cubemap textures. This is a prerequisite for rendering skyboxes and environment-based lighting effects, which are standard features in modern 3D engines.

Proposed Solution

Add a cubemap loading system to the engine that supports:

  • Loading six individual face images (right, left, top, bottom, front, back) from disk and assembling them into a cubemap texture.
  • Optionally loading cubemaps from a single cross or strip layout image.
  • Uploading the cubemap to the GPU as a VkImageViewType::eCube Vulkan image.
  • Exposing the cubemap as a usable asset/resource through the engine's resource management system.

Alternative Solutions

  • Support only KTX or DDS cubemap formats (single-file, GPU-friendly) — less flexible but avoids manual face assembly.
  • Defer cubemap loading to user code and only provide GPU upload utilities — lower scope but forces repetitive user code.

Use Cases

  • Use case 1: A developer loads a set of six HDR face images and gets a ready-to-use cubemap texture for environment mapping.
  • Use case 2: A skybox renderer (see related issue) uses the cubemap loading system to obtain its texture without handling GPU details directly.
  • Use case 3: A future PBR lighting system uses cubemaps for image-based lighting (IBL) probes.

Impact

  • New API surface for cubemap asset loading — additive, no breaking changes.
  • Requires Vulkan cubemap image creation and upload support.
  • No changes to existing rendering paths.

Implementation Details (optional)

  • Create a CubemapLoader (or extend the existing texture loader) to handle the six-face assembly.
  • Use VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT and VkImageViewType::eCube for the Vulkan image and image view.
  • Integrate with the engine's existing asset/resource system.
  • Provide a usage example or test demonstrating a cubemap being loaded and sampled in a shader.

Additional Context

This feature is a prerequisite for the skybox rendering feature.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Not planned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions