diff options
| author | yum <yum.food.vr@gmail.com> | 2026-08-07 02:23:06 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-08-07 02:23:39 -0700 |
| commit | 6c8a113c7416056ea8c404307f15e9f6c3db3b28 (patch) | |
| tree | 770a677d5415aa5f7ab5079540648e7ca8e3917f | |
| parent | 04c226c0b71feaf79d07d6cb5f0df001d72126e5 (diff) | |
also add local mode to build script, and fix the template's title issue
(would say index; now says the title).
| -rwxr-xr-x | index.md | 75 | ||||
| -rwxr-xr-x | make_html | 15 | ||||
| -rwxr-xr-x | template.html | 38 |
3 files changed, 94 insertions, 34 deletions
@@ -1,7 +1,80 @@ --- -pagetitle: yummers +title: yummers lang: en --- +# fft water: the plan {data-date="7 Aug 2026"} + +About a year ago I took a stab at reimplementing Tessendorf's ocean +water[^tessendorf]. I got some decent results, but the implementation was +sloppy and not particularly organized. I also never implemented Bruneton's +"geometry to BRDF" method [^bruneton], partially because the implementation was +sloppy. + +I've gotten the itch to take another stab at implementing this water +system. This time, I will try harder to proceed along principled, logical +steps, and check my work more thoroughly along the way. + +I've also decided to document this process. I expect it to take a few months to +complete this project. Hopefully in the future, these notes might help someone +trying to implement some nice deep-ocean water in their engine/game/whatever. + +I'll implement this renderer as follows (this list is likely to change): + +* Derive a high-performance GPU-based FFT implementation on CPU. + * Check against a simple reference implementation of Cooley-Tukey. +* Measure the impact of radix on the numerical precision of the FFT. + * Ideally, generate some graphs. + * Also look at the impact of float precision - 8-bit, 16-bit, etc. +* Implement this FFT algorithm in slang + webGPU. Render unlit. Measure + performance. + * Implement image export from webGPU harness. Measure error - verify that it + matches expectations. +* Generate a wave energy spectrum using Horvath's viscous shallow water wave + dispersion relation. +* Generate one frame of wave displacement using slang + webGPU. + * Validate feature scale, energy, etc. You probably want some histograms. +* Generate one frame of analytic normals using slang + webGPU. + * Validate using finite differences of the heightmap as an approximation of + ground truth. The two images should match within some small epsilon. +* Generate chop and chop normals. + * Validate feature size and normals using finite differences (again). +* Implement stdev (per geometry-to-brdf paper). + * (Note to self: this is a static image based on the energy spectrum. We + calculate the ddx/ddy of the offset [meters/px], then divide 2 \* pi by + that number to get a wave number. That is then used as the index to the + LUT. The LUT contains, for each wave number, the sum of the variances of + all waves with higher or equal wave numbers.) +* Render a simple scene in webGPU and in Mitsuba 3. + * Implement a simple brdf. + * Implement frame export. + * Implement image diffing / measurement. + * Implement hard shadows. + * Implement soft shadows. + * Validate point lighting. + * Validate directional lighting. + * Implement and validate IBL. + * Implement and validate DFG LUT (energy-preserving roughness). + * Implement vertex deformation and normals using baked heightmap & tangents. + Validate against Mitsuba. + * Make a new scene with a highly subdivided quad. +* Port to Unity. + * Implement tooling to blit a texture through a RenderTexture using a shader. + * Automation should generate quads, materials, and rendertextures on behalf + of the user. + * Port compute shader to shaderlab pixel shader. Validate. + * Port lit shader to shaderlab. + * Sample scene, frame export, exhaustive validation... the works. + * Validate point, directional, and IBL. + * Add light volumes. + * Add LTCGI. + +So... yeah. A lot of work. I'll get started tomorrow! + +--- + +[^tessendorf]: Tessendorf, Jerry. *Simulating Ocean Water*. 2004. [PDF](https://people.computing.clemson.edu/~jtessen/reports/papers_files/coursenotes2004.pdf). +[^bruneton]: Bruneton, Eric et. al. *Real-time Realistic Ocean Lighting using Seamless Transitions from Geometry to BRDF*. 2010. [PDF](https://inria.hal.science/inria-00443630/PDF/article-1.pdf). + # how do you evenly tile a column? {data-date="12 Jul 2026"} While walking through town the other day, I saw a pillar that looks a bit like this: @@ -2,13 +2,18 @@ MARKDOWN_IN="$1" [ -z "$MARKDOWN_IN" ] && { echo "Script requires one markdown argument."; exit 1; } +if [ $# -eq 2 ]; then + LOCAL_MODE=1 +fi set -o errexit set -o xtrace OUTPUT_DIR="site_generated" -[ -d "$OUTPUT_DIR" ] && rm -r "$OUTPUT_DIR" -mkdir "$OUTPUT_DIR" +[ ! $LOCAL_MODE ] && [ -d "$OUTPUT_DIR" ] && rm -r "$OUTPUT_DIR" +if [ ! -d "$OUTPUT_DIR" ]; then + mkdir "$OUTPUT_DIR" +fi pandoc \ --mathml \ @@ -20,6 +25,12 @@ pandoc \ -o "$OUTPUT_DIR/site.zip" \ "$MARKDOWN_IN" +if [ $# -eq 2 ]; then + # Local mode + unzip -o "$OUTPUT_DIR/site.zip" -d "$OUTPUT_DIR" + exit +fi + unzip -o "$OUTPUT_DIR/site.zip" -d /var/www/html/ cp -r vr_assets /var/www/html/ cp -r images /var/www/html/ diff --git a/template.html b/template.html index a0cfc1a..7567942 100755 --- a/template.html +++ b/template.html @@ -104,6 +104,13 @@ $endif$ color: var(--foreground-color); border-left: 4px solid var(--current-line-color); } + /* numbered citations rendered from Markdown footnotes */ + .footnote-ref sup { + font-size: inherit; + vertical-align: baseline; + } + .footnote-ref sup::before { content: "["; } + .footnote-ref sup::after { content: "]"; } ::selection { background-color: var(--selection-color); } @@ -160,26 +167,6 @@ $endif$ $for(include-before)$ $include-before$ $endfor$ -$if(title)$ - <header id="title-block-header"> - <h1 class="title">$title$</h1> - $if(subtitle)$ - <p class="subtitle">$subtitle$</p> - $endif$ - $for(author)$ - <p class="author">$author$</p> - $endfor$ - $if(date)$ - <p class="date">$date$</p> - $endif$ - $if(abstract)$ - <div class="abstract"> - <div class="abstract-title">$abstract-title$</div> - $abstract$ - </div> - $endif$ - </header> -$endif$ $if(top)$ $body$ <p><a href="/">back to main page</a></p> @@ -202,17 +189,6 @@ $else$ be able to quickly assess quality regardless of how the code is made. </p> <p> - core beliefs: - <ol> - <li>information should be free;</li> - <li>human-caused climate change is real, significant, and solvable;</li> - <li>passive acceptance of cruelty is complicity;</li> - <li>trans rights are human rights;</li> - <li>the web is a vast sea made of individuals with feelings;</li> - <li>your actions matter.</li> - </ol> - </p> - <p> links: <ul> <li><a href="https://git.yummers.dev">git server</a></li> |
