Unity Lighting

From BallisticNG Wiki
Jump to: navigation, search

This article is a stub. You can help BallisticNG Wiki by expanding it.

  • Unity lights are outside the scope of BallisticNG documentation (apart from "light sponges"), so they will only be briefly covered here for completeness.
  • Whilst light values are calculated & saved using the custom "Vertex Lightmapper" tool, adding light objects is done the traditional Unity way.
  • There is no difference between soft and hard shadows when baking lighting, you will get the same result.
  • If you are reading this because you have a black skydome or black scenery, see Track Wizard

Adding light objects[edit | edit source]

"GameObject > Light"

Point Light menu item
  • Directional Light: a sun
  • Point Light: a light bulb
  • Spotlight: a lamp
  • Area light: light emitted from a rectangular shape

Environment lighting[edit | edit source]

Open this window via "Window > Lighting > Settings"

Environment Lighting window
  • Source: ensure this is set to "Color"
  • Ambient Color: if this is set to 100% white, it will be difficult to see light changes in Unity. You can set it to a darker colour for testing purposes.
  • Ambient Mode: ensure this is set to "Baked"

Light Sponges[edit | edit source]

BallisticNG features a tool which lets you remove ambient and directional light. This can be used to darken areas such as tunnels and is called the light sponge.

This is basically a point in the world, that absorbs light around it.

BallisticNG shader Firstly, you'll have to tell the track material to use a BallisticNG shader, so that it uses the light values calculated by the Vertex Lightmapper:
  1. Double-click the track floor
  2. Use the shader drop-down to select "VertexLit (Double Sided)"
  3. Repeat steps 1 and 2 for the track wall
Light Sponge menu item An "Empty GameObject" is basically an invisible point on the map, that does nothing (yet).
Light Sponge component Select the new GameObject, and click "Add Component" to add the "Light Sponge".
Light Sponge options Everything within the white sphere guidelines will be darkened.
  • Radius: radius of the sponge
  • Intensity: how much light to absorb. 0 means none, 1 means all.

Make sure run the Vertex Lightmapper again, to apply the effect of a new light sponge.