Medium 3DAnimated

Checker globe

A lit, slowly rotating sphere wearing a blue-and-white checker texture.

The target picture for the shader challenge "Checker globe"
Recreate this picture. You pass at a 99% match, then try to write it in fewer characters than the par.

How this challenge works

You write a fragment shader that draws the picture above, live in your browser. A match bar shows how close you are, and the score combines accuracy, code size (the par is 607 characters in Unity (Built-in)) and GPU speed. Work in HLSL, GLSL, WGSL, Metal or Godot and export the result when you are done.

The numbers you need

Sphere
p = (uv - 0.5) * float2(aspect, 1.0) * 2.0, R = 0.8, normal = normalize(float3(p, sqrt(max(R*R - dot(p,p), 0.0))))
Texture coords
u = atan2(n.x, n.z) / 6.28318 + time * 0.1; v = acos(clamp(n.y, -1.0, 1.0)) / 3.14159
Checker
abs(fmod(floor(u * 12.0) + floor(v * 6.0), 2.0))
Colors
float3(0.95,0.95,0.9) / float3(0.2,0.45,0.85)
Light
normalize(float3(0.5, 0.7, 0.6)), brightness 0.2 + 0.8 * diffuse
Background
float3(0.04, 0.05, 0.09)

Solve it in your language

Unity (Built-in), Unity (URP), Unreal, Shadertoy / WebGL, OpenGL (LWJGL, raylib), three.js, GameMaker, LÖVE (Lua), Godot, Apple (iOS, macOS), WebGPU / Bevy.

Start coding