There’s a new Dune movie coming out soon, so I thought I’d make a ‘Dune’ shader (based on the 1984 version).
Nothing too complex in this scene. It’s the first time I’ve used polar coordinates in an SDF (for the teeth and mouth segments), but the landscape is just a simple FBM noise. Ripples are added outside of the SDF to keep the frame rate higher.
The GLSL shader source can be found here, and a 360° VR view here.
For this shader I wanted to write something that used textured stone walls, as I hadn’t really tried writing that effect before. The cell scene Silence of the Lambs movie seemed to lend itself as inspiration, as it would also allow me to add some cool reflections from the cell glass.
The stone pattern was made using a voronoi pattern with a couple of layers of noise on the material to add roughness. All the walls are completely flat, but when applying the material I tweak the normal vector to add dynamic highlights and shadows as the camera moves.
I’m quite pleased with the outcome, although it would have been good to add some pencil-drawn artwork onto the cell walls. Technically doable, but the scene was making my GPU groan, and I like to keep the frame rate reasonable for the majority of people.
The GLSL shader source can be found here, and a 360° VR view here.
The challenge for this shader was to a) pay tribute to an awesome movie, and b) to add some animated content. I actually got quite attached to the little Fly – It was fun working out how to make a dot move like a fly, and go through the ‘transporting’ process with a bit of character.
The textures are based on FBM noise – In the case of the wood, once axis is squashed much more than the other. Even the plain walls have some subtle noise added to them, making them look a but more realistic than they would if perfectly flat.
I cheated with the vertical drain pipe – It is actually infinitely long to keep the code simple. It definitely looked strange when the scene was viewed in VR, so I had to add some distance fog when looking up.
The GLSL shader source can be found here, and a 360° VR view here.
After watching Ready Player One way too many times (Then reading the book. Then reading the second book.), I figured I just had to write a shader. Starting of with some reasonably straight-forward modelling of the Iron Giant (using axis symmetry to get lots of objects ‘for free’), I then added the landscape, the ‘force field’, and then the towers.
This is the first shader I have made compatible with VR, and it works really well. It was amazing to see how well the infinite landscape and stars in the sky added to the realism, and the camera angles really make the Iron Giant ‘giant’. I spent ages just looking around the ‘world’ thinking ‘I made this!’.
The GLSL shader source can be found here, and a 360° VR view here.
I have written many GLSL shaders over the last few years, most of which can be found on the Shadertoy website, and over time I’ve built up some code which I use as a ‘starting point’ for ray-marched scenes.
After writing a shader I then review the code to delete any unused functions, simplify calculations, and optimize performance, and generally get things into a state where I don’t mind people taking a look.
It occurred to me that much of this process can be automated, so I wrote a Windows tool which does just that:
The C# source (and prebuilt Windows installer) can be found on GitHub at this location:
After several months of deliberation and research, I finally decided to take the plunge into the world of 3D printing.
As a professional software developer, a 3D graphics enthusiast, and someone who has always had an interest in making things (See my Useless Box), a 3D printer is the perfect way of combing all these activities.
So I decided to practise some of my recently-acquired Arduino skillz to try and make a self-balancing robot.
The idea of a robot managing to monitor and update itself so fast it can actually balance really intrigues me. I wanted to see whether I could do it (without too much help from the Internet), and how well it would balance. I had some spare MDF lying around, so got to work…
I’m currently making a self balancing robot, powered by an Arduino Nano, and decided to use NEMA 17 stepper motors to power it.
The DRV8825 motor drivers are great, but cannot be driven using a PWM signal. Consequently the Arduino code must send a ‘step’ signal to the correct pin many times per second – Easily in the thousands if you require a decent amount of speed, especially if you’re micro-stepping.
In most of my Arduino projects I find myself in a situation where two things apply:
My void loop() function needs to run very quickly.
I need to output data to the serial window.
Unfortunately outputting to the serial window can add significant performance problems, so to keep the speed up I choose to only output every n milliseconds.
My current Arduino project is a self-balancing robot, which requires repeatedly reading angle and acceleration values from an MPU-6050 gyro.
These values can be quite ‘noisy’ – fluctuating considerably when vibration is added into the system – so I found myself in need of some simple code that helps smooth out the values…