Basic shader help

I’ve been doing the all the tutorials for shaders in the PlayCanvas tutorials section, and I’ve been following Leonidas’ tutorials on implementing shaders from ShaderToy to PlayCanvas,

( http://pirron.one/playingincanvas/shadertoy-playcanvas-sirenian-dawn )
( http://pirron.one/playingincanvas/color-palettes-using-shaders )
( http://pirron.one/playingincanvas/texture-masks-using-shader )

but I’m afraid I’m still not sure how to fully implement a handful of other shaders from ShaderToy. Is there anywhere I can go to get a better breakdown of how to use the PlayCanvas shader chunk system?

Hi @morejelly,

A nice place to start is to take a look at the Playcanvas shader chunks library and start experimenting on modifying some simple ones (diffuse or opacity):

Here is a small sample on how to start setup your project to use modified shader chunks:

https://developer.playcanvas.com/en/tutorials/warp-a-sprite-with-glsl/

That will give you the knowledge on how to start writing effective shader code using the Playcanvas shader chunks system. ShaderToy shaders can be quite complex, from there you need to educate yourself in general on how GLSL shaders and rendering systems work and fill in the missing gaps on how that is implement in Playcanvas (how common uniforms are named, where they are available etc).

There isn’t a tutorial or manual entry for that, yet, but the engine is well written and the code open source. Feel free to ask if you have any questions, there are experienced people around that can provide a helping hand.

1 Like