cginternals / cginternals/webgl-operate

TextureCube.data ignores clearOnUndefined

Open
#254 0 comments 0 reactions 0 assignees View on GitHub
bug haeley-webgl
Dominant language
TypeScript
Stars
170
Forks
25
PR merge metrics
No merged PRs in 30d

Description

The parameter is used e.g. by `resize` to indicate that empty data should be assigned in order to actually change the buffer size. Instead, nothing happens since no data is passed. This results in `resize` not resizing the texture.

Expected usage of `resize`:
```
this._texture.resize(this._resolution, true, true);
```
This does not resize the texture, as the buffers are unaffected.

Workaround for resizing a `TextureCube` - manually setting new buffers:
```
this._texture.resize(this._resolution, true, false);
const size = 4 * this._resolution * this._resolution; // for RGBA tex
this._texture.data({
clearOnUndefined: true,
positiveX: new Uint8Array(size),
negativeX: new Uint8Array(size),
positiveY: new Uint8Array(size),
negativeY: new Uint8Array(size),
positiveZ: new Uint8Array(size),
negativeZ: new Uint8Array(size),
}, 0, false, true);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the TextureCube.data implementation and its interaction with resize. Reproduce the reported resize call with clearOnUndefined enabled, then verify that the texture buffers change size without manually supplying six new Uint8Array buffers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.