beyond-all-reason / beyond-all-reason/RecoilEngine

[Feature Request] Extended SaveImage formats and TextureInfo

Open
#864 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
683
Forks
293
Avg merge
3d 2h
Merged PRs (30d)
40

Description

1. Add _grayscale8bit_ option for **gl.SaveImage** and allow **_alpha_** option for both grayscale8bit and grayscale16bit.
Currently, only _grayscale16bit_ is available, without alpha channel.
Most common example usage of grayscale8bit is a typical normal texture. It only requires 2 channels and does not require 16bit precision. Another example can be a lookup texture, such as BRDF Lut, or any other that requires only 2 channels.
So if you want to generate such textures via Spring and save them, and then load, you need that.
Even bigger problem for me is that I cannot use a simple 8-bit gray, because my texture is quite big (can be easily 8K). It is a splat map, it requires only 1 byte to encode 8 splats, which then are smoothed out on fly. It is not the only big texture that has to be loaded, so memory cannot be wasted.

2. Extend **gl.TextureInfo** with following fields:
_.channels_ (a number of color channels)
_.pixelBytes_ (total byte size of a pixel)

Contributor guide

Open the contributing guide

Research direction

Start by locating the gl.SaveImage and gl.TextureInfo entry points and tracing the existing grayscale16bit format handling. Confirm how image formats and texture metadata are represented, then verify that grayscale8bit, alpha options, channels, and pixelBytes are exposed consistently and covered by the relevant tests or examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.