Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Texture lookup in GLSL

This topic is 4816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am working on accessing a texture in GLSL through the VS. Here is what I have so far. BTW do you have to use a 32bit file format with a texture lookup as of now?
uniform sampler2D hm;

void main(void)
{
    vec4 displacement = texture2D(hm, gl_MultiTexCoord0);
    vec4 position = gl_Vertex;
    position.y = displacement.r;
    gl_Position = gl_ModelViewProjectionMatrix * position;
}



Cause as of now its SLOW with Rendermonkey? Thanks

Share this post


Link to post
Share on other sites
Advertisement
the only cards which can perform vertex texture lookups in hardware right now are the GF6x00 series (maybe 3DLabs cards as well). For the NV cards it must be a floating point texture you are accessing and iirc it must be a power of two (NV's developer pages have more details on what you can and cant access).

And vertex texture lookups are currently MUCH slower than texture lookups in a fragmenmt shader.

Share this post


Link to post
Share on other sites
Quote:
Original post by phantom
the only cards which can perform vertex texture lookups in hardware right now are the GF6x00 series (maybe 3DLabs cards as well). For the NV cards it must be a floating point texture you are accessing and iirc it must be a power of two (NV's developer pages have more details on what you can and cant access).

And vertex texture lookups are currently MUCH slower than texture lookups in a fragmenmt shader.


True but kind of hard to displacement mapping without them in the vertex shader... Unless you are going to send some new vertex data as uniform then I can't see that being fast either when you send a 129x129 worth of vertices to the VS?

Share this post


Link to post
Share on other sites
>Cause as of now its SLOW with Rendermonkey?
Yea, if you have an unsupported textureformat, the drivers will automatically slip into software Vertex Shaders.

>And vertex texture lookups are currently MUCH slower than texture lookups in a fragmenmt >shader.
Are they? I've been trying to find good info on this stuff without much luck.

Share this post


Link to post
Share on other sites
Quote:
Original post by Erik Sintorn
>Cause as of now its SLOW with Rendermonkey?
Yea, if you have an unsupported textureformat, the drivers will automatically slip into software Vertex Shaders.

>And vertex texture lookups are currently MUCH slower than texture lookups in a fragmenmt >shader.
Are they? I've been trying to find good info on this stuff without much luck.


I am using a .dds RGBA 32bit each channel texture. That is the only format I know of that is supported by GLSL for vertex texture lookups.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!