I am rendering terrain and compute normals and tangents on the fly, to save resources want to limit
the calculations to only nearby pixels.
I can create this effect by doing a mix(), this was what i started out with just to see if i could tell the boarder between
normal mapping and regular mapping, the result was fine, but the expensive normal angent calculation was part of the mixer.
So when I split the code into diffuse or diffuse with normal maps, I get a black line, I even try to smoothstep but there are zero
cases where the fragment shader should get zero normal data.
I also have a directional light with ambient light that does not use normals, even this light is black on those pixels, its as if “discard” was called
Get black lines!
vec3 normal = normalize(worldNormal);
if (dist <= 50.0f) {
vec3 normalColor = shadeTexturedAndLitNormalFast().rgb;
normal = perturb_normal(normalize(worldNormal), normalize(VertexEye.xyz), normalColor, texCoords*100); // normalized
}
if the two normals above are mixed by smothstep or just distance, works fine…
[ATTACH=CONFIG]742[/ATTACH]
Any help on this is greatly appreciated