Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextureCube.data ignores clearOnUndefined #254

Open
lukaswagner opened this issue Jun 16, 2020 · 0 comments
Open

TextureCube.data ignores clearOnUndefined #254

lukaswagner opened this issue Jun 16, 2020 · 0 comments
Labels
bug Something isn't working haeley-webgl Move/to be resolved in to haeley-webgl

Comments

@lukaswagner
Copy link
Collaborator

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);
@lukaswagner lukaswagner added the bug Something isn't working label Jun 16, 2020
@cgcostume cgcostume added the haeley-webgl Move/to be resolved in to haeley-webgl label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working haeley-webgl Move/to be resolved in to haeley-webgl
Projects
None yet
Development

No branches or pull requests

2 participants