I am using 2 4-in-one texture and 2 RGBA weight maps to realize the effect which usually needs 8 textures to save some semantics and a second draw call in Unity’s default terrain engine.
When I test it in terrain shader and in regular scene architecture shader, the basic mechanism works, but the edge of each texture shows a weird dotted seam line :
I just wrote a bunch about the same kind of issue here:
You’re not directly using the frac() function in your shader, but you are still doing the same thing since this is how that function is implemented: float frac(float x) { return x - floor(x); }
Look familiar?
You’ll want to use the tex2Dgrad solution I mention in the above post. You’ll also want to add some gutters between the 4 textures so the UVs you’re wrapping at aren’t right on the edge, otherwise you’ll always have some amount of bleed. And you may want to limit the mip levels allowed, either by limiting the derivatives passed to tex2Dgrad, or by using the recently added mip count limits.
bgolus, thank you. The first two suggestions from you both work. I keep the uv 0.002 away from the border(tried 0.001, which seemed not enough to end the seam):
Nope. Was working on a degree in fine arts and dropped out before I finished. My graphics programming knowledge is self taught and from working with others who I could learn from.