Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Texture tiling

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2009
    Location
    United Kingdom
    Posts
    26

    Texture tiling

    How do I go about tiling the texture? For instance, making a texture which is say 64x64, and rather than stretching it over a very large area, simply repeat it over the area numerous times.

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Texture tiling

    Say you want to tile it 6 times horizontally and 4 vertically :
    texcoord 0,0 -> texcoord 6,4 (instead of 1,1)

    check the glTexParameter for GL_TEXTURE_WRAP_S/T is still GL_REPEAT (the default).

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2009
    Location
    United Kingdom
    Posts
    26

    Re: Texture tiling

    wow. Was hoping it'd be that simple. I'll give it a go, thanks

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2009
    Location
    United Kingdom
    Posts
    26

    Re: Texture tiling

    Getting a bit confused again. If I'm assigning it to a polygon, how can I specify that many coordinates. Can't I only assign one to each vertex?

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Texture tiling

    huh what ?
    To be more precise, imagine for a square, each of the 4 vertex will get one of these :
    texcoord 0,0
    texcoord 6,0
    texcoord 6,4
    texcoord 0,4

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2009
    Location
    United Kingdom
    Posts
    26

    Re: Texture tiling

    awesome! Got it working. Thanks very much

Posting Permissions

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