Texture not mapped correctly

Started by
5 comments, last by VISQI 12 years, 10 months ago
Hey people,
I am rendering a room mesh but the textures are getting mapped so incorrectly.



unledeq.jpg

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

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;
bump.
Well what's wrong? What should it look like?

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

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.
got it working. turns out that i was only rendering the final subset with the final texture...:(
Thanks any ways guys

This topic is closed to new replies.

Advertisement