Archived

This topic is now archived and is closed to further replies.

Texture tiling on meshes instead of texture stretching

This topic is 5618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way in DirectX 8.1 to tile a certain texture on a mesh? I have a flat cube that I use as a ground mesh. I''ve made it so that the ground box is made 5 times larger in width and in length. This presents a problem however; the texture I place on the mesh (which happens to be a 512x512 image of dirt) is stretched so much that its a blur at best =[ What I need to know is if there is a way to tile the texture so that it keeps its quality. Is this possible?

Share this post


Link to post
Share on other sites
You will need to do two things. Firstly your tu ad tv coords can be larger then 1.0. Say you want to tile the image 3 times across the cube face then your texture coords would be from (0.0,0.0) - (3.0,3.0). You may also need call SetTextureStageState with the flag D3DTADDRESS_WRAP (look in the SDK for help on the call).

Now if you need the texture to keep its original quality then you can use some simple maths to figure out what the max tu and tv will need to be.

Note: Did you really need to bump a message only one hour after you posted the original?

Share this post


Link to post
Share on other sites