Tiled Texturing?

This is a discussion on Tiled Texturing? within the Game Programming forums, part of the General Programming Boards category; How would I tile a texture on an object?...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Tiled Texturing?

    How would I tile a texture on an object?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    6
    use numbers bigger than 1.0 for your texture coordinates
    ...


    ie

    2.0 would tile the texture twice.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    Do modulo math or use AND for powers of 2 - which all your textures should be.

    u&= (TextureSizeX-1);
    v&= (TextureSizeY-1);

    or

    u%=(TextureSizeX);
    v%=(TextureSizeY);

    Of course u and v must be integers to use this.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    For DirectX, though, the SDK says to use values over 1.0 to tile the texture. My first post was for a different texturing scheme.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Textures not texturing the way I want
    By scwizzo in forum Game Programming
    Replies: 0
    Last Post: 12-16-2008, 11:12 AM
  2. OpenGL, texturing...and...more OpenGL
    By Sunny in forum Game Programming
    Replies: 2
    Last Post: 07-08-2002, 02:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21