Casey Primozic’s Notes

Misc. notes, code, and other content I want to post publicly that don’t warrant a full blog post

By Casey Primozic

Subscribe to RSS

Investigating Hill Noise for Terrain Generation

I’ve been working on some procedural terrain generation for my 3D work in Three.JS lately. I wanted to try out a fresh noise function for generating terrain; everyone has used Perlin noise or some variant of it for decades. I came across a blog post by Bruce Hill describing a noise function he designed himself - called Hill Noise. It works by combining a bunch of sine waves together with different offsets and rotations.
Read more →

Some Notes and Docs on the Rust Blackjack Procedural Geometry Tool

I’ve been trying out a tool written in Rust called Blackjack for procedural, node-based 3D modelling. It’s a lot like Blender’s geometry nodes. There aren’t a lot in terms of docs, and it looks like the project isn’t being actively developed right now. Nonetheless, I think it’s an extremely cool project, and the code is very high quality. So, I’ve been spending a bit of time getting familiar with it and trying it out.
Read more →

Fixing WebGL/Three.JS GL_INVALID_ENUM : glDrawElements: type was GL_FLOAT error

The Problem I was working on some procedural dynamic LOD terrain in Three.JS. As part of this, I was manually constructing indexed BufferGeometry instances. Things were working alright, but when I added in a depth pre-pass I started getting errors like this in the console and the terrain failed to render: GL ERROR :GL_INVALID_ENUM : glDrawElements: type was GL_FLOAT The code I had looked something like this: const vertices = new Float32Array((segments + 1) * (segments + 1) * 3); const indices = new Float32Array(segments * segments * 6); // .
Read more →

Debugging WebGL GLSL Shader Behavior Differences Between M1 Mac and AMD GPU

The Problem I’ve been working on a shader in GLSL for implementing volumetric fog via raytracing. I did the majority of the work for it it on my M1 Macbook laptop while traveling, but I was eager to try it out on my powerful 7900 XTX when I got home to see how it performed. To my surprise, the results looked extremely different! The lighting was very low-detail on my desktop with the AMD GPU compared to how it looked on my Macbook.
Read more →

Fixing “Could Not Load Openssl” Mastodon Build Error

While trying to update my Mastodon server to the latest v4.2.0 release, I kept running into build failures when running docker-compose build. I got errors like this in the logs: #20 27.04 Bundler 2.4.10 is running, but your lockfile was generated with 2.4.13. Installing Bundler 2.4.13 and restarting using that version. #20 27.21 There was an error installing the locked bundler version (2.4.13), rerun with the `--verbose` flag for more details.
Read more →