Sign in to follow this  
mlt

Texture formats?

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Quote:
Original post by mlt
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?
You may need to use GL_LUMINANCE32F_ARB instead - I can't remember if glew supports the core syntax yet.

Share this post


Link to post
Share on other sites
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)?

Share this post


Link to post
Share on other sites
Quote:
Original post by mlt
That actually helped!! I used it for the InternalFormat eventhough the documentation says that only:
...
Are supported.
The documentation doesn't always contain elements that were added through extensions, in this case the ARB_texture_float extension.
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).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this