I have something like
...
this.propsTexture = this._createPropsTexture(size);
this.offsetTexture = this._createPropsTexture(size);
...
private _createPropsTexture(size: number) {
return new DataTexture(
new Uint8Array(size * size * 4),
size,
size,
...DEFAULT_PARAMS
);
}
If i were to log this i get what i expect.
Elsewhere:
this._offsetsTexture.image.data[i4 + 1] = 5 // THIS WORKS!!!!
However, if i follow up with exactly this:
console.log("props image", this._propsTexture.image);
console.log("offset image", this._offsetsTexture.image);
const debug = this._offsetTexture.image.data[i4 + 1]; // line 136 that throws
console.log("data array values", debug);
The first two logs to .image
yield what i expect, size of 1024
and a typed array. The line 136 that fails is this attempt to read from the array:
If i put a breakpoint, and hover over the .image
at line 163 i see this:
I am quite baffled, why am i seeing data:null
here? Line right above it logs it as being Uint8Array
.