Results 1 to 4 of 4

Thread: byte/short vertex/texture coordinate

  1. #1
    Junior Member
    Join Date
    Feb 2005
    Posts
    1

    byte/short vertex/texture coordinate

    In OpenGL / OpenGL ES Spec, the byte/short vertex/texture coordinate conversion seems not be defined.

    If OpenGL Spec 1.5, there is a table (2.9) describing how to convert byte/short value to float value for color, normal, and depth components.

    But there is no such table for vertex and texture coordinates.

    If I have a vertex array:
    GLshort point[] = {1, 1, 1}
    Does it means {1.0F, 1.0F, 1.0F}?

    How about texture array?
    If GLshort point[] = {1, 1} means {1.0F, 1.0F}, how can I represent texture coordinate such as {0.5F, 0.5F} by GLshort?

  2. #2

    Re: byte/short vertex/texture coordinate

    Hi.

    That is correct. Only way you can have 0.5 texture coordinate with shorts is to use texture matrix with scaling for s and t.

    If you just want 0.5 to be represented, then have a scale of 0.5 -> short of 1 will mean 0.5, short of 2 will mean 1.0 etc..

    Of course the more usual scales are for example 1/4096 or 1/256.

    --jani;

  3. #3

    Re: byte/short vertex/texture coordinate

    Still adding to my previous response.

    There is a 32-bit fixed point format for all vertex data. With that format you don't need texture matrix to do the scaling (identity) for you. Downside is that it is a 32-bit representation -> takes more memory etc.

    --jani;

  4. #4
    Member
    Join Date
    Sep 2004
    Location
    Montreal
    Posts
    31

    Re: byte/short vertex/texture coordinate

    How can I convert a model and it's textures and normals to GLfixed?

    Does the projection, modelview and texture matrix need to be modified in a certain way?

Similar Threads

  1. about texture coordinate
    By freesui1984 in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 09-18-2008, 06:22 PM
  2. about texture coordinate
    By freesui1984 in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 09-18-2008, 06:21 PM
  3. Texture Compression and byte sized verts.
    By Steven Haggerty in forum OpenGL ES general technical discussions
    Replies: 4
    Last Post: 06-17-2004, 05:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •