Almost a year ago I started work on a horror game. I suck at horror games. I can play for about half an hour of the first Dead Space game in one go before I need a dread break. I played 1.5 hours of Amnesia over the course of an entire year. I’ve had Alien Isolation since Christmas and I’ve got about 2 hours in because every time the alien kills me I rage-quit and have to go and calm down a bit. So you get the picture. Because I suck at them I don’t tend to play them very often, but weirdly I love the idea of playing them and am fascinated by them.
This is the second post in a series about a shader side project of mine, so make sure you’ve read the first one or this won’t make much sense!
In this post I want to talk about the script I use to interface with this weird vertex wobbling system I’ve made. Before I wrote this script, the shader on it’s own was unruly and impossible to get usable results out of unless you got very lucky with the parameters used. The brilliant thing about shaders is that they can do a lot of maths very quickly using your GPU. The not so brilliant thing is that it can be tricky passing information between shader programs and regular CPU scripts or programs. I have no idea if the way I do it is the best way to do it, but I’ve got some pretty good results with it so far.
This is the start of a series of blogs I intend to write about a fun little side project of mine. I’m kind of making this up as I go along so you’ll have to forgive any obvious mistakes! To understand this you’ll need a basic knowledge of what a mesh is, what vertices are, as well as some intermediate maths, although I’ll try to explain all the necessary stuff as I go along. For the mean time I’ve stripped out all the shader jargon in my code snippets so the maths is easier to read. (N.B. Please add comments if anything doesn’t make any sense and I’ll amend the blog)