Using a single float texture to pass to a GLSL shader (GL_R32F not available)
a hardware component delivers me single float textures, which I want to pass in the shader to modify my geometry. Unfortunately, I am not sure how I can do that with the Oculus SDK. I'm using the Oculus SDK version 1.8.0 (with OpenGL 4.5).
But I’m unsure how I need to change the following line, which works for a 4 uchar texture:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1280, 720, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);I would change the first GL_RGBA to GL_R32F (see doc), the 2nd to
GL_RED since it’s one channel and GL_UNSIGNED_BYTE to GL_FLOAT:
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 1280, 720, 0, GL_RED, GL_FLOAT, NULL);https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
But GL_R32F is not available for me in the Oculus SDK. Can you give me any pointers? I've looked for the definition of it in the SDK, but I couldn't find it. Using GL_RGBA instead just gives me "interpret float as 4 uchar" noise.
http://stackoverflow.com/questions/43087640/using-a-single-float-texture-in-opengl-with-the-oculus-sdk
