Bang Bang Con Shader Workshop

Hello all! Welcome to the Shader Workshop page!

Taught by: Char Stiles (contact@charstiles.com) @charstiles

In this workshop, you will learn how to livecode shaders by creating a visual composition with GPU code and a little bit of math. Livecoding is a method of programming in which one’s changes to the code are realized immediately and in real-time. This is an ideal way to create music visualizers, or any interactive abstract graphics of the sort. We will briefly go over how to use the shaders we create in a variety of other real-time engines like Unity, p5.js & touch designer.

You will learn about where the shader exists in the graphics pipeline, the basics of how the language works, and how to quickly iterate on writing your shader using livecoding tools. You will also be given a plethora of tools to build upon what you learn, so you can keep learning and practicing beyond this workshop.

 

Schedule

12:00 – 12:25 (25 min) Introduction to the graphics pipeline, concepts, and context.

12:25 – 1:15 (50 min) We will go through the check points together (see below) & go over tools for workshopping.

1:15 – 1:45 (30 min) Q&A & small popcorn show and tell opportunity

1:45 – 2:00 (15 min) I will present my tips and some steps going forward to learn more about shader coding.

Links

👯‍♂️👯‍♀️ Shader place is a collaborative shader editing tool https://www.shader.place/ you can go in and create a unique room name, make sure there is no one else in your room, please be creative with your room names, I don’t want you all in room “hi”

🧑‍🏫 I will be teaching in this room https://www.shader.place/present.html?room=classroom (or if you dont like the code overlayed you can go here https://www.shader.place/edit.html?room=classroom) This is a room only I can edit. You can follow along in this room to see the shader execute realtime or just watch the stream if your computer can’t have two windows of shaders open at the same time plus the disord stream.

🎞 Link to my presentation slides: https://docs.google.com/presentation/d/1xkNWuYrN_2iILutCh1oS1cliILvM0I8WZW8szR-HJ6U/edit?usp=sharing

Tools

🧰 Here you can find the GLSL sticker sheet: https://gist.github.com/CharStiles/e6fec016967c6c8fd648aa4b6c0055cc Change uniform variabe

☀️ Here is Inigo Quilez’s page for 2D SDF: https://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm

🧮 Here is an online graphing calculator, very helpful when writing shaders: https://www.desmos.com/calculator

🎨 Here is the cosPalette function graphed out: https://www.desmos.com/calculator/18rq4ybrru

Code

Checkpoint 0: Fundamental

Here we will learn polar coordinate, color channel, scale, sin, cos and time.

https://gist.github.com/CharStiles/5934425b602b1158761118be67abfd83

 

Checkpoint 1: Color

Here we learn using palette and combining colors to explore a bit: https://gist.github.com/CharStiles/3d8e47f6d50362452838e9b1833899a4

Checkpoint 2: Final (if we have time)

Here we use space transformations to explore a bit: https://gist.github.com/CharStiles/9ea8ac97fa6792689b37394cbd898c45

 

Templates

Touch Designer: https://drive.google.com/drive/folders/1u2_IrBhG5SM6gyy4VYdy73VvFQxejT9Y?usp=sharing

Unity: https://gist.github.com/CharStiles/5ebc0fddd938e601da7323ea357d0fdc (this also moves vertices)

Unity Sticker Sheet: https://gist.github.com/CharStiles/787c2e3e898b68f7e2ca1acbdc0262b5

p5: https://glitch.com/~p5-shader-ex

Homework! (optional)

Create an object in Unity and color it using shaders in a way that “makes sense”

“Makes sense” can be interpreted broadly. Some options:

  • Make a lava lamp where the inside blobs are driven by a shader.
  • Make some bubbling soup.
  • Make washing machine where the window part is a shader.
  • Make a ghost!

This homework is most of all meant to be a prompt to encourage exploration, which is why its left to broad interpretation.

Next Steps

These are some specific suggestions from me if you want to continue learning but don’t know how to start.

💜Join a community!

Shader.Zone is a a safe and inclusive discord to talk about shaders, tools, generative art, and more! Started by my friends Conner Bell and Patricio Gonzalez Vivo: https://shader.zone/

💙Watch the Twitch stream Curiously Minded!
It was started by two former students of mine who met at a workshop that was just like this one!: https://www.curiouslyminded.xyz/ This is their stream: https://www.twitch.tv/curiouslyminded/

💚Learn online from The Book of Shaders

If you haven’t looked at this already, look through it! Its wonderfully paced and has a lot of versatile useful information: https://thebookofshaders.com/

🔢More online math

http://immersivemath.com/ila/index.html

🌟Learn more about GLSL shader functions:

https://www.shaderific.com/glsl-functions

📽Learn more math from an awesome YouTube channel

https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw

📈Some easing functions if sin & cos get boring 🙂

https://easings.net/en