Apr 18 2018


Unity Systems Overview (talk notes)

Filed under How-To,Unity3D

these notes on blog (+ other blogs exist). Will pause in 30 minutes (see if anyone wants to keep going).
This is a fast talk to share terms, and usage tips. google a term – check the date (note: VR has a 3 month expiration).

Core takeaway: don’t get lost in sliders. setup your whole game system asap, then go back and tweak. (a working system is inspiring on it’s own. like a baby.).



SYSTEMS:
1. basics
2. canvas (UI)
3. Shaders + materials
4. physics (colliders vs. triggers)
5. animation vs. animator (mechanim)
6. profiler

-break-

7. imports vs. prefabs (reusable objects)
8. audio, particles, etc.
9. lighting vs. rendering (postfx)
10. cameras (+ timeline + cinemachine = cut scenes)
11. VR options (+ AR? + Vuforia?)
12. THE FUTURE (proBuilder, SRP, shader networks, post fx volumes)



1. Basics
name areas. Project > “show in explorer” (deleting is for real). Everything has Transform (even when setActive(false)).
“GameObject”. “Components” (are all scripts. GetComponent(). ).
“f” to focus. “v” snap to vertex. gimbal to iso.
“move to view.” Hold right mouse, use WSAD to move around in fps mode.
Can copy component values from Game play time. (or take screenshots). units are meter (Maya is cm). white/brown boxing recommended.

settings: build (pick your platform first), Player (+ graphics, input)



2. Canvas
Three possible spaces (screen space – overlay, camera. world space). Scalar (constant – pixel, physical. scale with screen).
Rect Transform (+ Rect tool). Creating canvas adds Event System (with input module. to change out for VR).
UI primitives offer lots of interaction with other systems without programming (note: special var selection for “Dynamic” updating)

UI shader renders back to front (repeatedly). Layering UI can exponential the draw calls.
make font big, then scale down (?).
+ 3D (object) text is separate hack for avoiding Canvas. Shows through.




3. Shaders
A shader(process) tells a GameObject (“mesh renderer”) how to apply a material (ammunition).

Material: first set the shader type to see relevant options. Then set rendering mode.
(+ Metallic v Specular Setup? specular lets you mess with highlight and rim)
(+ secondary maps for detail up close)

Shader: default has all this extra crap. Can write your own – in it’s own programming space (ugh).
(can dissolve based on slider, or world coordinates – from top down show a second material based on a 3rd material as mask )
2 sides to any shader: Vertex (shape of surface. geometry) verses Pixel (“Fragment” between. color)
cool tricks: Geodesic animated, wind sway
FUTURE: Shader Networks coming (ala Unreal, Maya)

+ Textures: set to minimum resolution! (power of 2) (sprite sheet, auto cut)



4. Physics
Rigid bodies (useGravity, isKinematic). (Configurable joints) (colliders vs. triggers – how access touch point(s))
– colliders are additive (includes the colliders on children).
– don’t use mesh collider! (draw example of convex calculations?).
– try to keep mass around 1 (or things blow out)
– joints mess with imported skeleton animation system (?mystery?).




5. Animation vs. Animator (mechanim)
…tion: Make Clips. hit record and go. “k” to keyframe.
Call event during animation: is calling a “public” function (from a script on object with the animator controller)

…tor: Set Default state. Make transition (& adjust blend). Conditions (use Parameters). Layers build on each other. “a” frames all.
– view while playing to see which animation is active.
– Create Blend Tree, add Motion (clips). Choose 1D (linear transitions) or 2D(blend based on position)
– If using “Humanoid” Rig – Reach for object with .SetIKPosition() (Base Layer: checkmark “IK Pass”)




6. Profiler
click anywhere to pause. deep dive.

– Don’t do string compares (like “.findByName()”) don’t instantiate. fear UI rendering. try to use 1 active light and bake rest into lightmaps.
… talk about Forward v deferred rendering?
deeper dive with Frame Debugger (enable)
– shallower dive with “Stats” in Game window.


7. Imports vs. Prefabs (reusable objects)
turn down image size! images go to Power Of 2 (set images up that way, less overhead for mobile)
drag gameobject into prefab folder to make it reusable. edit in project, or drag to hierarchy and click “apply”
– code: add scene objects as variables when instantiating (+ look into Pooling instead).

+Free people: makeHuman or Adobe Fuse, Mixamo animations, free 3D objects: SketchFab, Poly, Remix3D. (honor the license)




8. Audio, Particles, Line Renderer, etc.
Listener on (every) camera. Audio Source(s) play Clips.
-setup temp audio from start (ultimately 10% processor, usually. at least)

particles have similar concerns as UI (layered transparency).

one line renderer per object (billboard). trace xyz of hands or where rayCast is hitting.




9. Rendering (Lighting vs. Post Processing)
open the lighting window. skybox.

bake lightmap(s?)

import Post Processing Stack asset (or wait for next version?)

cool trick: paint on lightmaps




10. Cameras (+ Timeline + Cinemachine = cut scenes)
– Clear Flags: ditch the skybox (see Lighting for more skybox)
– Culling Mask: don’t draw things in this camera
– Depth : layering multiple cameras (larger # is on top)
– Viewport rect: crop view (W,H: 0 to 1 are percentages). quick map overlap.
– RenderTexture: send camera view (to a quad).

Timeline is a sequencer (for any component). Can wait (loop) until something happens in game (change enemy activity, animatons, camera angles).
Cinemachine is a camera crew (look at things, follow them. Main camera can transition through your virtual cameras using Timeline)

– Cinemachine can record video (Adam).(…No gameplay allowed?).

+ note: you can screen record Game window, then export to gif (good for VR demo. twitter).

+ make movies instead of apps? (Otoy OctaneRender?)




11. VR options (and AR? Vuforia?)
… future talk?

SteamVR (OpenVR): Import Asset. Improves Renderer. messes with physics? many quick examples (instant teleporting. bow).

Oculus: Quickstart /w Touch (don’t trust frame rate in Stats? bug where it reports tracking rate?). Oculus Start program.

I don’t like VRTK (locked into their system). but updates often, many others like it.




12. THE FUTURE (proBuilder, SRP, shader networks, post fx volumes).
GDC talk
Unity blog, plus R&D Labs(photogrammetry delighting)
UNITE Conference (ask an expert)

Print Friendly, PDF & Email

No responses yet




Trackback URI | Comments RSS

Leave a Reply