# How To Use Anisotropy (GBufferF) In Custom Shading Model?

**URL:** <https://forums.unrealengine.com/t/how-to-use-anisotropy-gbufferf-in-custom-shading-model/635029>\
**Category:** Rendering\
**Tags:** Render-Pipeline, unreal-engine, UE5-0, question\
**Created:** [August 26, 2022, 9:44pm UTC](https://forums.unrealengine.com/t/how-to-use-anisotropy-gbufferf-in-custom-shading-model/635029 "2022-08-26T21:44:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fletchalot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fletchalot](https://forums.unrealengine.com/u/Fletchalot)\
**Post date:** [August 26, 2022, 9:44pm UTC](https://forums.unrealengine.com/t/how-to-use-anisotropy-gbufferf-in-custom-shading-model/635029/1 "2022-08-26T21:44:45Z")

</div>

Hello! I am working on a custom shading model in UE5, and I’d like to write to GBufferF (Anisotropy + World Tangent), but no matter what I can’t seem to do it. My best guess right now is that the SelectiveOutputMask isn’t getting set right, because there’s a field in there that controls anisotropy (HAS\_ANISOTROPY\_MASK), but I can’t figure out how to set it correctly (or even how to check it). I followed some code and ended up at a function that determines anisotropy based on FDataDrivenShaderPlatformInfo (line 1535 of HLSLMaterialTranslator.cpp), but I can’t figure out what that function does or how it works or anything. And I might be on completely the wrong track anyways. So if anyone has gotten this working, or has any better guesses as to why it’s not, please help me out.

---

<div class="post-metadata">

**Author:** ![xionchannel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xionchannel](https://forums.unrealengine.com/u/xionchannel)\
**Post date:** [November 10, 2023, 6:56am UTC](https://forums.unrealengine.com/t/how-to-use-anisotropy-gbufferf-in-custom-shading-model/635029/2 "2023-11-10T06:56:25Z")

</div>

Searching the bUsesAnisoTropy location, I found a location that determines if MSM\_DefaultLit, MSM\_ClearCoat is used.  
So I searched for “MSM\_DefaultLit, MSM\_ClearCoat” and added the custom shading model name to all the locations found and it worked.
