-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Open
Labels
Description
Description
Creating a non-RGBA texture and using the partial texture update via addUpdateRange doesn't update the intended part of the texture.
Reproduction steps
See fiddle https://jsfiddle.net/vx3u16zj/2/
Code
const width = 8;
const height = 8;
const data = new Float32Array(width * height);
for (let i = 0; i < data.length; ++i) {
data[i] = i / data.length;
}
const dataTexture = new THREE.DataTexture(data, width, height);
dataTexture.format = THREE.RedFormat;
dataTexture.type = THREE.FloatType;
dataTexture.internalFormat = 'RED32F';
dataTexture.needsUpdate = true;
setTimeout(() => {
data.fill(0);
// this should update the 12 texels starting at #32
// instead it updates the 3 texels starting at #8
dataTexture.addUpdateRange(32, 12);
dataTexture.needsUpdate = true;
}, 1000);Live example
https://jsfiddle.net/vx3u16zj/2/
Screenshots
Version
0.181.2
Device
No response
Browser
No response
OS
No response