# Anisotropy material

About the first part, my guess is they just keep a reference compendium of all the various major shading models so that they can switch them if they ever want to.

I’m going to take a stab at this, even though I don’t 100% know the specifics, so bare with me… Yeah, they are technically grayscale maps, but you need two channels for it just like a flow map. You still need a channel for both the tangent and the binormal because like I said earlier, if you only had one, the other could be 90 degrees to the left or the right. As far as I can tell, most anisotropic maps just put the tangent/binormal into XY UV space, rather than having to bake out three normal maps for each of the normal channels. I’m assuming a value of 128/128 would be your neutral, zero would be -180 degrees and a value of one would be +180 degrees. If you shift one channel, you need to shift the second by the same amount(picture rotating a 3-axis gizmo around the z axis, the x/y have to stay 90 degrees apart and 90 degrees apart from the z axis). It might be possible to simplify the second channel into being a 0/1 sign channel where it would say the binormal is to the left or right of the tangent, but then you’d still need to do some math to take the value of the tangent channel and then +/- the 90 degree offset.

Edit: Oh and I’m not sure if you can have non-90 degree tangent/binormals in the anisotropic texture, but you might be able to get some effects out of it. The shader will evaluate both anyways and might make something interesting. Again, I’ve never really played around with them.

Thanks IronicParadox. It seems to be working. I changed it so that black is 0 degrees and white is 360, it probably makes more sense.

So I have come across a problem with the tangents at the seams of UVs. They don’t appear to match up even though they share the same edge.
I am using the static sphere mesh provided by the engine. They seem to diverge towards the poles. red = tangent, blue = bi-tangent and green = normal.
This causes a disconnect in the shading when using the tangents.
Can anyone explain why this is happening and a possible fix?

That could mean the UV is not properly done. You might want to create the mesh and Unwrap UV yourself to make sure this is the issue.

That is mesh-specific.

Thank you both for the quick replies. That seems to be the case. I wasted hours thinking it was on my end. The fix is to change tangent smoothing angle to 180.
I will post a quote from maya’s obscure docs:

I made some progress.So, it now uses the modified reflection direction for the reflections and I changed to disney’s mapping for anisotropy.

Some tests:

looks interesting. any working results so far?

Nice progress, keep up the good work!

This is awesome! Subbed to this thread, looking forward to seeing how this progresses!

Can you share the shader code? I’m trying to recreate an anisotropic shader but I can’t because I get stuck implementing the rotating specular lobe part ( the part where the specular highlight rotates just like those pictures you have)

@Waelwindows
https://github.com/stororokw/UnrealEngine/commit/e74e1372c0e165a0c3d69bf00c4060eeb08c8a8f
Code is pretty messy, but it should be pretty easy to understand.

Nothing messy here, you might be a modest person! Awesome work!

This is awesome! Thanks for sharing.

Any tips for authoring maps for anisotropy? I’ve tried to do the standard radial anistropy for but I’m getting weird results. See the attached image.
I looked at many references, including this tutorial: QUICK TIP: Anisotropic Reflections - YouTube

Am I doing something wrong or is this a limitation of the shader? The only way I’ve been able to recreate the effect is by altering the UVs.

Sorry for the late reply I don’t seem to get any email notifications from replies on this forum.

Thanks for trying it out. I made some changes that should fix some issues.
https://github.com/stororokw/UnrealEngine/commit/9fdef56cbc1e7c9b62945ce8899dc7d62f687b12

By default the tangent input expects a vector map (anisotropy map) which consist the red and green channels. You can read more about it here: Anisotropic Direction
But, it boils down to this:
red = highlights run horizontally
green = highlights run vertically

The rotation input expects a ‘rotation map’ where black corresponds to 0 degrees rotation and white a 360 degrees rotation.

You are correct that the tangents are tied to the UVs, so I usually just planar UV map circular things and make sure they are orientated properly.
where are you using that anis_map.png file?
what do the UVs look like?

It should be possible to do. Make sure its srgb is unchecked for the rotation texture.

And the corresponding rotation map

@stororokw Hey! I was wondering if there’s still a way to get your shader, since it seems the original github link has been removed. it looks really cool.

IIRC, You don’t need it - check out Epic’s automotive material package, there should be an anisotropic example in there.

Nah, there’s no anisotropic material in there dude. There’s a brake disc which uses a radial normal, which “works” for that one very specific use case. But it wouldn’t work on more complex objects, and even in this example, it doesn’t do what it’s supposed to do with the reflections (stretch them along the anisotropic angles).

From what i can see above this looked really promising, i don’t think it would take much work to make it production ready at all. Would be good to look at the old code though.

It looks like UE 4.24 will come with anisotropy (beta). Trello

That’s good to hear! I just checked again and it has been removed from the list

In the mean time I updated @stororokw’s code to 4.23: https://github.com/Dawars/UnrealEngine/commit/db858eb5a30d43fa63e908765fcd5aeb19f894ac

​​​​​​​I tried it out but I don’t know how to get the **Tangent **vectors. What did you use? I tried the TangentBases Material expression, didn’t work.