LearnMaking demos
Lesson 30 of 30 · 60 min
Finish and share your demo
Polish composition, color and motion, then publish and export your work
In this lesson you will
- Plan a composition around a hero, light and dark, and empty space
- Unify a work's mood with a color finish: tone, saturation, temperature and vignette
- Give motion rhythm by mixing fast, slow and still
- Finish with the still thumbnail (time = 2, attention = 0, mouse = (0, 0)) and the hover state in mind
- Post and export from /edit, and share your work with others
01What finishing means
This is the final lesson. By now you have the whole toolkit: color, shape, noise, light, 3D and directing with time. But lining up techniques doesn't make a piece of art yet. Where does the viewer's eye go, and what do they feel? Shaping that is what finishing is about.
Making a work goes more smoothly in roughly this order. Later stages are finer adjustments, so the trick is not to fuss over them before the earlier stages are settled.
- Idea: narrow it down to one picture and one mood
- Blockout: place shapes and motion in gray or placeholder colors
- Composition and value: pick the hero and lay out a path for the eye
- Color and light: limit the palette and apply a color finish
- Motion: vary the speeds and build a highlight
- Checks: thumbnail, cost and screen sizes, then post
In this lesson we grow a 2D "moonlit lake" step by step, through composition, value, color and motion, looking at the thinking behind each. At the end, the capstone exercise has you build a complete 3D demo.
02Composition: choose a hero
First, choose the picture's hero. Here it's the moon. Then decide where it goes. Dead center is stable, but tends to look static, like a snapshot. That's why photographers and painters often use the rule of thirds: divide the frame into thirds horizontally and vertically, and place the hero and the horizon on or near those lines and their crossings.
In p coordinates, the vertical third lines are at roughly p.x = ±0.44 (on a 4:3 screen) to ±0.59 (on 16:9), and the horizontal third lines at p.y = ±0.33. In the example below the horizon sits in the middle (horizon = 0.0) and so does the moon. Change the numbers and compare how the picture feels.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
horizon at -0.35 and moonPos at vec2(-0.45, 0.4). The horizon moves to the lower third and the moon to the left third, balanced by the hills on the rightWith the horizon in the middle, sky and water compete for the same space and it's unclear which matters. Drop it to the lower third and the sky becomes the hero's stage. Move the moon to the left, and the taller hills in the right foreground balance the weight. The stretch of empty sky (the negative space) is an important part too: it makes the hero stand out.
Watch out
Works are shown at many aspect ratios. Keep important things within |p.x| < 1.3 and |p.y| < 1. On a 4:3 screen, p.x only reaches ±1.33. If you export a phone wallpaper (portrait 1080×1920), only about ±0.56 of p.x is visible, so the hero needs to sit near the center.
03Guiding the eye with light and dark
The eye goes first to the brightest spot and to where light and dark contrast most. So make the hero the brightest thing and give it clear contrast with its surroundings, and the eye goes there naturally. If other things around the frame are as bright as the hero, the eye wanders.
The best way to check value is to remove the color. It's like a painter squinting at a canvas: you see only brightness, undistracted by hue. In the example below, the upper sky is darker, the nearest hills are almost black, and the moon's path of light now shines on the water. Remove the // on the line just above return to view it in black and white.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
0.5 in exp(-md * 3.0) * 0.5 inside scene to 1.5 and the glow around the moon gets too bright, blurring its edgedot(col, vec3(0.299, 0.587, 0.114)) turns a color into the brightness the eye perceives (its luminance). We see green as brightest and blue as darkest, hence the three different weights. Making near things darker and far things closer to the sky color is also a value choice: it shows aerial perspective, the way distant things fade into the haze.
04Color grading
In film and games, the colors of the finished picture are adjusted together at the very end (color grading). In a shader, passing everything through one grade function at the end of render unifies the mood of the whole picture. It follows the finishing order set in Light and finishing (exposure, tone mapping, vignette, gamma correction, grain) with three additions. Saturation and color temperature come after tone mapping, once brightness is inside 0–1. Contrast comes after gamma correction, because you want to judge it in the brightness actually shown on screen.
- Tone mapping: squeeze over-bright values smoothly into 0–1
- Saturation: the further from the luminance (gray) color, the more vivid;
mix(vec3(luma), col, 1.3)means 1.3× - Color temperature: cool shadows and warm highlights add depth and an evening or night feel (split toning)
- Vignette: darken the edges a little to lead the eye inward
- Gamma and contrast: convert to display brightness, then firm it up with an S-curve
- Grain: a very faint noise that hides the steps (banding) in smooth gradients
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
grade and you get warm shadows with cool light: a completely different mood. Change the 1.3 in step 2 to 0.5 for a washed-out, old-photo lookTip
The fewer colors, the more unified the picture. Stick to two or three hues per work, and give only the hero a touch of the opposite color (orange against blue, say) to make it pop. In this lake, everything is blue except the warm moon.
05Rhythm in motion
If everything moves at the same speed, motion turns monotonous. Just as music has a slow bass line, a busy rhythm and the occasional big hit, give motion layers too:
- Slow, large motion: backgrounds and broad areas (mist, clouds, sky color), barely noticeable
- Fast, small motion: details (twinkling stars, glints on water) that make the frame feel alive
- Stillness: the hero or the ground, a resting place for the eye among the moving parts
- Accents: short, occasional events (a shooting star, a flash), timed with the scene thinking from Directing with time
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
7.0 in mod(time - 4.0, 7.0) to 2.0 and they stream constantly, so they stop feeling specialAccents work precisely because they're rare. Aim for a gap long enough that viewers start waiting for the next one. The moon stays put as the picture's anchor. Whenever you add motion, remember to keep something still.
06The still thumbnail and attention
What people see first in the Gallery is not your work in motion but a still thumbnail. It's drawn as a single frame with time = 2, attention = 0 and mouse = (0, 0). However good the work, if it's still dark at 2 seconds or the hero hasn't appeared yet, people scroll right past it.
When a viewer hovers over a card in the Gallery, the work starts moving and attention rises quickly to 1 (Touch and response). You can use that for a little reward that only appears on hover. Just make sure the picture looks good at both attention 0 and 1. On the work page and in the editor, attention stays at 0.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
time = 2 comes out dark. Change the 4.0 in smoothstep(0.0, 4.0, time) near the end to 1.0, and it's fully lit by 2 seconds. Raise attention with the slider below to make an aurora appear- Finish any opening effect (fade-ins, the hero's entrance) before 2 seconds, or shift time, as in
float t = time + 5.0;, so your best moment lands at 2 seconds - On the work page and in the Gallery,
mouseis always(0, 0)(the center of the screen). The mouse only moves in /edit, the lesson previews, /stage and exported HTML, so even a mouse-driven work should hold up withmousestuck at(0, 0). Also check that anything following the cursor doesn't cover the hero in the middle - Make
attentionadditive: at 1, something grows, speeds up or appears; nothing should be missing from the 0 picture
Tip
To check the thumbnail frame in /edit, press "Restart" under the preview, watch the elapsed-time display, and press "Pause" at around 2 seconds. Image (PNG) exports are drawn at whatever frame is paused, too.
07A finishing checklist
Before posting, go through these one at a time. If you can say yes to all of them, publish with confidence.
- There's one hero, and the eye goes there first
- In black and white, the shapes and the hero still read
- Nothing important is cut off at either 4:3 or 16:9 (full screen)
- The frame at
time = 2looks good (not too dark, the hero is there) - It looks good at
attention0 and 1, and still works withmouseat(0, 0) - Thin lines and fine patterns don't flicker (anything thinner than a pixel gets blurred or thickened)
- It holds up over long runs (try replacing
timewithtime + 3600.0to see the picture an hour in). For stream backgrounds, check that nothing fed into randomness or noise keeps growing with time (see "Seamless loops" in Directing with time) - Pre-publish checks show 5 / 5 passed, with room to spare on Frame time
- Names and comments in the code make sense to someone remixing it
08Posting
You post works from /edit. Any playground in these lessons can go straight there with "Open in /edit" (your previous /edit draft comes back with Undo). Code written in /edit is saved automatically as a draft in this browser. Posting requires signing in, but your draft is kept even if you aren't signed in. Here are the steps:
- Give the work a name in the "Title of the work" field at the top
- Check that all five "Pre-publish checks" under the preview pass
- Press "Continue to Submit" (or "Sign in to post" if you aren't signed in)
- In the "Post your work" dialog, enter the title (up to 60 characters) and the name to display (optional, up to 40; blank means Anonymous)
- Choose "How others can use it" (the license) and "Visibility" (details below)
- Add tags (up to 5, comma-separated; lowercase letters, digits and hyphens, up to 24 characters each) and a description (up to 280 characters). Both are optional
- Press "Publish" (or "Save as private")
For "How others can use it" there are two choices. "Only on this site" (the license is called "shaders.art Standard", and it's selected by default) lets others view the work, use it as a stream background or embed, and remix it on this site; using the code anywhere else needs your permission. "Anywhere, with credit" (CC BY 4.0) lets people use it anywhere, including changing or selling it, as long as they credit you. CC BY can't be undone later. If in doubt, stay with Standard.
For "Visibility", Public puts the work page in the Gallery for anyone to see. Private means only you can see the work page, and it doesn't appear in the Gallery. You can also save as private first, check how the work page looks, and publish later.
Tip
Tags help people find your work. Short English words for the technique or character, like raymarching, noise, loop or tiny, make it easier to discover. In the description, a line about the highlight or what happens on hover is a nice touch.
The "Make with AI" panel in /edit lets you describe in words how you'd like the code to change (sign-in required). Suggestions are shown as a diff you can review before applying, which makes it a handy sounding board when you're stuck. Having come this far, though, you can judge for yourself what's good about a suggestion and what's off.
09Exporting
The "Export" menu under the /edit preview lets you take your work out in several forms, even without posting it:
- Image (PNG, current frame): 1920×1080, 3840×2160 (4K), 1080×1920 (portrait, phone wallpaper) or 1080×1080 (square, social). It draws the preview's current moment, so pause on a good frame first
- GIF (loop, from the current frame): 3 s at 480×270, 5 s at 640×360, or 5 s at 480×480. Build it as a loop from Directing with time and there's no seam
- Code: a "Standalone HTML file" that runs when opened in a browser, and "Copy for Shadertoy"
- Stream background & embed: a /stage URL for stream backgrounds and an embed code for blogs and sites. In OBS, add a Browser source with the URL at 1920 × 1080
You can tune how a /stage URL looks. Add ?speed=0.5 for half speed (anywhere from 0.1× to 4×), or ?attention=1 to run it in its hovered look (both together: ?speed=0.5&attention=1). If the URL has a #, as URLs for unposted works do, put these before the #. If it'll run for hours on stream, remember the advice from "Seamless loops" in Directing with time.
Watch out
How you may use an export depends on the work's license. Your own work is yours to use, but if you remixed someone else's, check the original's license (shown on its work page) first.
10Final exercises
The first two exercises each try one finishing technique. The third has you build a complete demo, "Armillary at dusk", combining what you've learned. Grow it step by step as below, checking the preview after each step before moving on.
- Stage: make the sky a sunset gradient with the sun near the horizon, distant mountain silhouettes and stars up high (Materials and atmosphere, Smooth noise)
- Hero: replace the sphere with three thin rings (
sdTorus) turning on different axes and a glowing core in the middle; build the rotation matrices once inrender(Building 3D shapes, Fast and small) - Light: make the rings gold metal that mirrors the sky, lit from inside by the core; gather the glow around the core while marching (Normals and lighting, Tunnels and flight)
- Water: turn a plane solved by formula (y = 0) into water that mirrors the sky through noise-tilted normals; add the core's reflection too (Rays and cameras)
- Time: pulse the core at 80 BPM, sway the camera slowly, and spin the rings faster with
attention(Directing with time, Touch and response) - Finish: unify the colors with this lesson's
grade, then check the frame attime = 2and the Frame time
A thumbnail that shines
A flower opens, but right now it takes 5 seconds to open and the screen takes 3 seconds to brighten, so the thumbnail at time = 2 shows only a small, dim flower. Fix it so the flower is fully open and bright by 2 seconds, with a little overshoot as it opens. Then, when attention is 1, make the flower spin faster, glow brighter and show a ring of sparkles around it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Evening, with color alone
This is a picture of dunes at midday. Without touching the scene code (render and dune), rewrite only the color-finishing function grade to turn it into evening: darken it a little overall, push highlights toward orange and shadows toward purple, darken the edges and boost the contrast.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Armillary at dusk
Following the six steps above, build a demo of an armillary sphere floating over the sea at dusk. The starting code has just a two-color sky and a single sphere. The finished piece has a sun setting near the horizon, the first stars in the sky, distant mountain silhouettes, rippling water that mirrors the sky, and, on the left third, three nested golden rings around a core of light that pulses with the beat. On hover (attention), the rings spin faster and the core glows brighter.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
11Recap
- Pick one hero and place it with the rule of thirds and negative space; keep what matters within
|p.x| < 1.3 - Make the hero the brightest thing, and check the values in black and white
- Unify color with
grade: two or three hues, with the opposite color saved for the hero - Rhythm comes from slow and large, fast and small, still, and the occasional accent
- The thumbnail is
time = 2,attention = 0,mouse = (0, 0); useattentionfor an additive reward - Post from /edit (Standard or CC BY license) and export as PNG, GIF, HTML or a /stage URL
12Where to go next
That's all 30 lessons. Congratulations, and thank you for coming this far. You started by painting the screen a single color, and went on to build clouds from noise, make things shine, fly through 3D worlds and tell stories with time. Every bit of it was a new way to answer the same question: "what color is this pixel?"
From here on, it's make, look, and make again. The Gallery is full of other people's works. When one catches your eye, use "Open in editor" to read how it works, and change a number. That's the best teacher there is. And please post your own work from /edit. Even a small piece can be someone else's "oh, you can do that?"
Whenever you get stuck, come back to any lesson in this course. We look forward to seeing your next work in the Gallery.
That was the last lesson