I'm using Glumpy and I'm trying to bind a texture as GL_RGB32F
. It appears that it binds the texture as GL_RGB
, even though my numpy array is of type np.float32
. The values this array contains are outside the 0..1 range, and I need these values in a fragment shader unclipped.
compute = gloo.Program(compute_vertex, compute_fragment, count=4)
compute["matte"] = matte
compute["matte"].interpolation = gl.GL_NEAREST
compute["matte"].wrapping = gl.GL_CLAMP_TO_EDGE
compute["distanceField"] = alpha
compute["distanceField"].interpolation = gl.GL_NEAREST
compute["distanceField"].wrapping = gl.GL_CLAMP_TO_EDGE
compute["position"] = [(-1, -1), (-1, +1), (+1, -1), (+1, +1)]
compute["texcoord"] = [(0, 0), (0, 1), (1, 0), (1, 1)]
print(matte.dtype)
print(gl.GL_RGB32F)
print(compute["matte"].gpu_format)
print(compute["distanceField"].gpu_format)
The output is
float32
GL_RGB32F (34837)
GL_RGB (6407)
GL_RED (6403)
How can I bind the matte
array as GL_RGB32F
and the distanceField
as GL_R32F
?