Skip to content
Cawd Logo GAWD
  • Home
  • About
  • Assignments
  • Resources
  • Contact

Friday, May 9th

Friday, May 9th

Class Hours: 10:05 – 2:40
Mr. Bohmann | wbohmann@ewsd.org

10:05 Today’s Notes & Attendance

  • This is the end of week 31 – the only assignment currently due is your Breakout Game
  • Memorial Day – no school – Monday, May 26th
  • WorkKeys Graphic Literacy Testing for:
    • Gabi – May 13th, 12:30PM, E109 (PreTech 1)
    • Phoenix – May 14th, 10:15am, CTE Conference Room

10:10 Breakout Games Testing

It’s time to test you game with some others to gather feedback. Use this small window of time today to test your game with others in the class. You are testing paddle movement speed, ball speed, difficulty, smoothness of the ball bouncing, etc….. This is a chance to get some real feedback, then make improvements.

Testing Pairings

  • Mia, Elle, Phoenix
  • Aidan, Peyton, Ben
  • Tobi, Gabi, Braden
  • Scotty, Isaac, Zander

Open a Google Doc on your computer – docs.google.new and name it Breakout Feedback. Testers, add your comments to the document

10:50 Morning Break (10 minutes)

11:00 Lighting in Unity

Lighting is a nice way to give your level, scene, interaction some more personality. There are several light types, let’s explore a few.

FIRST: Let’s Create a New Scene together, add the Modular Character Controller and a small 3 sided room with ProBuilder Tools or regular 3D objects. In the Middle of your room, add three boxes (we’ll pretend they are crates)

The Skybox is a a lighting option for your scene. Skyboxes can be made from an HDRI or Procedural. Both options require using the Skybox shader. Let’s customize our lightbox options.

Directional Light is most like the Sun. You can change direction and rotation but it is always shining and illuminates everything in one direction only. This is a Realtime Light.

Realtime lighting is lighting that shows up during game time, interacts with other objects in the game and is dynamic. Realtime lighting is resource heavy. Good for times when you want to show the environment changing over time (like night and day cycle) and how objects interact with it.

Baked Lighting is lighting that does that is used to create mood and ambiance. The light is pre calculated before game run time – so it does not use a lot of resources. In order for light data to be captured, objects must be set to Static (or accept global illumination)

Mixed Lighting is a combination of both. Lights data can be baked, however the light can also interact with other game objects during run time, allowing for more intractability (shadows, etc…)

  • Point and Spot lights control the location, direction and rotation of lights. Let’s look at each.
  • Point Lights emits light in all directions
  • Spot Lights include a falloff value and emits light in a cone shape
  • Both of these lights can be set to Realtime, baked or Mixed. However, Unity limits how many realtime lights you can have. Checkout Windows/Light Explorer for a summary

Area Lights are defined by a rectangle or disc shape and emits light in all directions uniformly from its surface but only from one side of the mesh. Area Lights require baking to be able to view. Also, we must set objects to static if we want the light to impact them.

ProTip: When baking lighting, change to GPU and set the environment samples down for faster bake times – which is good for testing

We can also make lights out of gameObject by making them emissive. An emissive material will emit light on to other game objects if (and only if) those game objects are static. To make an emissive material work, we have to bake (render the lightmaps) to the scene. Let’s try.

Volumes are a great way to add nice effects to your scene. We can create post processing effects globally or locally. In order to render the post-processing effects, we’ll need to enable post processing on our camera. Then we’ll create some volume effects either locally or globally depending on what your scene demands. Let’s look at some features. there too.

To add Post Processing, we’ll need to head over to the package manager and install. We’ll add a Post-Processing Layer to the Camera and add a Post Processing Volume game object to our scene. The camera will see the post processing.

Assignment: Using your Modeling skillsets with Blender or ProBuilder Tools, set up a static scene in Unity and create a nice rocky path illuminated. Use materials and lighting in Unity for your scene. Don’t forget the work we did with terrain tools. Remember those? You’ll have to add from the package manager. Render as a nice .jpg. Assignment is due on Friday, May 16th.


Light Flicker Code

using UnityEngine;
using System.Collections.Generic;

// Written by Steve Streeting 2017
// License: CC0 Public Domain http://creativecommons.org/publicdomain/zero/1.0/

/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
///
/// Just activate / deactivate this component as usual to pause / resume flicker
/// </summary>
public class LightFlickerEffect : MonoBehaviour
{
    [Tooltip("External light to flicker; you can leave this null if you attach script to a light")]
    public Light light;
    [Tooltip("Minimum random light intensity")]
    public float minIntensity = 0f;
    [Tooltip("Maximum random light intensity")]
    public float maxIntensity = 1f;
    [Tooltip("How much to smooth out the randomness; lower values = sparks, higher = lantern")]
    [Range(1, 50)]
    public int smoothing = 5;

    // Continuous average calculation via FIFO queue
    // Saves us iterating every time we update, we just change by the delta
    Queue<float> smoothQueue;
    float lastSum = 0;


    /// <summary>
    /// Reset the randomness and start again. You usually don't need to call
    /// this, deactivating/reactivating is usually fine but if you want a strict
    /// restart you can do.
    /// </summary>
    public void Reset()
    {
        smoothQueue.Clear();
        lastSum = 0;
    }

    void Start()
    {
        smoothQueue = new Queue<float>(smoothing);
        // External or internal light?
        if (light == null)
        {
            light = GetComponent<Light>();
        }
    }

    void Update()
    {
        if (light == null)
            return;

        // pop off an item if too big
        while (smoothQueue.Count >= smoothing)
        {
            lastSum -= smoothQueue.Dequeue();
        }

        // Generate random new item, calculate new average
        float newVal = Random.Range(minIntensity, maxIntensity);
        smoothQueue.Enqueue(newVal);
        lastSum += newVal;

        // Calculate new smoothed average
        light.intensity = lastSum / (float)smoothQueue.Count;
    }

}

12:25 Lunch

12:55 Independent Reading

book covers

1:20 Afternoon Break (10 minutes)

1:30 Speed Design

Google 20% graphic

1:50 Independent Production & Guided Support

2:38 Dailies

2:40 Dismissal

GAWD Instructors:

Matt Cronin

Will Bohmann

Instragram Facebook Twitter

A little about GAWD:

Serving high school students interested in Gaming, Animation, and Web Development in North Western Vermont.

Students continue at:

University of Vermont Ringling School of Art and Design Northeastern University Rochester Institute of Technology Concordia University

Students find careers at:

Dealer.com Union Street Media Rovers North Prudential Investments DockYard
Navigate to top of page