Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: float texture: OpenGL vs OpenGL ES

Threaded View

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    13

    float texture: OpenGL vs OpenGL ES

    Hi,

    I'm a little lost on how to create a float texture, between OpenGL 2.0 and OpenGL ES 2.0...


    I used to do this on OpenGL:


    Code :
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, data);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, width, height, 0, GL_RGBA, GL_FLOAT, data);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA32F_ARB, width, height, 0, GL_ALPHA, GL_FLOAT, data);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA16F_ARB, width, height, 0, GL_ALPHA, GL_FLOAT, data);


    The 3rd argument being the internal storage format (VRAM), the 7th the number of channel in the source picture (RAM), and the 8th the source picture channel format (RAM).
    However it looks like theses rules are no more valid with OpenGL ES 2, the manual is not very clear on that matter... From what I've understood only the 8th argument define the internal channel format ?


    Code :
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_FLOAT, data);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_HALF_FLOAT_OES, data);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_FLOAT, data);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_HALF_FLOAT_OES, data);


    1/ Am I right in both my examples ?
    2/ Is there an universal way (GL/GL ES compatible) of creating a float texture ?
    3/ With GL ES, what's the use of the defines GL_RGBA32F_EXT, GL_RGBA16F_EXT, GL_ALPHA32F_EXT and GL_ALPHA16F_EXT ?
    4/ With GL ES, when you create a FLOAT16 texture, does it assume the source picture is FLOAT32 ?


    Thanks !
    Last edited by rldivide; 12-09-2012 at 07:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •