Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Repeating texture on single quad  (Read 1551 times)

0 Members and 1 Guest are viewing this topic.

OneSidedDice

  • Newbie
  • *
  • Posts: 3
    • View Profile
Repeating texture on single quad
« on: December 03, 2014, 11:54:32 pm »
After searching far and wide, I came to the conclusion that I am the only person on the planet trying to do this, and an existing thread doesn't exist yet (unless I'm incredibly inept at answer finding).

I'm looking to repeat a texture across a single quad, but making the quad's size larger than the texture's size only stretches it. This seems like the kind of things SFML should already support since it can be done using a Sprite, but If that's the case then I can't seem to figure out how.

- Thanks in advance, Croc


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10821
    • View Profile
    • development blog
    • Email
Re: Repeating texture on single quad
« Reply #1 on: December 03, 2014, 11:57:30 pm »
Have you looked at the documentation? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

OneSidedDice

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Repeating texture on single quad
« Reply #2 on: December 04, 2014, 12:04:37 am »
Have you looked at the documentation? ;)
I have indeed tried that. It doesn't seem to have any effect when rendering from a vertex array.

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: Repeating texture on single quad
« Reply #3 on: December 04, 2014, 12:18:25 am »
Are your texture coordinates (that's what's written in the link given by eXpl0iter ;)) larger than the texture size? The size of your quad doesn't matter.
It works, can you show your code?
« Last Edit: December 04, 2014, 12:21:34 am by G. »

OneSidedDice

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Repeating texture on single quad
« Reply #4 on: December 04, 2014, 12:36:22 am »
The problem is that re-sizing the quad stretches the texture to match the quad's new size. I'm looking to repeat the texture if the quad is larger than the texture being mapped to it, instead of stretching the texture.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Repeating texture on single quad
« Reply #5 on: December 04, 2014, 07:59:30 am »
Quote
The problem is that re-sizing the quad stretches the texture to match the quad's new size. I'm looking to repeat the texture if the quad is larger than the texture being mapped to it, instead of stretching the texture.
Then resize the texture coordinates too, not only the positions.
Laurent Gomila - SFML developer