Hi @Mugen87
I want to know how to create and read float32 datatexture without clamping in three.js and glsl ?
and how is it supposed to read in shader code?
i am using custom shader !!
this is the way, i thought it is but i am sure that i am not fully correct:
var imageData = new Float32Array(4 * persDatas[threshold].length)
for(var x=0; x<length; x++)
{
var segID = Math.floor((255 * persDatas[threshold][x]) / response.data.max)
imageData[x] = segID
}
var texture = new THREE.DataTexture(
imageData,
4104,
1856,
THREE.RedFormat,
THREE.FloatType
)
and in my shader i will read the texture as:
float segID = sampleTexture(persTexture, vPosition.xy).r
All float32 type i see in three.js are clamped type which clamp value from [0,1.0].
I want the exact value this is put into that position in that texture data.
does that mean i have to send value only into integer to get exact value?