Skip to main content
gamedev.net
🔒 Locked

Texturing question

Started by Moolicious Dec 19, 2004 at 3:38 AM 6 replies 1.4k views
Original Post
Moolicious
Moolicious
Hi, I would like to know how to tile a texture to a large rectanglular surface. i.e. two triangle primatives setup like this |/| It's a large area and it's a waste to create multiple triangles to cover the area. I picked up somewhere in a tutorial that it is possible to title the same texture to the surface. Is this possible and how? Or just point me to text which does explain it. I hope I have been clear. Thanks in advance!
GroZZleR
GroZZleR
If I'm getting you, I think you want to take 1 texture and tile it repeatedly on the same quad? If so, just double your texture co-ordinates.

0.0,0.0      2.0,0.00.0,2.0      2.0,2.0


Pretty sure that will give you 4 reptitions of the same texture.
Moolicious
Moolicious
I didn't realise it would be that simple!

Thanks
sirob
sirob
You need to change your TextureSamplerState to D3DTADDRESS_WRAP for it to work correctly.
Sirob Yes.» - status: Work-O-Rama.
dave
dave
Quote:
Original post by sirob
You need to change your TextureSamplerState to D3DTADDRESS_WRAP for it to work correctly.


Do you?

I have never done that, unless that is set as default in Direct3D.

Well enlighten me :)...


ace
Moolicious
Moolicious
The default is set as D3DTADDRESS_WRAP so it is not necessary to set it if
you just want to tile.
Just some other states if anyone's interested?

D3DTADDRESS_WRAP (default)
D3DTADDRESS_MIRROR
D3DTADDRESS_CLAMP
D3DTADDRESS_BORDER
D3DTADDRESS_MIRRORONCE

Moolicious
dave
dave
What does:

D3DTADDRESS_CLAMP

Do?

ace
Reaper_Unreal
Reaper_Unreal
It takes the pixels that were at the outer edge and stretches them to cover the rest of the surface. That way the texture is only shown once. Read the Direct X SDK, it'll give you a much better explanation. Or even better, try it out for yourself!
She walked into my office like a centipede with 98 missing legs.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.