[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51258] trunk/blender: Cycles: Anisotropic BSDF enabled, with tangents now computed from the active UV map.

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Oct 16 19:31:47 CEST 2012


On Tue, Oct 16, 2012 at 7:16 PM, Morten Mikkelsen <mikkelsen7 at gmail.com> wrote:
>> Ok, I can see we have an issue with singularities, but using
>> mikktspace does not seem ideal for anisotropic shading. There's still
>> many cases where you can line up the tangents quite well at UV seams
>> even if the UV's are not connected,
> Generally this is not the case. It goes bad at least 95% or more of all
> cases where you try to just average tangents from
> an unwrap no matter what. Borders are splits when tangents aren't aligned
> so odds of this going well are close to non.

It depends if you use any UV map or a UV map designed for the tangent
space. If you just use a UV map that was intended to map textures to
the mesh it's fairly pointless, might as well generate it based on
orco's then. There's very common cases where you can avoid a seam, any
object that's roughly shaped like a sphere, cylinder or torus would
have a seam which we can avoid in principle.

> results if you average with two neighboring triangles, but not the
>> ones on the other side.
> That's not what happens though. What happens is that all the tangents
> surrounding the pole get added together.
> What you end up doing is stretching the highlight in a very distorted way
> across the entire top row of triangles.

Right, that's indeed what it is doing now. But with mikktspace you
also get a discontinuity between the triangles, so neither solution is
perfect. I'm trying to think of a way to do better.

>> As I understand it mikktspace is based on comparing UV coordinates,
>> whereas we should actually be deciding merge/nomerge based on the
>> difference between tangents in UV space, with some threshold.
> If you were to try and achieve normal mapping using this approach then I
> can confidently tell you it's an awful solution.
> The idea has been tried and done to death by many of us game developers
> back in the day when the concepts of tangent space were still young.
> My recommendation is definitely that you use mikktspace for normal mapping.

This is not about normal mapping, for that I 100% agree we should use

> You use it for aniso as well if someone wants to use unwrap based tangents.
> And if someone wants to use orco then you synthesize the tangents. It's the
> only proper/stable/good way to do it.
> M.Fox. spend years on aniso in blender, studying various cases, and I am
> sure he can tell you first hand the per vertex averaged triangles just
> didn't work well.
> He was getting errors all the time.

Ok, I'm still convinced we can do better than either, will try to figure it out.


More information about the Bf-committers mailing list