I already optimized this once before, but I’ve found a much better collision checking system. The new bubbles screensaver now supports 70 bubbles, up from 50. The new system Here’s how it works: it sorts the bubbles based on their X position and loops through the bubbles. For every bubble, it looks backwards in the…
Category: Programming
Learning C, Day 29 (Terrain Collisions)
Today I worked on adding terrain collisions to the 3D renderer! I looked into 3D collision detection, but it seemed like a lot of work just to have the player walk around on angled surfaces. I had the idea to use pseudo 3D collision detection with a height map. So I render a depth pass…
3D Dots Demo (PICO-8)
Just a quick demo I made in few hours between yesterday and today. Controls: Up and down arrows to control the rotation speed “Z” to toggle FOV sliding
Learning C, Day 28 “End of the 3D Graphics Course”
Today I finished the 3D graphics course! I’m super happy with how everything turned out. I’m a little sad that it’s over, but mostly excited to do more projects. I started making a 3D meme for this post, but it took way longer than I expected so I’ll probably finish it tomorrow. I’ll also post…
Learning C, Day 27 “Camera Controls”
Today I updated the camera to use the mouse and WASD! The renderer is really starting to feel finished. I also made the camera able to look up and down, cleaned the code, and added a method to simulate low resolution displays, all of which took about two and a half hours. Next up is…
Restoring Discord’s Blurple Color
Discord updated their branding a few days ago. I’m okay with the new logo and I can live with the new wordmark, but I don’t like the new colors. They’re so saturated, especially the new Blurple. I want the old Blurple back, so I made a script to restore it. Here’s what it does: The…
Learning C, Day 26 (Camera Clipping 4)
Camera clipping UV coordinate interpolation! It only took like an hour to add and it was really simple. I used linear interpolation between the polygon points on either side of the clipping plane to get the UV coordinates of the new point. I thought I might need barycentric coordinates to interpolate the values, but because…
Learning C, Day 25 (Camera Clipping 3)
Today I spent about two and a half hours implementing camera clipping. Now the renderer doesn’t crash when objects go off screen! I have yet to interpolate the UV coordinates, though. Textures look broken right now because the new points use the old UV coordinates. The method for creating triangles from polygons ended up being…
Learning C, Day 24 (Camera Clipping 2)
Today I spent another hour on camera clipping and I’m almost ready to start implementing it. My idea of using dot product to check whether points are inside a plane was correct 🥳. I do have some questions, though. If I’m clipping triangles by creating new vertices, the resulting polygon may not be a triangle.…
Learning C, Day 23 (Camera Clipping)
Today I spent an hour on preliminary setup for clipping planes. The idea here is to not render triangles outside the camera view and to clip triangles which extend outside the view. To do that, I need planes defining the bounds of the camera view and a way to check whether points are inside the…
Learning C, Day 22 (First Person Camera)
Today I worked on a first person camera for the 3D renderer. Right now it uses WASD to move forwards/backwards and turn left/right. Once I add clipping I’ll change it to use the mouse to look and WASD to move. I can’t wait to use this render to make 3D games and memes. It’s going…
Worley Noise in C
Today I made Worley noise in C! I was watching this video and when it got to Worley noise I was like, “Wait, isn’t that a Voronoi texture?” I looked it up and it basically is. I’ve been using Voronoi textures in Blender for years and I was surprised to see something I thought was…
Learning C, Day 21 (“Look At” Camera)
Today I spent about two and a half hours implementing a “look at” camera. It’s pretty cool: instead of moving the camera, I move the world by the opposite amount the camera would have moved. And it’s the same for rotation. I also added delta time so that the movement and rotation each fame are…
Learning C, Day 20 (Z-Buffer)
Z-buffer! It was really quick to add (1 hour). I already had per-pixel Z values from the texture perspective correction code. It looks really cool if I intentionally display the pixels backwards: Tomorrow I should be implementing a better camera!
Learning C, Day 19 (Loading UV Coordinates)
Today is the day. Behold the crab. (Best viewed while listening to Crab Rave.) So today I got UV coordinates from OBJ files in the usual two hours! Now I can load any OBJ file with a texture and render it. I also finally replaced my file loading code and sort of fixed a segmentation…
Learning C, Day 18 (PNG Textures)
A really short day today: I just spent half an hour to get the renderer loading PNG textures.See you tomorrow!
Keyboard Gradients, Part 2
I got the gradient generator working! Sort of. It’s super fragile, has basically no error checking, and probably won’t work with your specific setup. That said, here it is: Dependencies: Python 3.6+, Pillow, and Beautiful Soup 4 Usage Open ICUE and create a new profile Add a static lighting layer and set it to just…
Keyboard Gradients
Static gradients on RGB keyboards look cool. They’re colorful, but not too distracting. The problems is that ICUE, the software for Corsair keyboards, doesn’t have the option to create a static gradient. I made a gradient by manually by adding lighting layers for each column of keys and it took forever. So I wondered if…