Sign in to follow this  

Texture not mapped correctly

This topic is 2392 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.



[IMG]http://img38.imageshack.us/img38/4266/unledeq.jpg[/IMG]

Any suggestions??

Share this post


Link to post
Share on other sites
[quote name='TiagoCosta' timestamp='1306780800' post='4817610']
What addressing mode are you using to sample the texture? Are you using WRAP mode?

Are you sure the importer works correctly?
[/quote]

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:
[code]

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;
[/code]

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

This topic is 2392 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this