-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I load a png image with transparent pixel
threejs is 0,0,0,0

// three_r148/src/extras/ImageUtils.js after line 49
const context = canvas.getContext('2d')
const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
console.log(imageData)
for (let i = 0; i < imageData.width * imageData.height; i++) {
const r = imageData.data[i * 4]
const g = imageData.data[i * 4 + 1]
const b = imageData.data[i * 4 + 2]
const a = imageData.data[i * 4 + 3]
console.log(i, '--', r, g, b, a)
}
node-three-gltf is 255,255,255,0

const textureLoader = new TextureLoader()
const metalnessMap = await textureLoader.loadAsync('./assets/textures/metalness.png')
// metalnessMap.encoding = sRGBEncoding
if (metalnessMap?.source?.data) {
const imageData = metalnessMap.source.data
for (let i = 0; i < imageData.width * imageData.height; i++) {
const r = imageData.data[i * 4]
const g = imageData.data[i * 4 + 1]
const b = imageData.data[i * 4 + 2]
const a = imageData.data[i * 4 + 3]
console.log(i, '--', r, g, b, a)
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels