Maybe bug about DumpTools.ts

the method DumpData

I have found the code in below

// Convert if data are float32
if (data instanceof Float32Array) {
    const data2 = new Uint8Array(data.length);
    let n = data.length;
    while (n--) {
        const v = data[n];
        data2[n] = v < 0 ? 0 : v > 1 ? 1 : Math.round(v * 255);
    }
    data = data2;
}

I think v > 1? we should use 255 rather than 1?

It looks like this code is converting a float [0…1] to a uint8 [0…255]

yes,I think maybe original code

data2[n] = v < 0 ? 0 : v > 1 ? 1 : Math.round(v * 255);

maybe change to

data2[n] = v < 0 ? 0 : v > 1 ? 255 : Math.round(v * 255);

Ho! Good catch! where did you find this code?

I found at DumpTool.ts

ping @sebavan

Great catch Fix Dump tools clamping by sebavan · Pull Request #13850 · BabylonJS/Babylon.js · GitHub