Learning shaders and post effects

Hello everyone! Recently I started developing a photo-realistic planetary simulation and I’d like to know how to use shaders and post effects to make lighting and materials more realistic. Heres what the game looks like now:

(The image above is a picture of the simulation of the Arcanes system from a far view. Thanks to fog, they blend in with the stars well)

And these are the planets, but I want them to have realistic enter-able atmospheres that dissipate as the further out they go alike to Earth, and I want them to have the Raleigh effect of atmospheric light diffraction to provide beautiful skies and sunsets. I just need someone to explain how to use shaders and post effects, so thanks for reading.

Hi @Jacob_McBride2,

Interesting project! In the shaders section of the tutorials page you can find a number of tutorials and examples on how to get started with shaders in PlayCanvas:


There is a planet atmosphere shader that you may find useful.

For a more advanced implementation and explanation on how live rendered atmosphere scattering can work in WebGL I’ve found this video useful:

1 Like

Yes, I watched the video you mentioned, but I need help with putting together a shader. When I try to create a shader called “shader” and use it on its own, it doesn’t work like I want it to. I often see other shaders referring to a file called “index.shader.” So, I want to learn how to make a shader file that works properly in PlayCanvas. It would also be great to understand the shader code used in this situation.

Check the tutorials and examples on shaders I shared above the video.

1 Like

I read the playcanvas tutorials for shaders and I understand it better. Also, why are some tutorials empty now? They used to have information but now they are mostly empty.

Those are examples, they include only an example project that you can open and study.

1 Like

But they used to have information on them teaching you to do what the tutorial does.

Yes, some do like this one:


1 Like

I mean about 2 to 3 years back some of the tutorials had information, but now on them it has been deleted.

I’ve been around for a long time and I don’t think there have been shader tutorials removed. Which one are you referring to?

1 Like

Not shader tutorials I meant tutorials in general. It was just something weird I noticed so I asked about it.

Oh by the way thanks for the help! Thanks to you, I got the shader to work correctly and did a test shader so I know how to do it. The following image is a picture of the launch with a diamond model that has a rainbow shader and it changes color (simple but it is my first shader and it does work)
Screenshot 2023-06-22 1.40.29 AM

1 Like