# \[Solved\] Recreating build-in materials using ShaderMaterial

**URL:** <https://discourse.threejs.org/t/solved-recreating-build-in-materials-using-shadermaterial/2965>\
**Category:** Questions\
**Tags:** materials\
**Created:** [May 30, 2018, 9:28am UTC](https://discourse.threejs.org/t/solved-recreating-build-in-materials-using-shadermaterial/2965 "2018-05-30T09:28:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Atul\_Mourya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/atul_mourya/32/1155_2.png) [@Atul\_Mourya](https://discourse.threejs.org/u/Atul_Mourya)\
**Post date:** [June 1, 2018, 10:46am UTC](https://discourse.threejs.org/t/solved-recreating-build-in-materials-using-shadermaterial/2965/2 "2018-06-01T10:46:50Z")

</div>

Got help from this post.

> [@\[SOLVED\] How do we use map uniform with custom ShaderMaterial?](https://discourse.threejs.org/t/solved-how-do-we-use-map-uniform-with-custom-shadermaterial/1919):
>
> I’d like to pass a map options that holds a texture to my custom ShaderMaterial but I get an error, like this: const material = new ShaderMaterial({ // ... literally copied MeshLambertMaterial shader here, verbatim ... map: texture, // and I want to use a texture }) // ... renderer.render(scene, camera) But when I try to do this, i get an error in console like gl.getShaderInfoLog() fragment ERROR: 0:884: 'map' : undeclared identifier When I check the shader output in the console, I se…

---

_[View the full topic](https://discourse.threejs.org/t/solved-recreating-build-in-materials-using-shadermaterial/2965)._
