# \[RFC\] Shader Editor

**URL:** <https://forum.playcanvas.com/t/rfc-shader-editor/20616>\
**Category:** Announcements\
**Created:** [June 8, 2021, 10:55am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616 "2021-06-08T10:55:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![slimbuck](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/slimbuck/32/6708_2.png) [@slimbuck](https://forum.playcanvas.com/u/slimbuck)\
**Post date:** [June 8, 2021, 10:55am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/1 "2021-06-08T10:55:29Z")

</div>

Hi Everyone!

We’re busy working on a new shader editor for customising materials in PlayCanvas. It is node based and should be familiar to those of you who have experience with node based material editors. Here is a quick screenshot of shader editor:

 ![Screenshot 2021-06-08 at 10.51.03](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/5/f/5f94d38868f4130b967f47974bdc976a5d674cc4.jpeg)

At launch we plan to support:

- customising material properties like albedo, normal, specular, roughness etc
- have access to surface properties like texture coordinates, position, vertex normal
- sample 2d textures
- support the usual array of math functions
- primarily engine-only workflow with some basic editor support

Post launch we plan to add support for:

- modify vertex offset
- support post-process materials
- add branching and flow control nodes
- in-editor workflow
- modify and customise lighting

Please can you tell us what you most would like to create with a shader editor tool like this in the comments below?

Thanks!

---

<div class="post-metadata">

**Author:** ![Leonidas](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/leonidas/32/6495_2.png) [@Leonidas](https://forum.playcanvas.com/u/Leonidas)\
**Post date:** [June 8, 2021, 11:02am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/2 "2021-06-08T11:02:42Z")

</div>

Many thanks for this update, it looks great!

It will be of great use to us to have an easy to use tool that lets us easily mix colors/maps in a material. For example in this PlayCanvas scene for the ground:

 ![image](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/8/6/86a1e7ca2b6d4069987226e7931a3a613ff513e1.jpeg)

We use vertex colors to paint the various material channels (diffuse, normal, metal, parallax) on the ground. For example red for grass, blue for pavement etc. Although the mapping is straightforward right now it requires a complex to maintain shader to do that.

 ![image](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/d/9/d9e7b7fe2288204d6e17e4bad8b3d2c4ec32d07b.jpeg)

Here we use black/white masks to blend two textures together for dirt/decay on materials. This is actually doable right now with detail textures, but sometimes we take it a step further and blend three maps at the same place. Being able to do this visually or at least with easy to maintain shader code would be very helpful!

Same for being able to do small things like rotate a texture map by a certain angle.

Many thanks again.

---

<div class="post-metadata">

**Author:** ![Dava](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/dava/32/9543_2.png) [@Dava](https://forum.playcanvas.com/u/Dava)\
**Post date:** [June 9, 2021, 6:45am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/3 "2021-06-09T06:45:27Z")

</div>

I am working at a betting/casino dev company, we are in need of a custom shader in order to make an animated background for our apps, similar to this [https://www.shadertoy.com/view/ltGSWD](https://www.shadertoy.com/view/ltGSWD)

If the graph has the ability to create such a thing, I would like to apply as a beta tester.  
I have experience with node-based procedural graphs such as Substance Designer ([https://www.artstation.com/davasoft](https://www.artstation.com/davasoft)) and Unity3D Shader graph

---

<div class="post-metadata">

**Author:** ![underlight](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/underlight/32/8332_2.png) [@underlight](https://forum.playcanvas.com/u/underlight)\
**Post date:** [June 10, 2021, 2:39pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/4 "2021-06-10T14:39:14Z")

</div>

Looks promising! 👍  
Is it going to tackle into existing shader chunks, or they’re going to be will be completely rewritten as well?

---

<div class="post-metadata">

**Author:** ![slimbuck](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/slimbuck/32/6708_2.png) [@slimbuck](https://forum.playcanvas.com/u/slimbuck)\
**Post date:** [June 24, 2021, 8:17am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/5 "2021-06-24T08:17:16Z")

</div>

Hi @Dava,

This should be possible with a combination of textures or just math. Have you tried creating something like this?

Thanks!

---

<div class="post-metadata">

**Author:** ![slimbuck](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/slimbuck/32/6708_2.png) [@slimbuck](https://forum.playcanvas.com/u/slimbuck)\
**Post date:** [June 24, 2021, 8:20am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/6 "2021-06-24T08:20:52Z")

</div>

Hi @underlight,

The Shader Editor will replace the engine’s _frontend_ chunks. By this we mean all the chunks that define artist-tweakable look of the material.

The backend chunks, which deal with lighting and shadowing and everything else engine-side will be shared with the existing standard/uber material.

Hope that makes sense 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![Dava](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/dava/32/9543_2.png) [@Dava](https://forum.playcanvas.com/u/Dava)\
**Post date:** [June 24, 2021, 8:51am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/7 "2021-06-24T08:51:55Z")

</div>

> [@slimbuck](#):
>
> This should be possible with a combination of textures or just math. Have you tried creating something like this?

Just started working with shaders, now I know it’s easy, but I would still like to participate in shader graph as beta tester if possible, I would like to see how it’s working

---

<div class="post-metadata">

**Author:** ![slimbuck](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/slimbuck/32/6708_2.png) [@slimbuck](https://forum.playcanvas.com/u/slimbuck)\
**Post date:** [June 24, 2021, 1:42pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/8 "2021-06-24T13:42:02Z")

</div>

Ahh sorry I thought you were already in the beta @Dava. @yaustar should have given you access now!

---

<div class="post-metadata">

**Author:** ![aaron\_ligthart](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/aaron_ligthart/32/8474_2.png) [@aaron\_ligthart](https://forum.playcanvas.com/u/aaron_ligthart)\
**Post date:** [June 27, 2021, 3:29pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/9 "2021-06-27T15:29:59Z")

</div>

awesome news! I just got back into weblGL shaders again and I recently thought this feature would be great. For me it would be cool if we’d be able to access the depth buffer of a camera to create some effects based on distance.

If it’s possible I’d love to beta test the shader graph to test the workflow of creating shaders this way.

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [June 28, 2021, 8:55am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/10 "2021-06-28T08:55:06Z")

</div>

Done. I send you a DM

---

<div class="post-metadata">

**Author:** ![hagane3d](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/hagane3d/32/12237_2.png) [@hagane3d](https://forum.playcanvas.com/u/hagane3d)\
**Post date:** [July 19, 2021, 11:43am UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/11 "2021-07-19T11:43:52Z")

</div>

Hello guys,

I recently saw that shader graph editor is on beta testing, that’s great!  
Would be possible to join to this beta and check it out the editor and capabilities, I think I’m not an expert, but I have some experience building shaders in different shader graph editors from UDK/UE4 to shader forge, amplify, and lastly the Effekseer shader editor.

I hope it can be possible  
Thanks in advance.  
Cheers!

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [July 19, 2021, 12:18pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/12 "2021-07-19T12:18:15Z")

</div>

Done

---

<div class="post-metadata">

**Author:** ![Mark\_Lundin](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mark_lundin/32/9629_2.png) [@Mark\_Lundin](https://forum.playcanvas.com/u/Mark_Lundin)\
**Post date:** [July 19, 2021, 6:47pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/13 "2021-07-19T18:47:14Z")

</div>

Any chance of a beta test @yaustar 🙏 ?

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [July 19, 2021, 7:16pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/14 "2021-07-19T19:16:33Z")

</div>

done

---

<div class="post-metadata">

**Author:** ![Nazar\_Unloop](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/nazar_unloop/32/16682_2.png) [@Nazar\_Unloop](https://forum.playcanvas.com/u/Nazar_Unloop)\
**Post date:** [July 22, 2021, 2:07pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/15 "2021-07-22T14:07:49Z")

</div>

Hi Steven,

Me and my colleague are currently developing a boat simulator in which in some parts of this boat it is necessary to have a mixture of two overlapping materials (one of them with alpha). I don’t know how to write shaders, but I know how to make shaders through nodes. I just found out that your team is developing Shader Editor and I would like to know how I can experiment with making shader nodes on playcanvas.

Thanks,

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [July 22, 2021, 2:09pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/16 "2021-07-22T14:09:01Z")

</div>

@Nazar_Unloop Unfortunately, at the moment, the shader editor is not yet ready to be used with production yet so there isn’t any integration with the Scene Editor.

---

<div class="post-metadata">

**Author:** ![Nazar\_Unloop](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/nazar_unloop/32/16682_2.png) [@Nazar\_Unloop](https://forum.playcanvas.com/u/Nazar_Unloop)\
**Post date:** [July 22, 2021, 2:19pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/17 "2021-07-22T14:19:05Z")

</div>

Thank you for reply. Anyway is it possible in playcanvas blend two materials in one?

Cheers.

---

<div class="post-metadata">

**Author:** ![Leonidas](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/leonidas/32/6495_2.png) [@Leonidas](https://forum.playcanvas.com/u/Leonidas)\
**Post date:** [July 22, 2021, 2:32pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/18 "2021-07-22T14:32:43Z")

</div>

You can use the detailMap channel to blend e.g. a second diffuse map with the default one.

This setting is not exposed in editor, you can use it in your code. Check the API here:

[https://developer.playcanvas.com/en/api/pc.StandardMaterial.html#diffuseDetailMap](https://developer.playcanvas.com/en/api/pc.StandardMaterial.html#diffuseDetailMap)

---

<div class="post-metadata">

**Author:** ![Leonidas](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/leonidas/32/6495_2.png) [@Leonidas](https://forum.playcanvas.com/u/Leonidas)\
**Post date:** [July 22, 2021, 2:36pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/19 "2021-07-22T14:36:43Z")

</div>

Check this as well, it may be of help using a custom a shader:

> [@\[SOLVED\] Color to Texture transition](https://forum.playcanvas.com/t/color-to-texture-transition/21129/2):
>
> Hi @AnasRahim, Not sure if it can be done without a shader, here is my take by overriding the diffuse chunk: const ColorChange = pc.createScript('colorChange'); // initialize code called once per entity ColorChange.prototype.initialize = function() { const material = this.entity.model.material; material.chunks.diffusePS = 'uniform vec3 material\_diffuse;\n'+ 'uniform sampler2D texture\_diffuseMap;\n'+ 'uniform float transitionState;\n'+ '\n'+ 'v…

---

<div class="post-metadata">

**Author:** ![Nazar\_Unloop](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/nazar_unloop/32/16682_2.png) [@Nazar\_Unloop](https://forum.playcanvas.com/u/Nazar_Unloop)\
**Post date:** [July 22, 2021, 2:39pm UTC](https://forum.playcanvas.com/t/rfc-shader-editor/20616/20 "2021-07-22T14:39:10Z")

</div>

Thank you.  
I’ll take a look at this

[Next page](https://forum.playcanvas.com/t/rfc-shader-editor/20616.md?page=2)
