Jump to content
  • Advertisement
Sign in to follow this  
LordOrion

OpenGL Usage of glTexCoord2s()

This topic is 3776 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

Hi to everyone: I'm trying to reduce the memory footprint of one OpenGL-based app I'm currently writing. In order to reduce the size of geometry to be sent to the GPU at each frame I've changed the data type of normals and colors for float to integers and I wish to do the same even for texture coordinates. However, I've not found any reference on how the s and t components have to be interpreted when using 16-bit singe short data type: Are them interpreted directly as number of pixels or, (like for normals) mapped to [-1.0, 1.0] range (where -32768 = -1.0 and +32767 = 1.0)? There is no reference to this in both blue and red book... Thank you very much in advance. Simone

Share this post


Link to post
Share on other sites
Advertisement
Integer texture coordinates are mapped 1:1. Meaning, you can pass your integers directly to glTexCoord2f and get the same result. If you want another range (for example texel based, or full-integer-range based), scale the texture matrix accrodingly.

Share this post


Link to post
Share on other sites
I'd first check if you actually manage to save anything with those integers. It may turn out graphics driver converts your integers back to floats before sending em to a card.

Share this post


Link to post
Share on other sites
Thank you very much..

so is it possible that the Driver converts back the tex-coords to float before sending them to the GPU... And hence my optimization is by the fact an "unoptimization" :-(.

Ok, so I guess I have to find another solution.

[Edited by - LordOrion on February 25, 2008 3:54:18 AM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!