A Procedural Polka Dot Shader with Analytic Normals
This tutorial uses Blender
Support us on Patreon:
00:00 Intro
00:55 Set up the shader
01:35 Implicit sphere equation
04:30 Center UV space
05:30 Implementation
07:15 Create 3D vectors
08:20 Convert to tangent space
10:10 Fix normals outside of sphere
12:35 Evaluate normal map
13:00 Tiling
14:55 Offsetting odd rows
The finished shader
Today we’ll build a procedural shader that produces a polka dot pattern. While this is quite informative, as we learn how to tile the uv space, the interesting part is creating the normal map. We want to use the implicit sphere equation to derive z coordinates for the uv vectors to create sphericals normals. Transforming these to tangent space gives a beautiful and correct spherical normal map.
Download the Shader file: