You are browsing as a guest. Sign up (or log in) to start making projects!

Stalhein

@Stalhein

Joined August 12th, 2026

  • 5Devlogs
  • 3Projects
  • 0Ships
  • 0Votes
Open comments for this post

1h 8m 43s logged

Added shadows, another ray is just traced from the original hit towards the “sun”, and if it passes close to objects or hits objects, the colour is multiplied by some kind of factor. It was a great pain stopping the shadow ray intersecting the shape that was hit instantly, making everything look dark, as the start position must be moved out of the shape, but that can cause artifacts. This was fixed with a “bias” variable, which determines how steep the intersection was, and moves the position out of the shape accordingly.

0
0
8
Open comments for this post

1h 2m 56s logged

Not much progress this time, just normals for lighting, but I discovered the SDF of a ‘Mandelbulb’; a 3D version of a Mandelbrot fractal. I don’t really understand the function, but it produces the image underneath.

0
0
4
Open comments for this post

4h 30m 14s logged

I have set up WGPU with Rust to run a compute shader to render to a texture, which is then rendered to the screen. The compute shader ray traces using signed distance functions, stepping as far as the closest object at a time.
There is also a simple, FPS-style camera implementation, so the scene can be looked around.
Next, I plan to improve the graphics, with basic lighting and shadows, and perhaps materials instead of colours.
I’m not sure where this project will go, but hopefully something interesting will come of it.
The picture shows a sphere and long cuboid, a smin function used on them, with different parameters, causes them to blend. This is only one of the many interesting properties of SDFs.

0
0
5
Open comments for this post

2h 40m 43s logged

Added different materials: Lambertian (matte), Metal (reflective) and Dielectric (transparent). The sphere on the left is transparent, and is hollow sphere, the middle is matte, and the right sphere is a metal with a relatively high fuzziness. Dielectric materials reflect and refract taking total internal reflection into account using Snell’s law.

0
0
13
Open comments for this post

6h 54m 53s logged

Diffuse lighting sort of works - it’s very grainy on lower numbers of rays though, and very slow - although I suppose that’s a byproduct of CPU tracing. The demo should work on all platforms, however I have only tested the Linux and Windows (via wine) binaries. The image below is 1920x1080 and uses 100 samples per pixel, but it took quite a while to generate!

0
0
20

Followers

Loading…