PDA

View Full Version : Fixed point data support?



tman123
02-26-2009, 10:19 PM
Can anybody please tell me if opengl supports fixed point data for vertex/color/texture etc buffers?
are there any extensions which might do that?
I am not interested in opengl es for this.

thanks.

scratt
02-27-2009, 12:31 AM
There are various data types for OpenGL data.

Colour can be bytes for example.
And Indices can be shorts.
Vertices and the like can be both integer and float.
Texture data is usually integer format, but can also be floating point.

You can use GL_SHORT, GL_INT as well as GL_FLOAT and GL_DOUBLE, and some others..

For example, take a look at the spec for glVertexPointer..
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertexpointer.html

There are also short floating point formats for some commands AFAIK.
I have not used them though.

Is that what you are referring to?

Or did you actually mean with GLSL, i.e. Shaders?

tman123
02-27-2009, 02:12 AM
Sorry for not being clear.

I was referring to the fixed point format available in OpenGL ES (16 bit integer, 16 bit fractional part - total 32 bit integer).
OpenGL arrays/vertices etc are traditionally specified in the form you specified. I am looking at any extension that supports the fixed point data type I am referring to in desktop OpenGL.

Thanks!

ZbuffeR
02-27-2009, 06:41 AM
None that I know of.
Just use 32 bit integer, and divide by 65536 with the modelview matrix.