Skip to content

TextureCube.data ignores clearOnUndefined #254

@lukaswagner

Description

@lukaswagner

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghaeley-webglMove/to be resolved in to haeley-webgl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions