Planet Explorer

Procedurally generated planet meshes using fractional Brownian motion and Simplex noise rendered using a custom BRDF

Plant Explorer is a three.js program from my Computer Graphics course, which dynamically generates, renders, and lights planets. The thing I’m proudest of is that all planets are lit using a physically based rendering (PBR) bidirectional reflectance distribution function (BRDF) which I wrote.

I had great fun researching and implementing each individual brick of this: diffuse lighting using the Lambertian model; specular lighting using Schlick’s Fresnel approximation; and Cook-Torrance to approximate surface roughness. I highly recommend checking out src/shaders/fragment.glsl; it’s all well-documented in the comments there.

I generated the planets themselves are generated using a sphere, which is procedurally offset by fractional Brownian motion applied to Simplex noise, creating fine details. I added normal textures to give the BRDF something to think about; this was by using a lunar normal map in combination with a shader technique called triplanar mapping to ensure reasonably continuity.

This was a really fun one for me, because I got to go and learn a bunch of techniques and then implement them.

Technologies Used

three.js
TypeScript
GLSL
Git