The Idea
I wanted to challenge myself by not using external models or
textures at all. So instead of building a scene in Blender or
looking for object files online, I was thinking about how I could
get away with generating the entire scene in code.
It obviously had to be a minimalistic scene that was feasible to
create in a procedural way. One day I was listening to some future
synth music and saw some album covers. They all used simple
geometry and cool lighting effects that I felt able to recreate.
That's how I got inspired to use this as the theme for my scene.
Highlights
Here is everything I did to create this scene:
- The floor is just a bunch of triangles next to each
other. For the grid-lines I made a simple texture (almost the
same as the checkerboard texture). I added a mirror material
to make it look more interesting. The mountain-like structure
on the right uses hard-coded height values.
- The houses for the city are quads of different sizes, each
with a slightly off-set position to create the illusion of depth.
The lights are tiny quads with a bright material.
- The sky in the background is just an infinite plane. I
made a gradient texture for it and decorated it with a big
area light and some small stars to make it look like a sky.
Yes, the position of the stars is hard-coded.
- The only purpose of the floating cube is to look nice.
It's supposed to be just glass. However, I combined the glass
with a white texture. It's barely noticeable but makes the
cube slightly more prominent.
Additionally Implemented Features
- Grid texture as seen on the floor (in rt/textures/grid.{h,cpp})
- Gradient texture as seen in the sky (in rt/textures/gradient.{h,cpp})
- Multithreaded renderer (in rt/renderer_threaded.cpp)
Statistics
- Number of primitives: 1972
Since it's hard to generate
complex geometry procedurally, I wanted to create an interesting
scene using only a few simple shapes. Therefore the number of
primitives is not too impressive.
- Number of lights: 6
I played around with more lights, but
removed them in the end. Since it's supposed to be a scene at
night, I wanted to keep the general tone rather dark. Adding more lights
would therefore mess with the atmosphere by making some areas too
bright.
- Number of samples per pixel: 1000
The scene setup is
rather minimalistic. Hence, I had the capacity to use a lot of
samples to improve the image quality. This has the nice effect
of making the scene look very clean.
- Time to render: 34 minutes on an i5-6600
That translates
to roughly 1 primary ray per micro-second. I got an easy speedup
by making the renderer multithreaded. Since all rays are
independent from each other, they can be rendered with all
available threads without the need for any synchronization.
Creator
Leonhard Staut
Acknowledgements
I'd like to thank Perturbator, GosT, Nightcrawler, and Dance of
the Dead for their great music.
I'd also like to thank
https://bestmotherfucking.website/
which this html page is based on.