# How to use a Global Shader on a Plugin?

**URL:** <https://forums.unrealengine.com/t/how-to-use-a-global-shader-on-a-plugin/108288>\
**Category:** C++\
**Tags:** unreal-engine, Engine-Source-Code, GitHub, Engine-Source-GitHub\
**Created:** [March 21, 2018, 2:22am UTC](https://forums.unrealengine.com/t/how-to-use-a-global-shader-on-a-plugin/108288 "2018-03-21T02:22:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![homembarata](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@homembarata](https://forums.unrealengine.com/u/homembarata)\
**Post date:** [March 21, 2018, 2:22am UTC](https://forums.unrealengine.com/t/how-to-use-a-global-shader-on-a-plugin/108288/1 "2018-03-21T02:22:34Z")

</div>

Hi, I’m trying to learn about USF and followed this tutorial: [How to Add Global Shaders to UE4 - Unreal Engine](https://www.unrealengine.com/en-US/blog/how-to-add-global-shaders-to-ue4)

Since shaders are supported as plugins since 4.17, I tried doing that. My code compile and all but at the end of that tutorial I’m supposed to modify the engine code, is that correct?  
I don’t have much experience with modifying the engine code and wanted to avoid that, so is it possible?

My goal is to adapt this old cel-shading tutorial to a plugin [https://blog.felixkate.net/2016/05/22/adding-a-custom-shading-model-1/](https://blog.felixkate.net/2016/05/22/adding-a-custom-shading-model-1/)  
Can that be done?

Sorry if this is in the wrong section I wasn’t sure where it fits better. Anyway, thanks in advance.

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [March 24, 2018, 7:36pm UTC](https://forums.unrealengine.com/t/how-to-use-a-global-shader-on-a-plugin/108288/2 "2018-03-24T19:36:01Z")

</div>

To add global shaders you don’t need to change engine code. To add shader models you would need thou. The articles bellow will cover from global shaders and shader models.

I sugest for you to follow this threads/blogs/links:

[https://rcaloca.blogspot.com.br/2017…rs-to-ue4.html](https://rcaloca.blogspot.com.br/2017/05/adding-global-shaders-to-ue4.html)

and/or

[https://docs.unrealengine.com/en-us/…n/QuickStart/1](https://docs.unrealengine.com/en-us/Programming/Rendering/ShaderInPlugin/QuickStart/1)

and/or

[https://medium.com/@lordned/unreal-e…1-c47f2da65346](https://medium.com/@lordned/unreal-engine-4-rendering-overview-part-1-c47f2da65346)

quite an amount of time of reading, GL!

---

<div class="post-metadata">

**Author:** ![homembarata](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@homembarata](https://forums.unrealengine.com/u/homembarata)\
**Post date:** [March 25, 2018, 7:44pm UTC](https://forums.unrealengine.com/t/how-to-use-a-global-shader-on-a-plugin/108288/3 "2018-03-25T19:44:18Z")

</div>

I see, I was mixing global shaders with shader models, sorry. Thanks for the links, that third one is really good and has a lot of good info.
