Pages

Thursday, 16 November 2023

VR Door and Key System

This week I've implemented a door and key system in my VR game...  you pick up a key, and then you're allowed to enter a door.  For the user interface, the colored key is displayed on your wrist (and disappears once used).

Pick up keys and open doors


Thursday, 28 September 2023

Helios Mk2 update

I've finally started work on the follow up to the $20 synth...   The Helios Mk2  

It's still very early in development but it's starting to come together.  So far it has a keyboard with arpeggiator (plus MIDI so you can use a proper keyboard), a delay, but most importantly of all there's lots more synthesis options :-)



Friday, 1 September 2023

Performant Grass for VR

 



It's probably not the most enticing headlining you've ever read, but it might be of some interest for some! I first saw this effect used in Half Life 2, where they use a flat 2D image and then use code to have it always be positioned towards the camera (so you never see it's flat).   Actually thinking about it a little more, all of the enemies in Doom were created in this way. Where as in Half Life 2 they used it sparingly and effectively, I've gone completely over the top and just copied and pasted like there's no tomorrow.  I'll be a bit more subtle next time I promise.  Here you can see the position change a little clearer:




The images were created from DALL-E (using prompts like 'bush single branch with leaves flat 2d albedo texture on black background').  From here I adjusted the image in Affinity designer:


In unity you need to change the image type to 'Sprite 2D & UI', get the Alpha Source from 'Grey Scale', generate Mip Maps and change the max size to something like 256.  The Alpha source is important here, as that's what removes the black background.

The C# script is very simple:

public class LookAtPlayer : MonoBehaviour
{
    public GameObject player;
    // Start is called before the first frame update
    void Start()
    {
        
    }
    // Update is called once per frame
    void Update()
    {
        transform.LookAt(player.transform);
    }
}

We declare a public variable, which when back in Unity, we drag the main camera onto.  

And that's all there is to creating performant grass!

Thursday, 24 August 2023

Further Adventures In VR

 I've been getting deeper into Unity VR, this time using the VR interaction toolkit asset to help create some different types of doors and lifts: