Usage of glTexCoord2s()

Started by
2 comments, last by LordOrion 16 years, 2 months ago
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
Bye and Thanks!SiS.Professional Software Developer.
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.
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.
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]
Bye and Thanks!SiS.Professional Software Developer.

This topic is closed to new replies.

Advertisement