# Get this cool effect with shader?

**URL:** <https://discourse.threejs.org/t/get-this-cool-effect-with-shader/22507>\
**Category:** Questions\
**Tags:** materials, shaders\
**Created:** [January 17, 2021, 7:08am UTC](https://discourse.threejs.org/t/get-this-cool-effect-with-shader/22507 "2021-01-17T07:08:20Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [January 17, 2021, 11:37am UTC](https://discourse.threejs.org/t/get-this-cool-effect-with-shader/22507/4 "2021-01-17T11:37:56Z")

</div>

You can try using [one of the most under-appreciated utils ever created](https://discourse.threejs.org/t/function-to-extend-materials/7882) that’ll allow you to take one of the built-in materials, and modify them ([repo](https://github.com/Fyrestar/THREE.extendMaterial).)

Even simple materials are [still quite complex](https://github.com/mrdoob/three.js/blob/2ceee29ece712e5a906fc3028d0e9056d390b397/src/renderers/shaders/ShaderLib/meshphong_frag.glsl.js), and if you’d like to manually implement effects like shadows, it’d take a bit of time - or at least a lot of reading through [shader chunks](https://github.com/mrdoob/three.js/blob/2ceee29ece712e5a906fc3028d0e9056d390b397/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js) (👈 this is one of the chunks you’d have to use to handle shadows manually.)

Modifying the build-in materials’ shaders is a bit less troublesome, as you can just override the [gl\_FragColor](https://github.com/mrdoob/three.js/blob/2ceee29ece712e5a906fc3028d0e9056d390b397/src/renderers/shaders/ShaderLib/meshphong_frag.glsl.js#L66) with your color calculation.

---

_[View the full topic](https://discourse.threejs.org/t/get-this-cool-effect-with-shader/22507)._
