Ocean Simulation with FFT and WebGPU

Jerry Tessendorf's ocean simulation meets Tri-planar mapping

 Posted on March 20, 2024  |  16 minutes  |  3250 words  |  Barthélémy Paleologue

Introduction It’s been a few month since I started pondering making a better ocean for Cosmos Journeyer’s procedural planets. To have actual waves moving around and not just a scrolling normal maps would make a significant difference in visual quality. Coincidentally, I was also taking a course on computer animation (INF585) at Ecole Polytechnique, and I had the opportunity to choose my final project. Long stroy short, I decided to implement Jerry Tessendorf’s FFT-based ocean simulation on WebGPU, and this is my project report. [Read More]

Making Shaders Faster #1

Planetary rings

 Posted on December 18, 2023  |  5 minutes  |  1038 words  |  Barthélemy Paléologue

Realtime shader programming is challenging. Although the GPU is very fast, when adding more and more shaders, you always reach a point where your GPU is no longer fast enough. This is where optimization comes into play. Shaders can be optimized in 2 ways: improve the shader code itself, which can give decent improvements, and precomputing data, which can make the difference between 20fps and 500fps. In this blog post series, I will be presenting how I optimized the shaders of Cosmos Journeyer: a procedural universe running in the web browser. [Read More]

The Compute Shader Tutorial #2

Uniform buffers

 Posted on December 3, 2023  |  6 minutes  |  1115 words  |  Barthélemy Paléologue

Hello again! This is the second part of my compute shader series. If you haven’t read the first part yet, you can find it here. Now that we know how to create simple compute shaders, we will see how to parameterize them with uniforms. Uniformity at its finest No, not that kind of uniform! What are shader uniforms? Last time we added 2 arrays on the GPU. What if we wanted to add the first one to twice the second one? [Read More]

The Compute Shader Tutorial #1

Let's start from the beginning

 Posted on November 26, 2023  |  10 minutes  |  2109 words  |  Barthélemy Paléologue

Welcome to my tutorial on compute shaders using WebGPU and BabylonJS! It is meant to be accessible to beginers and then to provide concrete use cases of compute shaders in the context of terrain generation and grass rendering. What is a compute shader? Let’s say you have an array of numbers like this: let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; Now if you want to add 1 to each number, you can do it like this: [Read More]