Texture formats?
I am trying to implement displacement mapping using a 512*512 24 bit .png noise image as my texture. But each frame takes about 1 minute to render (using a GF 7600GS graphics card). I have tried making the texture smaller and that helps a little.
But are there other ways to change the format (have looked at the glTexImage2D function) so the texture lookup will go faster?
hw acceleration for this depends on what format the GPU supports
http://www.opengl.org/wiki/index.php/Vertex_Texture_Fetch
http://www.opengl.org/wiki/index.php/Vertex_Texture_Fetch
Ok I have used:
GL_RGBA
so far (which gives the slow performance). In the wiki page it say:
Gf 6 supports only GL_TEXTURE_2D of format GL_LUMINANCE32F and GL_RGBA32F. It doesn't support any of the other floating point formats or fixed point formats. There is no floating point compressed format.
Gf 7 is similar to the Gf6.
Since I have a GF 7600GS I have tried both the :
GL_LUMINANCE32F
GL_RGBA32F
But it gives a compile error:
error C2065: 'GL_LUMINANCE32F' : undeclared identifier
Do I need to install something extra to use these formats?
GL_RGBA
so far (which gives the slow performance). In the wiki page it say:
Gf 6 supports only GL_TEXTURE_2D of format GL_LUMINANCE32F and GL_RGBA32F. It doesn't support any of the other floating point formats or fixed point formats. There is no floating point compressed format.
Gf 7 is similar to the Gf6.
Since I have a GF 7600GS I have tried both the :
GL_LUMINANCE32F
GL_RGBA32F
But it gives a compile error:
error C2065: 'GL_LUMINANCE32F' : undeclared identifier
Do I need to install something extra to use these formats?
To use floating point textures (and a lot of the other newer opengl features) you need to get a header file which defines various extensions.
Try this:
http://elf-stone.com/glee.php
Try this:
http://elf-stone.com/glee.php
I already include glew.h (something like GLee.h I assume) so the extension should be available. But maybe I manually need to enable them before generating the texture?
Quote:Original post by mltYou may need to use GL_LUMINANCE32F_ARB instead - I can't remember if glew supports the core syntax yet.
I already include glew.h (something like GLee.h I assume) so the extension should be available. But maybe I manually need to enable them before generating the texture?
That actually helped!! I used it for the InternalFormat eventhough the documentation says that only:
Must be 1, 2, 3, or 4, or
GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2,
GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12,
GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8,
GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5,
GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4,
GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16.
Are supported. When is it necessary to specify the 'format' (not the internalFormat)?
Must be 1, 2, 3, or 4, or
GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2,
GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12,
GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8,
GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5,
GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4,
GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16.
Are supported. When is it necessary to specify the 'format' (not the internalFormat)?
Quote:Original post by mltThe documentation doesn't always contain elements that were added through extensions, in this case the ARB_texture_float extension.
That actually helped!! I used it for the InternalFormat eventhough the documentation says that only:
...
Are supported.
Quote:When is it necessary to specify the 'format' (not the internalFormat)?AFAIK, only if you are supplying image data (i.e. when the last parameter is not null).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement