This project was used as the final project for my CSS 551 (Advance Computer Graphics) course at the University of Washington, Bothell. This proposed project uses the Google Cardboard VR and a Bluetooth controller to decorate a snowman in VR. One of the larger requirements for this project is that we had to implement our own object hierarchy like we did for one of our previous assignments. I highly recommend reading my previous post to see how I how I implemented Unity's object hierarchy system. Other requirements included supporting a secondary view (camera) and implementing a custom diffuse light.
When users start the application, they're immediately placed into a world that provides them a blank snowman for them to interact with. The snowman is constructed of three nodes which are nested underneath one another. In other words, the snowman base is a parent to the snowman torso, which is a parent to the snowman head. Users can select which node to interact with using the controller. The world canvas shows the user which node is currently selected. With a node selected, users can translate, scale, and rotate the node using the Bluetooth controller. Additionally, other game objects are shown to the user which act as "snowman accessories".
There are different accessories for each of the snowman nodes. These objects can be dragged and dropped onto the snowman. Once they're attached to the snowman, the object is then considered a child object to the the node. As the scene node moves in the scene, the snowman accessory moves along with it.
Diffuse Light
A Christmas star was added to the scene which acts as diffuse light which illuminates our snowman. This light can be moved around the scene to the user's content. The position of the Christmas star is loaded into the shader prior to rendering the game object. The appropriate lighting angles are then computed in the fragment shader to determine the "strength" of the light onto each fragment.
Snowman Camera
A special accessory game object is displayed when the user selects the head node. When the "Top Hat" game object is added onto our snowman, a quad is introduced into the scene which shows the view of the snowman. If the user updates the transformation of the head node, the camera position will also move accordingly.
I had a lot of fun working on this project. I'd love to work more on the lighting. Some ideas included having the Christmas star light the whole scene instead of only illuminating the snowman. Another idea is to support "Christmas lights" using the same concept of manually implementing the light to bring more color to the scene.
You can view a full walk through demo here:
Languages and Tools Used:
Unity3D, Google Cardboard VR, C#, HLSL
Comments