Need help deciphering some Vector Math instruction (Solved for an extent)

I’ve encountered the following answer while searching for a way how to fake anisotropic shader in Blender:

“Add lightvector to cameravector then normalize it. Next, project that vector to normal-tangent plane. The vector you created is fake normal. This normal create fake Anisotropic specular.”

I’d like anisotropic effect for Eevee thats why I’m looking into it. But attempt to recreate it in shader editor failed. Mainly, I do not understand what “project vector to normal-tangent plane” means. I only know a formula to project vector on a normal of a plane ( projected = oldVector - normal*dot(oldVector,normal) ). I tried to project light+camera vector on binormal (cross between normal and tangent), but it doesnt look anywhere near desired outcome
FAKE Anisotropy.blend (1.7 MB)

why not use the real node for that ?

Anisotropic BSDF now supports a rotation factor

happy bl

1 Like

I’ve specified it is for Eevee, not Cycles…

Anisotropic BDSF and the anisotropic options in the Principled BDSF work in Cycles only; Deckard wants it for Eevee.

I don’t know whether this isn’t good enough; you probably found it already, yes, @DeckardX08? It seems very simple, maybe too simple: https://jeromebelleman.gitlab.io/posts/graphics/anisotropy/

2 Likes

No I didnt. I’ll test if it works, thank you

@piranha4D 's suggestion looks almost accurate when used as Specular in high Roughness material. Still I’m curious what the quote from the first post meant and if the math/workflow is even correct

1 Like

I don’t think you can implement the quoted instructions in Eevee - only Cycles has “lightvectors”, if I’m understanding the term correctly. Which I’m possibly not, these non-existent compound words make me think your quote was originally in German or Dutch, and something may have gotten lost in translation. If by some strange chance you can find the Dutch original of the quote, that may help with my thought process here

1 Like

There was an Eevee attempt long time ago that could pass for anisotropic shading in a clinch. But it had several limitations that made it far from an attractive solution for me.

2 Likes

The normal-tangent plane is the tangent plane (the plane containing all the lines tangent to a specified point on a surface) to which the normal is orthogonal. So your formula looks correct for that purpose (I questioned my partner who actually knows lots more math than I do). Except you think it projects on the normal rather than the tangent plane. It doesn’t.

``````normal*dot(oldVector,normal) -- this projects on the normal
oldVector - normal*dot(oldVector,normal) -- this projects onto the tangent plane
``````
2 Likes

there is this one for EEVEE
an equivalent or fake one but looks good

Better the nothing until we get a real one for EEVEE

test in EEVEE

we can see some aniso on the model here

happy bl

1 Like

I know there is no light direction node. However, it can be faked by using Drivers for inputing rotation of light object, and Vector Rotate

Bad wording on my end, I meant to “project on a plane defined by this normal”, not literally on normal vector

1 Like

And that reply was in English I’m afraid

Then the formula should be good.

Be interesting to see how you do with implementing it. All the stuff I found that does precisely this (instead of some other way, like what I found first) is in Open Shading Language, which once again, only works (at best) for Cycles.

It will need a fake light vector input in Eevee. But it looks like the post in question was BS after all. No matter what plane I project the light+camera vector on - normal, binormal, tangent, - result doesnt resemble anisotropy. I guess I’ll have to stick with your Fresnel solution for a time

1 Like

Too bad. I’m really curious now, because while that solution works ok, it doesn’t look all that great to me (I’ve been staring at various anisotropic things around the house for a while). It looks… too flat.

I played some with the metallic, roughness, and specular values, and that improved it slightly.

It helps more to throw a gamma node in after the fresnel and control the brightness and strength of the effect with that. And to add a tiny bit of high scale noise as bump to pretend to microdisplacement. Would probably help to have a more specific texture if one wants the effect on an object with certain characteristics, like a vinyl record.

It’s always creative fakery with Eevee :wry grin:.

2 Likes

Found the file I was referring to. Did a reset factory setting and removed the hdr to get the file size down.
Eevee Pseudo Anisotropy.blend (194.6 KB)
As I mentioned, it obviously has issues, and I didn’t “modernize it” to use nodes that have been added to the system since then.
Oh, I didn’t make this, so don’t ask me about the math in there - way above my head

2 Likes

Thank you, I was able to understand the general principle from your example. If stripped to the bare minimum (excluding settings for an intensity of anisotropic effect), the base math for fake normal is to compute binormal (cross product between tangent and normal), then cross the result with inverted view direction (“incoming” * -1), then cross again with binormal. Doesnt need the light vector anywhere, it seems. (The math from the post I referred to was either off or that person had really weird definition of a cross product.) Your shader works perfectly, the only difference with the modern is that it sometimes uses MixRGB nodes in place of dedicated vector operations (those used seem to be interchangeable) and it had to use custom math to rotate vector around an axis