Jump to content
  • Advertisement
Sign in to follow this  
mlt

OpenGL Analysing a texture?

This topic is 3670 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 have a downloaded a 512*512 gray scale texture that I would like to use in a Cg vertex program. I use the following InternalFormat: GL_RGBA In the vertex program I get the texture coordinates from the application (OpenGL):
struct vertex_input
{
  float4 position  : POSITION;
  float2 uv        : TEXCOORD0;
  float4 normal    : NORMAL;
};


Now I would like to know the following two things: 1) In what range are the uv coordinates, [0-1], [-1-1]...etc? And where do I find documentation for texture coordinate ranges? 2) In what range are the values in the texture? [Edited by - mlt on November 29, 2008 6:33:46 AM]

Share this post


Link to post
Share on other sites
Advertisement
1) texture coordinates can be anything you like. They are not clamped like it is the case for glColor4f.
http://www.opengl.org/wiki/index.php/Texture_Mapping

2) If you sample a texture in a shader and if the shader is some integer format such as GL_RGBA8, then values are normalized 0.0 - 1.0
If it is a floating format like GL_RGBA32F_ARB, then you can have whatever you want.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!