AR Test

This is the first assignment for the class XR Studio

Using AR Foundation in Unity I’ve created a window to a space scene. The planets are shaded using a custom simplex noise based shader for which the main code is below.

The window is created by placing four planes with a VR/Occulsion materal around the model of the window. These planes block the scene behind (and in AR show the camera’s video feed instead). The result is that everything “behind” the window is only visible through the window, and occluded outside of the window.

Planet code below:

half oct_noise(fixed3 pos, half scl, int oct, half lac, half per) {

	half noise_val = 0;
	half amp = 1;
	
	for (int i = 0; i < oct; i++) {
		noise_val += snoise(pos * scl) * amp;
		scl *= lac;
		amp *= per;
	}

	noise_val /= oct;
	noise_val = (noise_val + 1) / 2;
	
	return noise_val;
}

void surf(Input IN, inout SurfaceOutputStandard o)
	{
                //This line is what creates the "cloud bands" on the gas giants 
		fixed3 sample_pos = IN.localPos * fixed3(0, 1, 0);

		half turbulence = oct_noise(IN.localPos, 10, 4, 1.5, 0.9);
		sample_pos += pow(turbulence, 2) * 0.01;

		half noise_val = oct_noise(sample_pos, _NoiseScale, _Octaves, _Lacunarity, _Persistence);

		fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color * noise_val;
		o.Albedo = c.rgb;
		o.Metallic = _Metallic;
		o.Smoothness = _Glossiness;
		o.Alpha = c.a;

	}

Waves

Waves is a meditative VR sound generation experience. Experiencers are able to morph a grid around them, which becomes a musical instrument of infinite possibilities. 

Overview

The project is built for a graduate computer graphics class at NYU. It expands on a class assignment to render bicubic surface patches in WebVR. A single patch is presented to the experiencer, who is able to modify it using 16 bezier handles. In “Music Mode” (i.e. while holding the side triggers) the controller becomes a mallet and is able to ‘strike’ the patch, which generates a sound. Lower sections of the patch correspond to lower notes emitted, and thus we have the beginnings of a musical instrument.


Continue reading “Waves”

Time Dilation

The naively ambitious starting point for this project was the idea for a space farming game, wherein the player must manage an interplanetary farming supply chain at relativistic distances and speeds. The core mechanic would involve deciding when to send off your ships at how fast such that they return from their voyages, time dilation and all, with a full harvest of crops.

Pretty early on I encountered two glaring problems with this idea. To start, a game centered around logistics management combined with astrophysics must have such a small niche that it might not even exist, but more importantly I realised that I hadn’t wrapped my head around time dilation enough to do anything productive with it. I needed to approach the concept in a much smaller way first.

Continue reading “Time Dilation”

A Generalisable Astrolabe for a Procedural Universe

Introduction

This is a project for a class on Time. It is also an extension of an ongoing personal project to create a procedural universe. The overarching idea here is to be able to recreate an ancient astronomical timekeeping device (an Astrolabe) for any latitude on any procedurally generated planet.

Continue reading “A Generalisable Astrolabe for a Procedural Universe”