Hey people,
I am rendering a room mesh but the textures are getting mapped so incorrectly.
Any suggestions??
Texture not mapped correctly
What addressing mode are you using to sample the texture? Are you using WRAP mode?
Are you sure the importer works correctly?
Are you sure the importer works correctly?
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;
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.
- 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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement