terrain texture stages problem
hi im drawing a raw file, that works very good.
Now I want to apply textures for different heights..
my problem is explained in here:
http://rafb.net/paste/results/m3194111.html
Any idea why it does that weird stuff?
thanks in advance..
www.prsoftware.de
first.. this isn''t the problem, but you should know..
768x128 is not a valid texture size..
but thats a bit irrelivant right now..
ok. your algorithm, or the intended algorithm, is working on the right of the image. The texture is transitioning correctly there. but on the left, it isn''t, because on the right edge of the triangle, you subtract -0.16 from the texture coordinate.. If you go down a level to the texture below, it will also subtract -0.16 because of the lower level of the texture. So.. at that same vertex, one on the left of a lower level triangle, and one on the right of a higher level triangle, you get the same texture coordinate...
There isn''t really a way to fix this with your current algorithm, but, what you can do, is make the texture twice as wide again, so 1536*128, where the first 128*128 is normal, then the next is a transition to the second texture. The next block is as normal, then a transition. Etc. This will require a bit more working of your algorithm, as it will need to compare the height at each vertex on each triangle, but it may well be worth it. Otherwise you will need to look into multi-texturing, or do multiple pass rendering of the terrain.. but this is problematic with more than 2 levels.
One thing your current idea will do, however, is the edges of all your triangles will look funny as they will blur to the next texture level.. Adding transitions will solve this.
Your''ve actually got me thinking how this could be done in a pixel shader, for flawless fast accurate and good looking transitions... Interesting...
| - Project-X - | - adDeath - | - my windows XP theme - | - email me - |
768x128 is not a valid texture size..
but thats a bit irrelivant right now..
ok. your algorithm, or the intended algorithm, is working on the right of the image. The texture is transitioning correctly there. but on the left, it isn''t, because on the right edge of the triangle, you subtract -0.16 from the texture coordinate.. If you go down a level to the texture below, it will also subtract -0.16 because of the lower level of the texture. So.. at that same vertex, one on the left of a lower level triangle, and one on the right of a higher level triangle, you get the same texture coordinate...
There isn''t really a way to fix this with your current algorithm, but, what you can do, is make the texture twice as wide again, so 1536*128, where the first 128*128 is normal, then the next is a transition to the second texture. The next block is as normal, then a transition. Etc. This will require a bit more working of your algorithm, as it will need to compare the height at each vertex on each triangle, but it may well be worth it. Otherwise you will need to look into multi-texturing, or do multiple pass rendering of the terrain.. but this is problematic with more than 2 levels.
One thing your current idea will do, however, is the edges of all your triangles will look funny as they will blur to the next texture level.. Adding transitions will solve this.
Your''ve actually got me thinking how this could be done in a pixel shader, for flawless fast accurate and good looking transitions... Interesting...
| - Project-X - | - adDeath - | - my windows XP theme - | - email me - |
oh shit I totally forgot about that man hehhe,
well what im trying is to do a smooth terrain in the end.
I never did much with terrains so im starting here now.
My end result should be texture splattering because as you already said the vertex edges will look very funny.
well what im trying is to do a smooth terrain in the end.
I never did much with terrains so im starting here now.
My end result should be texture splattering because as you already said the vertex edges will look very funny.
www.prsoftware.de
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement