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.
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)
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.
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.
Awesome, thanks man!
For the tangent vectors you could probably look at the hair shader and see how they handle it. Their tangent vector is passed in through the normal map input (probably due to GBuffer space being limited), but if you want (and you probably do) to have both a normal and tangent input you can probably piggy back off of the custom data channel.