GLSL: OpenGL Shading Language (part 2 of 2)
CS-116A: Introduction to Computer Graphics
Instructor: Rob Bruce
Fall 2016

SLIDE 1: Example shaders

ShaderToy at https://www.shadertoy.com has a large collection of OpenGL Shaders with video demonstrations (rendered in WebGL) and full OpenGL Shader source code!

SLIDE 2: Seascape

Shader source code: https://www.shadertoy.com/view/Ms2SD1

This shader simulates the ocean. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates the ocean.

Screenshot from source: https://www.shadertoy.com/view/Ms2SD1

SLIDE 3: Elevated

Shader source code: https://www.shadertoy.com/view/MdX3Rr

This shader simulates mountainous terrain. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates mountainous terrain.

Screenshot from source: https://www.shadertoy.com/view/MdX3Rr

SLIDE 4: Structured volume sampling

Shader source code: https://www.shadertoy.com/view/Mt3GWs

This shader simulates clouds. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates clouds.

Screenshot from source: https://www.shadertoy.com/view/Mt3GWs

SLIDE 5: Flame

Shader source code: https://www.shadertoy.com/view/MdX3zr

This shader simulates a flame. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates a flame.

Screenshot from source: https://www.shadertoy.com/view/MdX3zr

SLIDE 6: Canyon

Shader source code: https://www.shadertoy.com/view/MdBGzG

This shader simulates a canyon. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates a canyon.

Screenshot from source: https://www.shadertoy.com/view/MdBGzG

SLIDE 7: Dolphin

Shader source code: https://www.shadertoy.com/view/4sS3zG

This shader simulates a dolphin swimming in the ocean. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates a dolphin swimming in the ocean.

Screenshot from source: https://www.shadertoy.com/view/4sS3zG

SLIDE 8: Fish swimming

Shader source code: https://www.shadertoy.com/view/ldj3Dm

This shader simulates a fish swimming in the ocean. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates a fish swimming in the ocean.

Screenshot from source: https://www.shadertoy.com/view/ldj3Dm

SLIDE 9: Procedural Grass

Shader source code: https://www.shadertoy.com/view/MsV3D3

This shader simulates blades of grass. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates blades of grass.

Screenshot from source: https://www.shadertoy.com/view/MsV3D3

SLIDE 10: Raymarching

Shader source code: https://www.shadertoy.com/view/MsX3WN

This shader demonstrates raymarching. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that demonstrates raymarching.

Screenshot from source: https://www.shadertoy.com/view/MsX3WN

SLIDE 11: Spout

Shader source code: https://www.shadertoy.com/view/lsXGzH

This shader simulates water flowing out of a pipe. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates water pouring out of a pipe.

Screenshot from source: https://www.shadertoy.com/view/lsXGzH

SLIDE 12: Tileable Water Caustic

Shader source code: https://www.shadertoy.com/view/MdlXz8

This shader simulates light reflecting off the bottom of a pool. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates light reflecting off the bottom of a pool.

Screenshot from source: https://www.shadertoy.com/view/MdlXz8

SLIDE 13: Refraction

Shader source code: https://www.shadertoy.com/view/Ms23zm

This shader simulates refraction of light in water. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates refraction of light in water.

Screenshot from source: https://www.shadertoy.com/view/Ms23zm

SLIDE 14: Smoke Columns

Shader source code: https://www.shadertoy.com/view/MdjGWc

This shader simulates smoke columns emanating from the ground. Here's a screenshot of the shader:

Screenshot of an OpenGL shader that simulates smoke emanating from the ground.

Screenshot from source: https://www.shadertoy.com/view/MdjGWc