Problem with normal maps and repeating textures
Problem with normal maps and repeating textures
I'm having trouble with normal maps.
When I'm normal mapping a mesh with "tiled textures" (meaning the same texture is drawn several times on the same mesh, like walls/floors in videogames), texture is stretched badly. Everything works fine when texture is not tiled (like when mapping a character/object in a videogame).
Here are a few screenshots to give you a better idea :
No matter which format I use (I tried .X, .MS3D and even .BSP maps), problem stays. This is really annoying as I won't be able to design normal/parallax/bump mapped levels without tiling textures.
Using MakePlanarTextureMapping() fix this, but I lose all texture alignment. And this function tiles all textures on the map the same way, something I don't want.
Do you have any clue on how to fix this?
Thanks!
When I'm normal mapping a mesh with "tiled textures" (meaning the same texture is drawn several times on the same mesh, like walls/floors in videogames), texture is stretched badly. Everything works fine when texture is not tiled (like when mapping a character/object in a videogame).
Here are a few screenshots to give you a better idea :
No matter which format I use (I tried .X, .MS3D and even .BSP maps), problem stays. This is really annoying as I won't be able to design normal/parallax/bump mapped levels without tiling textures.
Using MakePlanarTextureMapping() fix this, but I lose all texture alignment. And this function tiles all textures on the map the same way, something I don't want.
Do you have any clue on how to fix this?
Thanks!
Yes!
Thanks, hybrid, I've tried with OpenGL and it works now. I guess the bug is on Irrlicht side, not mine. Someone should tell Niko that the DirectX shader does not clamp normal maps correctly.
Still, I'd like to use a DirectX renderer (All my custom-made materials use DirectX shaders).
I'll try to find a way to make it work with DirectX, if you have any idea, please tell me.
Thanks, hybrid, I've tried with OpenGL and it works now. I guess the bug is on Irrlicht side, not mine. Someone should tell Niko that the DirectX shader does not clamp normal maps correctly.
Still, I'd like to use a DirectX renderer (All my custom-made materials use DirectX shaders).
I'll try to find a way to make it work with DirectX, if you have any idea, please tell me.
Well, I always use PARALLAX_MAP_SOLID, and I never thought about testing it with NORMAL_MAP_SOLID... Looks like I should spend more time experimenting in the future before posting in the forums .
It works ok using Direct3D 9 with NORMAL_MAP_SOLID. The problem only appears when using PARALLAX_MAP_SOLID.
This is good as I can do with NORMAL_MAP_SOLID for the moment. Nevertheless, it is still a very strange bug.
Have you tried reproducing it on your machine ?
It works ok using Direct3D 9 with NORMAL_MAP_SOLID. The problem only appears when using PARALLAX_MAP_SOLID.
This is good as I can do with NORMAL_MAP_SOLID for the moment. Nevertheless, it is still a very strange bug.
Have you tried reproducing it on your machine ?
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
No, I don't have a windows machine here, it usually takes some time until I have time for testing the windows parts.
Unfortunately, the parallax mapping is implemented in shader 1.4 and 2.0 - I just learned 1.1 for answering your post
But there's another thing that would help: Do you have pixel shader 2.0 support, or does your machine use the 1.4 version? Maybe you can even try to use the 1.4 version even if you have 2.0 support as they are rather different. I did not find an obvious bug in these shaders, either, but as they use different texture access I might just not get it. Maybe a shader expoert could help here, too!?
Unfortunately, the parallax mapping is implemented in shader 1.4 and 2.0 - I just learned 1.1 for answering your post
But there's another thing that would help: Do you have pixel shader 2.0 support, or does your machine use the 1.4 version? Maybe you can even try to use the 1.4 version even if you have 2.0 support as they are rather different. I did not find an obvious bug in these shaders, either, but as they use different texture access I might just not get it. Maybe a shader expoert could help here, too!?
My video card (GeForce 5950Ultra) uses pixel shader 2.0. I'd like to try with the 1.4 version, but how do you tell Irrlicht you want to use it instead of 2.0 ?hybrid wrote:Do you have pixel shader 2.0 support, or does your machine use the 1.4 version? Maybe you can even try to use the 1.4 version even if you have 2.0 support as they are rather different.
World of Ideas : an Irrlicht-powered versus fighting game
-
- Posts: 322
- Joined: Tue Aug 30, 2005 10:34 am
- Location: slovakia
hmmm
annoing problem. Try this pixel shader, target 2.0, if it gets the texture coords normaly <b>http://www.medeal.sk/irr/displaynormals.zip</b>.
From the picture I cant say which texture, if layer 1 or 2 is messed up, but usaly theese 2 layers share one taccoords, anyway, you can see it in the shader file data/showbi.hlsl , if you want to test texcoords of 2nd layer
you can also compile it, if you want to test your mesh right away, source is there, set up your own scene.
And maybe you could also state how exactly you did that tiling...
annoing problem. Try this pixel shader, target 2.0, if it gets the texture coords normaly <b>http://www.medeal.sk/irr/displaynormals.zip</b>.
From the picture I cant say which texture, if layer 1 or 2 is messed up, but usaly theese 2 layers share one taccoords, anyway, you can see it in the shader file data/showbi.hlsl , if you want to test texcoords of 2nd layer
Code: Select all
struct VS_INPUT
{
float4 Position: POSITION0;
float2 TexCoord: TEXCOORD0; // here change to TEXCOORD1
float3 Normal: NORMAL0;
float3 Binormal: BINORMAL0;
float3 Tangent: TANGENT0;
};
And maybe you could also state how exactly you did that tiling...
what is this thing...