Offset Shadows - Normal Deformation

This was some tech I worked on for the purpose of expressing depth in a 2d space. Sprites in the foreground cast shadows onto sprites on the background based on a hidden normal map and a light source, similar to how optimized lighting is often done in 3D games. The shadow is also cast based on a height map as well, and sprites that are abstractly “further away” from the foreground will appear as such.

Sand Simulation

For fun, I worked on a classic sand simulation utilizing cellular automata as the driving piece of technology. With this, I’ve implemented physical interactions with different particles where some are more rigid than others, with three distinct states (solid, liquid, gas) and temperature parameters to move between the states, so water particles can freeze into ice and sand or dirt can melt into molten glass or lava, and cool into glass or obsidian. Solid particles also “bump” into each other and it was observed that water causes high levels of erosion as an emergent property of this system. A number of optimizations were implemented, such as chunking the viewable space to only render what is moving and multi-threading those chunks so use the full power of the processor being run on.

Leaf-Wind Shader With Lighting

This was done by modifying a single sprite image with a fragment shader which displaces parts of the image based on, essentially, perlin noise but applied to the colors of a normal map rather than just white-black. Random chunks of the sprite are then grouped together in rgb chunks, which gives a certain illusion of grouping of leaves moving semi-asynchronously. I have control over the strength and direction of the “wind” and the light shader works alongside it to retain the sense of depth.

Capture.PNG

Godot IK2D

I really wanted 2D Inverse Kinematics in the Godot Engine and while 2D IK is on the Godot roadmap (and even seems finished in a to-be-merged pull request), I really wanted it to work for my own projects now. So I made my own solution.

Inverse Kinematics is the idea of a configuration of joints reaching forwards to some target. It’s very useful in animation, particularly in procedural animation. Until then, this still has uses for animating 2D “puppets” or “cutouts” on the engine level, examples of which can be found in this demo as well as some of the videos below!

Godot IK + Dynamic Skeletal Light Demo

I used the IK solution above together with godot’s skeletal system and pixel art with a normal map applied to create a fully animatable arm that reacts to Godot light sources

Shinobi Scarf Demo

I decided to program an approximation of the scarf from the PS2-era game Shinobi. This does not use inverse kinematics, but instead uses array manipulation and light trigonometry to simulate a “floating in the wind” effect. I used a free Unity locomotion pack to articulate how the “scarf” can behave when attached to a target that uses humanlike locomotion.