Texture Seam Prob w/ Wiki Terrain Shader

Posted By: Darkstorm

Texture Seam Prob w/ Wiki Terrain Shader - 02/23/05 19:23

Hey-

I am using the HLSL multi-texturing shader from the wiki but I've run into a problem that I can't figure out. There are visible "seams" in the texture where the terrains meet up. I'm not using any other code on the terrain... not stitching or anything like that. Here is a shot of what I am talking about:



All of the textures used tile seamlessly so I have no clue why this is happening. The scale I used in this shot is 10 but I've tried everyting. Anyone have any thoughts?

-Jeff
Posted By: Steempipe

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/24/05 05:56

You're stuck. My knowledge is that this has to do with magnifactation filtering. Now you could try to lessen it by using the Clamp operation instead of wrap. But that probably will not eliminate it.

The edges are looking to filter/blend themselves with their nearest neighbors. However, these neighbors are on another map in this case. Near, but yet soooo far away.

Good luck.
Posted By: Darkstorm

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/24/05 12:27

Man first ent_fixnormals and now this... you just like to ruin my day don't you . I'll try it with clamp but I think that I've already been down that road before. Once again, thanks for the info.

-Jeff
Posted By: Nadester

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/25/05 13:49

Cover it up with some shrubs

Well.. or you could cover it up with dirt sprites that blend to the terrain with an alpha map, if you want to be a little more creative.

As for the actual shader problem... I ran into the same issue with the exact same effect. I'm currently experimenting, but if I come up with a fix I'll be sure to let you know.
Posted By: William

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/25/05 14:56

The picture shows where two terrains meet up that are using the same multitexturing shader?
Posted By: ello

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/25/05 16:12

if it is really a tilable texture then you should be able to solve it by choosing the right scaling-factor. thats some fine tuning by testing or calculating..
Posted By: Rhuarc

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 10:10

aha! Ello you made me realize something...

Look at the two terrains closely... it looks like the one on the left is scaled bigger than the right ... I have no idea why it would do this, but it's what it looks like....

-Rhuarc
Posted By: Darkstorm

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 14:03

The textures do tile perfectly any other time... just not when on the terrain. Both hmp use the same action so they use the same scale factor... 10. So there is a magic number here that works? That can't be how its supposed to work is it?
Posted By: Rhuarc

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 14:06

Try a power of two, like 8 or 16... does it still do it then?

-Rhuarc
Posted By: Darkstorm

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 14:55

Yeah power of two doesn't help. I've tried almost every number here. I wouldn't think that this was how this was designed to work. It would seem that it should work with any scale factor but it just doesn't.

Is it possible that the UV coords of the HMP format are just screwy? I noticed that this is a problem even without shaders. I then made a model out of two polygons, planar mapped it with the same texture, lined up bunch of them up in wed and the textures tiled perfectly.
Posted By: alienheretic

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 15:49

actually ello is correct i have done alot of terrain work it has to do with the size of the terrain versus the scale factore of the texture
easy way to fix make sure when building you terrain that u use either 33 or 65 verts in both directions with 16 or 32 or 64 triangle size then write down how many time u scaled it up in wed say 10for example so example(65 verts 64 triangle size is a terrain size of 4096 quants scale up by 10 = 40960 quants
so texture scale factor say u want 1 texture for each 512 quants=40960/512=80
like i said easy fix just do the math
Posted By: Darkstorm

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 16:11

Makes sence but then again I've never been that adept at that new fangled mathmatics. It does work as you said but the vertex/triangle size doesn't have to be resticted. Any setting appears to work as long as you figure it out like you said. Thanks for the input and answers. Very helpfull.
Posted By: alienheretic

Re: Texture Seam Prob w/ Wiki Terrain Shader - 02/26/05 18:56

yes but it is eaiser to move then around and line them up in wed doing is simillar to how i sugested
© 2024 lite-C Forums