56
Lecture 1: Introduction to VR Programming Dr. Kobkrit Viriyayudhakorn iApp Technology Limited [email protected] ITS488 (Digital Content Creation with Unity - Game and VR Programming)

Lecture 1 Introduction to VR Programming

Embed Size (px)

Citation preview

Page 1: Lecture 1 Introduction to VR Programming

Lecture 1: Introduction to VR ProgrammingDr. Kobkrit Viriyayudhakorn

iApp Technology [email protected]

ITS488 (Digital Content Creation with Unity - Game and VR Programming)

Page 2: Lecture 1 Introduction to VR Programming

Course Instructor• Prof. Shigekazu SAKAI

• School of Fundamental Science and Engineering, Waseda University.

• Digital Image Expression

• Computer graphics and animation

• Scientific visualization

• Web content design

Page 3: Lecture 1 Introduction to VR Programming

Course Instructor

• Dr. Kobkrit Viriyayudhakorn

• Creator of CS_UNTITLED / CS_UNTITLED2in Counter Strike 1.6 Game

• Make a few retro game.

• Joined the GlobalGameJam2013@Japan

• Love playing game, as well as making it too.

Page 4: Lecture 1 Introduction to VR Programming

Prof. SAKAI’s course content• Lecture 1: Introduction to Virtual Reality and its Application

• Lecture 2: Principle of Computer Graphic, Elements, and Structure of Digital Content.

• Lecture 3: Audio/Visual Design

• Lecture 4: Improvement of Image Quality by using GLSL

• Lecture 5: Learn Unity Interface and Work-flow of VR content development

• Lecture 6: Computer Graphic Programming (Basic of C.G.)

• Lecture 7: VR Programming

Page 5: Lecture 1 Introduction to VR Programming

Dr. Kobkrit’s Course Content• Lecture 1: Introduction to VR Programming + Unity Installation + Tryout + Game

Design

• Lecture 2: C# Programming (Part 1)

• Lecture 3: C# Programming (Part 2)

• Lecture 4: Basketball VR Game (Part 1)

• Lecture 5: Basketball VR Game (Part 2)

• Lecture 6: Squashy Toad (Part 1)

• Lecture 7: Squashy Toad (Part 2)

Page 6: Lecture 1 Introduction to VR Programming

Grading Policy and Books

Kobkrit’s Part Books:Unity Game Development in 24 Hours, Sams Teach Yourself (2nd Edition)

by Ben Tristem (Author), Mike Geig (Author)

Page 7: Lecture 1 Introduction to VR Programming

Tools that you need.

• PC / Laptop (Already Provided in the Lab room).

• A Phone (iOS/Android) and a phone cable.

• Google Cardboard with a shooting button.

• Please get one at https://vr.google.com/cardboard/get-cardboard/

Page 8: Lecture 1 Introduction to VR Programming

Device Price Resolution

Google Cardboard $20 + phone 1280x768 to 2560×1440

Samsung Gear VR $99 + phone 2560×1440

Google Daydream $79 + phone ??

Hololens $3000 ??

VR Mobile Platforms

Page 9: Lecture 1 Introduction to VR Programming
Page 10: Lecture 1 Introduction to VR Programming
Page 11: Lecture 1 Introduction to VR Programming

Device Price Resolution

Oculus Rift CV1 $599 2160×1200

PlayStation VR (Morpheus) $399 1920x1080

HTC Vive (SteamVR) $799 2160x1200

OSVR $299 2160 x 1200

VR Desktop Platforms

Page 12: Lecture 1 Introduction to VR Programming
Page 13: Lecture 1 Introduction to VR Programming
Page 14: Lecture 1 Introduction to VR Programming
Page 15: Lecture 1 Introduction to VR Programming

TV

30°

Field of View (FOV)

Page 16: Lecture 1 Introduction to VR Programming

VR

~100°

Field of View (FOV)

Page 17: Lecture 1 Introduction to VR Programming

Device Resolution Field of View Pixels per Degree

Google Cardboard 1280x768 to 2560×1440 <90 degrees 7-14

Samsung Gear VR 2560×1440 96 degrees 13

Oculus Rift CV1 2160×1200 110 degrees 10

PlayStation VR (Morpheus) 1920x1080 100 degrees 10

HTC Vive 2160x1200 110 degrees 10

Page 18: Lecture 1 Introduction to VR Programming

Device Performance Sickness Degrees of Freedom Interactions

Google Cardboard Phone hardware Minimal 3 One button

Samsung Gear VR Phone hardware Some 3 trackpad (option controllers)

Oculus Rift CV1 High-end PC Minimal 6 (partial)Xbox controller

(2 hand-held controllers later)

PlayStation VR (Morpheus) PlayStation 4 Minimal 6 (partial) PS Move Controllers

HTC Vive High-end PC Minimal 6 2 hand-held controllers

Page 19: Lecture 1 Introduction to VR Programming
Page 20: Lecture 1 Introduction to VR Programming

Device Development Environment Platforms Marketplace

Google Cardboard OSX, Windows iOS, Android App Store, Google Play

Samsung Gear VR OSX, Windows Android Google Play, Oculus Share

Oculus Rift CV1 Windows Windows Oculus Share, Steam, direct

PlayStation VR (Morpheus) Closed developer program PlayStation 4 PlayStation Store

HTC Vive Windows Windows Steam, direct

Page 21: Lecture 1 Introduction to VR Programming

Game Design & Plan

• Create a rough plan

• Define player’s problem

• Brainstorming concept, rules & requirement

• Document possible future ideas.

Page 22: Lecture 1 Introduction to VR Programming

User’s Problem

• Boredom

• I want to challenge myself.

• Want to beat my friends.

Page 23: Lecture 1 Introduction to VR Programming

Concept

• You are a miner and you want to find a gold pit.

• All you know is your distance between yourself and the gold pit from a gold-o-metric detector.

Page 24: Lecture 1 Introduction to VR Programming

Rules

• You can move up, down, left, and right.

• Movement is a fixed distance.

• After each turn, your distance from the gold pit is displayed.

• You win when you get the gold pit.

• Your score is how many turns it took.

Page 25: Lecture 1 Introduction to VR Programming

Write the game requirement

• What assets will you need?

• How much sound effects?

• What artworks will you need?

• What features will you leave out?

Page 26: Lecture 1 Introduction to VR Programming

Requirements

• Introduction and story text.

• Some ASCII artwork.

• No sounds.

Page 27: Lecture 1 Introduction to VR Programming

Future Ideas (Leave out List)

• Graphical Interface.

• Sound effects.

• Mouse Input.

Page 28: Lecture 1 Introduction to VR Programming

What is ?• Unity is a game engine developed by Unity Technologies.

• Used for developing Video games and simulation.

• Cross-Platform! the game be deploy to 27 operating systems!! as shown on the right =>

• iOS, Android, Mac, Windows, Linux, Oculus Rift, Web, ....

• First Released in 2005, Latest Stable release: 2017.1 on July 1, 2017

Page 29: Lecture 1 Introduction to VR Programming

Unity Licensing

- CCU stand for ConCurrent Users worldwide.

Page 31: Lecture 1 Introduction to VR Programming

Double Click Select all default option.

Password: Student

Page 32: Lecture 1 Introduction to VR Programming
Page 33: Lecture 1 Introduction to VR Programming
Page 34: Lecture 1 Introduction to VR Programming

Tryout: Create a new Project

Page 35: Lecture 1 Introduction to VR Programming

Play around change windows as you wish.

Page 36: Lecture 1 Introduction to VR Programming

Reset Window Layout Back to Default

• Go to top right, Select Layout.• Select "Default"

Page 37: Lecture 1 Introduction to VR Programming

Scene Screen

• Right Click Drag: Move Around

• Middle Click Drag: Pan Around

Page 38: Lecture 1 Introduction to VR Programming

Top-bar View

Page 39: Lecture 1 Introduction to VR Programming

Hierarchy Windows

• Show the hierarchy of 3d objects in the Scene.

• You can select objects from either scene or hierarchy windows and do some operation to it at the Inspector windows.

• You can search objects by typing the name into the search box.

Page 40: Lecture 1 Introduction to VR Programming

Inspector Windows

• Usually on the right panel of the screen.

• Showing the various property of the selected objects.

• You can read and modify any object’s property.

• Try to select different object property and see how it changes.

Page 41: Lecture 1 Introduction to VR Programming

Console Windows

• At the bottom, the second tap.

• Print out the text, console out.

• We are going to make a game via Text Console.

• Not yet need to use the 3D object.

Page 42: Lecture 1 Introduction to VR Programming

Project View

• Show all files and assets used in the project.

• You can save them as the favorites for easily access later.

Page 43: Lecture 1 Introduction to VR Programming

– Kobkrit V.

“Let start making a game”

Page 44: Lecture 1 Introduction to VR Programming

Let’s create the first script!

Right click at Project Window Name it as "ConsolePrinter"

Page 45: Lecture 1 Introduction to VR Programming

Start writing a code• Double Click at the ConsolePrinter.cs

• The MonoDevelop-Unity IDE will be show up and you can make the first program.

Page 46: Lecture 1 Introduction to VR Programming

Code structure

Page 47: Lecture 1 Introduction to VR Programming

Printing a Text

Page 48: Lecture 1 Introduction to VR Programming

Important Notice.

In C#, Name in the filename must be the same with the name of the class.

Page 49: Lecture 1 Introduction to VR Programming

How can we run?

• We need to add the script (as a component) to the game objects.

• In order to be run, Script (and other game components) need to be attach to the game objects.

Page 50: Lecture 1 Introduction to VR Programming

Create a New Game Object

Right click Select

Rename + Enter

Inspect Window on the right.

Page 51: Lecture 1 Introduction to VR Programming

Attaching Script to A Game Object1. Drag the

ConsolePrinter script and drop onto ConsolePrinterGO in Hierarchy Window

2. Or Drag onto Inspector Window

Page 52: Lecture 1 Introduction to VR Programming

Start Running

• Click on Run Button

• Switch to Console Window, you will see "Hello World!" text.

Page 53: Lecture 1 Introduction to VR Programming

Try to Remove the Script from Game Object

• At the inspector panel, try to click at the little gear next to the component (script) name.

• Select "Remove Component"

• Try to hit "Run" button again.

• What happen?

• Don’t forget to re-attach into the game component.

Page 54: Lecture 1 Introduction to VR Programming

Making the Game Introduction

1. Add the game introduction Text 2. Hit "Run" Button 3. Game Introduction is shown!

Page 55: Lecture 1 Introduction to VR Programming

Making your own game introduction!

Page 56: Lecture 1 Introduction to VR Programming

Q/A