CS248 Lecture 2 I NTRODUCTION TO U NITY. January 11 th, 2017

Similar documents
Google SketchUp/Unity Tutorial Basics

3dSprites. v

Game Design Unity Workshop

IAT 445 Lab 10. Special Topics in Unity. Lanz Singbeil

Game Design Unity Workshop

Easy Decal Version Easy Decal. Operation Manual. &u - Assets

Adding a Trigger to a Unity Animation Method #2

Unity Game Development

UNITY WORKSHOP. Unity Editor. Programming(Unity Script)

CS148: Maya Lecture. October 9th, 2017 David Hyde

Workshop BOND UNIVERSITY. Bachelor of Interactive Multimedia and Design. Asteroids

DAZ Page 1. DAZ3D to Unity (Objects and Clothing)

About the FBX Exporter package

Coin Pusher Pro Asset - README

Terrain. Unity s Terrain editor islands topographical landscapes Mountains And more

Unity3D. Unity3D is a powerful cross-platform 3D engine and a user friendly development environment.

Introduction to Unity. What is Unity? Games Made with Unity /666 Computer Game Programming Fall 2013 Evan Shimizu

3D Starfields for Unity

Mobile Touch Floating Joysticks with Options version 1.1 (Unity Asset Store) by Kevin Blake

Planet Saturn and its Moons Asset V0.2. Documentation

Pimax VR SDK_Unity. Development Documentation

Underwater Manager (Optional)

Getting Started. Extruding Features. Convert to feature class

Full Screen Layout. Main Menu Property-specific Options. Object Tools ( t ) Outliner. Object Properties ( n ) Properties Buttons

Game Design Unity Workshop

STEP 1: Download Unity

Tutorial: Using the UUCS Crowd Simulation Plug-in for Unity

8K Earth, Moon and Mars Shaders Asset V Documentation

Auto Texture Tiling Tool

Auto Texture Tiling Tool

COMS W4172 : 3D User Interfaces Spring 2017 Prof. Steven Feiner Date out: January 26, 2017 Date due: January 31, 2017

Unity Scripting 4. CS 491 / DES 400 Crea.ve Coding. Computer Science

User Guide. v1.0. A-Lab Software

Creating and Triggering Animations

UDK Basics Maya Export/UDK Import/Viewport and placing content

Mount Points Mount Points is a super simple tool for connecting objects together and managing those relationships.

Terrain. Unity s Terrain editor islands topographical landscapes Mountains And more

COS 116 The Computational Universe Laboratory 10: Computer Graphics

ANIMATOR TIMELINE EDITOR FOR UNITY

Extract from NCTech Application Notes & Case Studies Download the complete booklet from nctechimaging.com/technotes

MIXED REALITY (AR & VR) WITH UNITY 3D (Microsoft HoloLens)

Code Repository. P Blanchfield

PSD to Mobile UI Tutorial

Setting up A Basic Scene in Unity

Workshop BOND UNIVERSITY Bachelor of Interactive Multimedia and Design Beginner Game Dev Character Control Building a character animation controller.

Quick Start Tutorial

COS 116 The Computational Universe Laboratory 10: Computer Graphics

Chart And Graph. Features. Features. Quick Start Folders of interest Bar Chart Pie Chart Graph Chart Legend

8/16/2014 UNITYCODER.COM MOBILE PAINT

Flames in Particle Flow

Planets Earth, Mars and Moon Shaders Asset V Documentation (Unity 5 version)

Sample Spark Web-App. Overview. Prerequisites

Dialog XML Importer. Index. User s Guide

UDK Basics Textures and Material Setup

MEGACACHE DOCS. Introduction. Particle Simulations. Particle Exporters. Example Videos

Apple Modelling Tutorial

VEGETATION STUDIO FEATURES

Textures and UV Mapping in Blender

IAP Manager. Easy IAP Workflow. Copyright all rights reserved. Digicrafts 2018 Document version Support

MIXED REALITY (AR & VR) WITH UNITY 3D (Microsoft HoloLens)

ICS 61 Game Systems and Design Introduction to Scratch

Quick Setup Guide. Date: October 27, Document version: v 1.0.1

OxAM Achievements Manager

Introduction to Unreal Engine Blueprints for Beginners. By Chaven R Yenketswamy

Spell Casting Motion Pack 5/5/2017

Pong in Unity a basic Intro

Animate this crate. Part 1 adding PWK Use

Lightning Strikes. In this tutorial we are going to take a look at a method of creating some electricity zapper effects using Particle Flow.

Pick up a book! 2. Is a reader on screen right now?! 3. Embedding Images! 3. As a Text Mesh! 4. Code Interfaces! 6. Creating a Skin! 7. Sources!

Game Design From Concepts To Implementation

Basic Waypoints Movement v1.0

StudioPrompter Tutorials. Prepare before you start the Tutorials. Opening and importing text files. Using the Control Bar. Using Dual Monitors

Quick Tutorial. Overview. Creating an Effect

TITLE CLOUD BASED VIDEO ANIMATION RENDERING MANAGEMENT SYSTEM INVENTOR: Thomas Ryan Mikota, of Orem Utah

Game Starter Kit Cheat Sheet

Effective Software Development and Version Control

PHOTOGRAMMETRY CLEAN UP VER 2.0

Chapter 1- The Blender Interface

The Old World. Have you ever had to collaborate on a project by

UI Elements. If you are not working in 2D mode, you need to change the texture type to Sprite (2D and UI)

When you tag an object as static batched, then Unity will group that object in with other objects that share the same material.

You can also export a video of what one of the cameras in the scene was seeing while you were recording your animations.[2]

Mia Round Corners Node

STARTING COMPOSITING PROJECT

4) Finish the spline here. To complete the spline, double click the last point or select the spline tool again.

Introduction to Digital Modelling and Animation in Design week 4 Textures

Converting Project Maps to File Textures

User Manual. Version 2.0

How to Create a Simple Animation Using MAYA

VirMuF Manual V 0.5 1

GAM 223 Game Design Workshop. Project 3D Maze Level Design DUE DATE: / / Design, Modeling & UV unwrapping

Tutorial: Exporting characters (Maya)

Tutorial: Exporting characters (Max)

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Unity

UFO. Prof Alexiei Dingli

Product Features. Web-based e-learning Authoring

Burning Laser. In this tutorial we are going to use particle flow to create a laser beam that shoots off sparks and leaves a burn mark on a surface!

CSE 332: Data Structures and Parallelism Winter 2019 Setting Up Your CSE 332 Environment

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Tutorial Physics: Unity Car

Transcription:

CS248 Lecture 2 I NTRODUCTION TO U NITY January 11 th, 2017

Course Logistics Piazza Staff Email: cs248-win1617-staff@lists.stanford.edu SCPD Grading via Google Hangouts: cs248.winter2017@gmail.com Homework 1 due Monday (January 16 th ) If MLK day does not work for you, find a CA on January 17 th. Go to office hours OR schedule a time with another CA in advance. Can not make the grading session? Get in touch with the CA s. Office hours on website. Any changes will be announced on Piazza.

Overview Who Uses Unity? Getting Setup with Unity Unity Resources Unity Overview Unity Tutorial Live Demo Q&A

Who Uses Unity? MORE THAN JUST POOR INDIE DEVELOPERS

Who Uses Unity?

Who Uses Unity?

Who Uses Unity?

Who Uses Unity?

Who Uses Unity?

Who Uses Unity? And more! https://en.wikipedia.org/wiki/list_of_unity_games

Getting Setup with Unity THERE REALLY ISN T MUCH TO SETUP.

Installation Download the Personal Edition : https://unity3d.com/get-unity Select appropriate build targets during installation! ios: Come to my office hours to get added to the Stanford s Apple Developer account Wait for an announcement on Piazza. Currently some licensing problems that need to be resolved by Stanford s legal department may take awhile.

Project Creation

Source Control Setup (Git) Note: If you do end up using source control (i.e. Github, Bitbucket), make your repository private.

Source Control Setup (Git) Assuming you have your repository setup (Github comes with a.gitignore for Unity, use it! Go to where your project is located (from project setup screen: Location followed by the project name) Delete the Library folder. Point your command line git to the folder and run: git init git remote add origin GIT_URL_HERE git pull origin master git commit -am COMMIT_MESSAGE git push origin master Unity Docs: http://docs.unity3d.com/manual/externalversionc ontrolsystemsupport.html Smart Merge: http://docs.unity3d.com/manual/smartmerge.html Will be useful for collaboration on scenes/prefabs!

Unity Resources PLEASE READ THE DOCUMENTATION

Documentation Manual: http://docs.unity3d.com/manual/index.html Scripting API: http://docs.unity3d.com/scriptreference/index.html These pages should become your best friends. Also: http://forum.unity3d.com/

Asset Store

Unity Overview NOT A COMPREHENSIVE OVERVIEW

Everything is a GameObject All objects in your scene hierarchy Cameras Lights Gameplay Logic User Interface Etc. Can be destroyed/created on the fly or be made to not get destroyed when the game changes scenes (this is how you get persistent behavior!): http://docs.unity3d.com/scriptreferen ce/object.dontdestroyonload.html

Everything is a GameObject A GameObject does nothing on its own. All GameObject have a Transform component to let it know its position/rotation/scale. Must add Components to the GameObject to give it some behavior.

Everything is a GameObject Many components already exist! But you might want to create your own. These are your scripts that inherit from MonoBehaviour. Strong Recommendation: Code in C#.

Everything is a GameObject GameObject: http://docs.unity3d.com/scriptreference/gameobject.html MonoBehaviour: http://docs.unity3d.com/scriptreference/monobehaviour.html Drop and Drop Script onto GameObject in the Inspector or manually add it by going to Add Component > Scripts > YOUR_SCRIPT_NAME_HERE Public variables will show up in the Inspector. A variable that is a Component can also be modified by the inspector! Very useful.

Assets Scenes Prefabs Scripts Textures Animations Models Particles Sprites Etc.

Prefabs You created some hierarchy of GameObjects and you want to reuse this hierarchy in multiple places. Use prefabs! You can also assign prefabs to scripts which have a public variable of type GameObject to be able to programmatically spawn prefabs! Or you could just load it by its path (may be more convenient in certain cases): http://docs.unity3d.com/scriptreference/resources.load.html Create an empty prefab and it will go into your assets folder. A gray prefab is an empty prefab!

Prefabs Drag and drop the GameObject onto the gray prefab object and the prefab will turn blue! (and so will the GameObject in the hierarchy). Blue indicates that it is an instance of a prefab and Unity will warn you if you try to change that object! Now you can delete the GameObject that exists in the hierarchy, drag and drop the prefab back into the hierarchy and you will see the GameObject show up again!

Editor Camera Controls Maya -like Controls: Alt + Left Click & Move: Rotate Camera Alt + Right Click & Move (Or Scroll Up/Down): Move camera back and forth Alt + Middle Click & Move: Move camera up/down or left right Flythrough Mode: Click and hold right mouse button and now you can use FPS-like controls to move around through the scene (WASD, Q/E to move up down). Unity Documentation: http://docs.unity3d.com/manual/sceneviewnavigation.html

Editor Object Controls Maya -like Controls (after selecting an object): W: Activate translation widget. E: Activate rotation widget. R: Activate scale widget. Manual Movement: Modify position/rotation/scale in the Inspector. Rotation is in Euler angles. Rotation order: Z, X, Y. Unity Documentation: http://docs.unity3d.com/manual/positioninggameobjects.html

Creating Geometry via the Unity Editor

Setting Up The Scene Camera Do not confuse the scene camera with the editor camera. Unity scenes by default come with a Main Camera. Notice the tag of MainCamera in the inspector, this will be useful for accessing the camera from your scripts. Camera Preview box is useful to see what your camera can see. Camera Preview is what you will see when you hit Play!

Setting Up The Scene Camera Moving the scene camera can be done manually by changing the position/rotation/scale in the Inspector. Or you can move the editor camera around as mentioned earlier, select the camera and align the camera to the view. Note that your camera should be selected before doing this. Hit play and this view will be sufficient for the screenshot in Assignment 1.

Import External Objects Create and export an object from Maya/Blender/3ds Max as either an *.OBJ or a *.FBX. You can save this anywhere. Why *.FBX? You will see later when we start talking about character animation. Then import this asset into Unity. Unity will take care of everything for you. Alternatively, you can just save your *.OBJ or *.FBX inside the Assets folder. You will need to right click on the folder it is in and click Refresh to get it to show up.

Import External Objects Click and drag the object from the assets library into your scene hierarchy and it should now show up! There is a difference in how the GameObject is setup depending on whether you use an FBX or OBJ but that difference is not relevant for now.

Shading and Materials Fairly easy to write your own shader but the Unity Standard shader is very powerful and can probably be used in most situations! In most cases you will want to select a shader that comes with Unity and modify the material properties to achieve the look that you want Manual Shader Documentation: http://docs.unity3d.com/manual/shadersoverview.html Standard Shader Documentation: http://docs.unity3d.com/manual/shader-standardshader.html Materials Documentation: http://docs.unity3d.com/manual/materials.html

Importing Textures Process is the same as importing an external object. This time, instead of selecting an *.FBX or *.OBJ, select a *.PNG, *.JPG, etc. You can also place the images inside the Assets folder manually. Note that you should make sure your imported object has a UV map before continuing! You can check this in Maya/Blender/3ds Max.

Using Textures Click on the object you imported in the scene hierarchy and expand the shader properties in the Inspector. The diffuse texture that we used in CS148 is now the Albedo. There is no distinction between the diffuse and specular color as you saw with the Epic BRDF. Look at CS148 Assignment 4 if you want great (no bias) refresher on what the BRDF/Material does. http://web.stanford.edu/class/cs148/assignments/assignment4.pdf

Using Textures (Option 1) Click and drag the imported texture onto the square next to Albedo and your object should now have a texture on it!

Using Textures (Option 2) Click on the circle next to Albedo and select your texture in the dialog box!

Lighting Lighting Documentation: http://docs.unity3d.com/manual/lighting.html Global Illumination Documentation: http://docs.unity3d.com/manual/globalillumination.html Lighting is accomplished with the Light component.

Creating a Light

Light Component Properties Light Types: Directional Light Spot Lights Point Lights Area Lights

Light Component Properties Color and Intensity

Unity Tutorial HOW TO DO ASSIGNMENT 1

Questions? YOU CAN ALSO ASK ME AFTER CLASS.