Learning about the Stencil buffer

An experiment I was able to produce whilst learning about stencil buffers in the context of writing graphics shaders. The way this effect works is by having both the sphere and a cube at the same position in the world. Then two quads moving horizontally towards each other in front of the camera.

When the quads are on their own they present the camera with a view through a single stencil buffer layer (the sphere), but when they overlap, we start to see the next stencil buffer layer (the cube).

The rest is simply a bit of animation to make the effect a bit more dynamic 🙂

I’ve found this technique quite interesting, and I’m sure will be useful in game projects I make, such as portals, or optical illusions.

 

 

A further experiment allowed me to create this cube effect, which seems hollow with different content from each side, again this is produced through a quad in front of the cube’s face that draws an inner cube and object, that are only visible on a specific stencil buffer layer. I was inspired by a similar effect in the game Antichamber, which is one of my all time favourites.

Plane game – Gameplay Prototyping

Prototype of a little game idea I came up with one weekend.

The world is made up of floating islands, and you have a plane you can take control off to fly from island to island.

You’re also able to jump out of the plane and move around.

 

My interest in making this prototype was in scratching an itch of building a new kind of
gameplay movement controller with the plane, that I have not had experience with before, as well as the idea that this could potentially be a game with quests and stories happening across multiple floating islands, involving plane acrobatics.

Procedural trees – Rainbow edition

 

AddedGravity blue 6This is a series of procedural tree generation experiements I played around with for about a week .

It was an interesting experiment based on very simple shapes, each mesh is simply a rectangle being spawned and stretched according to a few rules of propagation.
green orange

After a while I noticed that the branches were not really dropping enough, so I added a concept of pseudo gravity that would have an increase effect on the direction of the branch the further the new branch was spawned, resulting in a fuller tree visual.
pink

It was also an opportunity to learn about optimisations, given that I’m spawning quite a lot of branches, that each needs to grow over time, and spawn the next branch. The simplest optimisation I used was to offset some branches growth to later frames. all of the sudden the grow rate was much smoother, with barely any difference noticeable during the generation.

Learning about bezier curves

I encountered bezier curves at work recently, and realised I didn’t have much experience with them. It’s a quite a powerful tool to have, so I decided to re-implement it myself. What you can see is me moving 2 of the 3 control points, and drawing the curve (and rays to the interpolation points) using debug lines in Unity’s editor window. It’s the basics of having defining a curved object out of triangles, which could be useful with my Elastic mesh tech concept, as these triangles could become polygons.

Elastic mesh interaction

This is an example of a the Elastic mesh tech i’ve been playing with in my free time. It can be pulled using an object, which follows the cursor. The way the elastic mesh is built is through a bunch of points that are “fairly” anchored to their origin, but allowed to move by either getting pulled by the player, or pushed/pulled by their neighbours. You then get a distributed inertia through a few neighbours, which looks a bit “elastic”. Each point will try to return to it’s anchor if it’s not being pulled anymore, so the mesh returns to it’s original shape.