rendering video with unity - prashast.in · workshop led by prashast thapan () game engines for...

23
Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy RENDERING VIDEO WITH UNITY

Upload: others

Post on 31-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

RENDERING VIDEO WITH UNITY

Page 2: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Babycastles Academy presents...

Game Engines For All:Rendering Video with Unity & Unreal Engine

Game engines are intimidating when you don’t know what you want to do with them. By learning how to render video in Unity & Unreal Engine, we will get a cursory understanding of how each engine works, and their respective pros and cons.

This workshop is free and open to public with RSVP. No prior experience with 3D software or game engines necessary, but definitely a plus. Laptop and mouse encouraged, but not required. Do bring something you can take notes on if you’re unable to bring a laptop + mouse.

Agenda:Installing Unity & Unreal EngineNavigating the interfaceWorld buildingCamera animationPost-processingSimple scriptingQ&A

Workshop led by Prashast Thapan (www.prashast.in)

Page 3: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

1. INSTALLING THE ENGINE

Page 4: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Get the Unity Installer from store.unity.com In the components installer Check Unity

(Win & Mac Build optional for now, you would need them if you intend to create a standalone build.)

Page 5: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

While that’s installing...Go back to store.unity.com: Create an account, use it to sign in

Click New + for New Project Name it, select “3D” and Launch

1

2

Page 6: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

2. NAVIGATING THE INTERFACE

Page 7: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Click New + for New Project Name it, select “3D” and Launch

TOP HALF:LEVEL DESIGN

BOTTOM HALF:OVERALL PROJECT

Project Window: Outliner + Folder View (chopping board)

Scene View: Your level design visualized, where all the ingredients come together

Hierarchy: An outliner of what’s in the Scene

Inspector: when individual objects from either half are selected, we can modify their properties here.

Page 8: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

3. WORLD-BUILDINGA.K.A. THE PART THAT REQUIRES MUSCLE MEMORY

Page 9: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Click New + for New Project Name it, select “3D” and Launch

By default, a scene comes with a Camera & Directional Light. The Gameobject Menu allows you to add gameobjects to your Scene (and modify them) Gameobject > 3D Object > Cube

Page 10: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Get a feel for navigating the Scene View around the cube you just created

Left-Click : select object Left-Click + drag : select objects using rectangular selection Right-Click + drag : look around Alt+Right-Click + drag : zoom Middle-Click + drag : pan Scroll : zoom Right-Click + W: fly forward Right-Click + S: fly backward Right-Click + A: fly left Right-Click + D: fly right Right-Click + Q: fly downward Right-Click + E: fly upward Combine with Right-Click + drag to change your direction mid-flight

“Transform” in 3D software generally has 3 aspects: Position, Rota-tion, and Scale. We will learn to transform objects by creating a simple scene using basic game objects.

TRY IT OUT NEXT UP

Page 11: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

You can change the material here. Try clicking the tiny dot to the right of the ElementID and try a random one for fun.

Try the shortcuts

Let’s take a look at the Inspector. The very first box says “Transform.” We can change the values manually by typing them in.

1

Standard Shortcuts for Transform Gizmos (a lot of 3D software uses the QWERTY group of keys to change the Transform of objects)

Q: Pan W: Position Gizmo E: Rotation Gizmo R: Scale Gizmo T: Rect Tool (useful for Unity 2D) Y: All Three!

2The top-left toolbar contains gizmos that make transforming objects easier. Click to activate. Gizmos work by pulling at a specific axis (X, Y, Z). In 2D, we have width and height. 3D adds depth and these three parameters are put into the X, Y and Z values.

3

4

Get a feel for using gizmos by Left-Click + dragging the X, Y, or Z axis

From left to right: Pan, Position, Rotation, Scale, Rect Tool, 3-in-1 Gizmo)In the same order as the shortcuts in Step 4

Page 12: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

1

Add Sphere and Cylinder from GamoObject menu Scale down the Cube to create a floor Change the scale and rotation of the objects to add some variation

The cube now looks like a floor and has two friends

Page 13: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

4. CAMERA ANIMATION

Page 14: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

1

Window > Animation > AnimationLearn how to dock a window, and shift windows aroundSelect the Camera, and in the Animation Window, click the button to Create a New Animation Clip

Press the “Record” button in the Top left to start “recording” movementMove the scrubber to a timestamp that’s not zeroIn record mode, use the move gizmo and rotate gizmo and observe the tracks that are added in the animation window

It’s makes things easierto dock the animationwindow in the lower halfso you can have breadthfor the timeline and previewthe scene on top

Page 15: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

5. POST-PROCESSING

Page 16: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Window > General > Asset Store Search for Post Processing Stack by Unity Technologies Download and Import into Project

1 Open Asset Store Window

2 Search for “post processing stack”

3 Get this one

Page 17: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Create a Post Processing Profile Click Main CameraAdd ComponentPost Processing Behavior

In the new Post Processing Component on the camera, select the Post Processing Profile created in previous step

Page 18: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

There’s a lot to explore with the Post-Processing Stack. Try enabling different effects on the camera and playing with their values.

Rendering the video!

TRY IT OUT

NEXT UP

Page 19: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

6. SCRIPTING

Page 20: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Get the ScreenshotMovie script from: http://wiki.unity3d.com/index.php/ScreenshotMovie

using UnityEngine; public class ScreenshotMovie : MonoBehaviour{ // The folder we place all screenshots inside. // If the folder exists we will append numbers to create an empty folder. public string folder = “ScreenshotMovieOutput”; public int frameRate = 25; public int sizeMultiplier = 1; private string realFolder = “”; void Start() { // Set the playback framerate! // (real time doesn’t influence time anymore) Time.captureFramerate = frameRate; // Find a folder that doesn’t exist yet by appending numbers! realFolder = folder; int count = 1; while (System.IO.Directory.Exists(realFolder)) { realFolder = folder + count; count++; } // Create the folder System.IO.Directory.CreateDirectory(realFolder); } void Update() { // name is “realFolder/shot 0005.png” var name = string.Format(“{0}/shot {1:D04}.png”, realFolder, Time.frameCount); // Capture the screenshot Application.CaptureScreenshot(name, sizeMultiplier); }}न

Right-Click in the Project Window

Double-Click on the script to open it up.Then Copy+Paste the script into the window that opens.

It’s good practice for your script’s filename to be the same as what you define the MonoBehavior to be.

Page 21: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Save the script. Click the Camera in the Hierarchy Window. In the Inspector, click Add Component. In the search bar find your script.

1 Add Component

2 Search for the script3 Select it

Page 22: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

7. PRESSING THE “RENDER BUTTON”

Page 23: RENDERING VIDEO WITH UNITY - prashast.in · Workshop led by Prashast Thapan () Game Engines For All: Rendering Video with Unity & Unreal Babycastles Academy 1. INSTALLING THE ENGINE

Game Engines For All: Rendering Video with Unity & Unreal

Babycastles Academy

Testing the Game in Editor will create an image sequence in the Unity Project Folder