Jump to content
  • Advertisement
Sign in to follow this  
VISQI

Texture not mapped correctly

This topic is 2603 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

Hey people,
I am rendering a room mesh but the textures are getting mapped so incorrectly.



unledeq.jpg

Any suggestions??

Share this post


Link to post
Share on other sites
Advertisement
What addressing mode are you using to sample the texture? Are you using WRAP mode?

Are you sure the importer works correctly?

Share this post


Link to post
Share on other sites

What addressing mode are you using to sample the texture? Are you using WRAP mode?

Are you sure the importer works correctly?


yes, i am using WRAP.

The FX file just does a basic tex2D() call with no changes to the texture coordinates.

here is how i use it:


sampler sTex = sampler_state
{
texture = <gTex>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = WRAP;
AddressV = WRAP;
};
....
....
....
....

float3 TexColor = tex2D(sTex, TexC).rgb;

float3 Color = (Diff + Amb)*TexColor + Spec;

Share this post


Link to post
Share on other sites
It's clearly problem with texture coordinates, you've got them wrong. Question is how and why.

- Where did you get the room mesh from? Did you model it in some 3D SW like Blender or 3ds max and exported it to .x file?
- How is it supposed to look like, what does the texture represent? Is it a texture atlas with parts for separate walls?
- Is there supposed to be only one texture or will there be multi-texturing (like a diffuse map plus a lighting map or something in this meaning)?

- If there are multiple texture coordinates in the mesh (depends on the previous points), are you using the right one? How's TexC defined? Is it
float2 TexC : TEXCOORD0
or
float2 TexC : TEXCOORD1
Try to change between those two.

Share this post


Link to post
Share on other sites
got it working. turns out that i was only rendering the final subset with the final texture...:(
Thanks any ways guys

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!