Tentacle Suckers Shader

Following the unexpected success of the tutorial on Inverse Kinematics for Tentacles, I have decided to share the shader that I used to make them so realistic.

If you are not familiar with shaders, fear not. This tutorial will be target at beginners, and you’ll only need a basic understanding of how Unity works.

  • Introduction
  • Part 1. Creating a new Shader
  • Part 2. Refitting the Shader
  • Part 3. Normal Extrusion
  • Part 4. Sucker Waves
  • Part 5. Selective Extrusion
  • Conclusion & Download

A link to download the full Unity package for this tutorial is provided at the end.

Continue reading

How to generate Gaussian distributed numbers

In a previous post I’ve introduced the Gaussian distribution and how it is commonly found in the vast majority of natural phenomenon. It can be used to dramatically improve some aspect of your game, such as procedural terrain generation, enemy health and attack power, etc. Despite being so ubiquitous, very few gaming frameworks offer functions to generate numbers which follow such distribution. Unity developers, for instance, heavily rely on Random.Range which generates uniformly distributed numbers (in blue). This post will show how to generate Gaussian distributed numbers (in red) in C#.

gvu

I’ll be explaining the Maths behind it, but there is no need to understand it to use the function correctly. You can download the RandomGaussian Unity script here.

Continue reading