OK. That is REALLY it.
I have solved the problem finally… No more light-bleeding, no more weirdness, no more nothing of that sort.
I’ve been fighting this problem for so long. So VERY long.
It never ceases to amaze me how the problem always lies in the absolute last thing you check. I feel this is an established concept, but I am blanking on the name used for it right now.
HOWEVER, it has also been proven (on my account, at least) that the problem may still exist and that I just think I’ve solved it but it still isn’t fixed.
Time will tell. But I really think this is the end of this for a while at least. (I hope)
Now, onto the actual problem.
This may sound exaggerated to some, but I’ve been having this same problem for pretty much as long as I care to admit.
I estimate it to be at least 1 year almost to the date.
The error is, however, hard to track down as it is located in a field where dozens of things could be wrong.
Add to that the fact that the error doesn’t show up that often so I’ve often found myself forgetting that it exists.
The previous posts outlined the idea that the deferred rendered scenery didn’t have the same problems the forward rendering did. This is not actually true, and I’m regretful that I said it with that level of certainty. Upon much closer inspection (debug information and stuff) they do exist, but they look a lot different than the forward rendering artifacts and not even half as outstanding, so I overlooked it.
Anyway. The problem lies in the CPU side of the tangent space (not the shader like I suspected), in the model loading code where I actually generate the vertex tangent vectors.
The problem is not the code that generates the tangent vectors, the error is when I was generating them.
I have to process my loaded models to remove cases where vertices share normals or texture coordinates, and this is a normal thing to do.
But I was generating the tangent vectors before that step, so I ended up having vertices that instead shared tangent vectors.
This explains why it only happened in some cases. I think I actually mentioned briefly in one of the earlier posts that I had noticed that the errors occur in areas where the tangents vary wildly, or point away from each other.
But. It should be good now.