Lighting in Unity - Emissive light

 https://www.youtube.com/watch?v=VnG2gOKV9dw&feature=emb_logo


  • Create a cube in Maya. Scale. Select. Mesh Display. Click reverse. Click in viewport. Model becomes black. Display>Polygons>Backface culling
  • https://www.youtube.com/watch?v=nX_iasG6smg&feature=emb_logo
  • Maya>create cube>File>Send to Unity
  • Position and scale - use hatch with magnet snap symbol, in toolbar under scene, to position and snap to the grid
  • Import stock asset - in this case a mug

to be continued....

  • Position the camera so it looks into the scene
  • Remove the default directional light, as this is to be an indoor scene
  • We can either create lights, or we can create an object with an emissive material
  • Right click and create plane
  • Turn off light (lightbulb underneath scene tab) so we can see what we're doing
  • Set scale of plane to X 0.2 Y 1 Z 0.2
  • Right click on the word Transform (blue) in the inspector>reset position
  • Rotate -90 on the Z axis
  • Position slightly away from the cube wall
  • Create new material - rename 'orange light'
  • Drag material onto plane. Select material>inspector>emission>enable>click HDR eyedropper to select colour. Set emission (in colour wheel window - for Unity 2019.4.8f1) set to 1.5
  • Nothing really happens. Even if we turn on the lighting (lightbulb icon) then nothing particularly happens.
  • To do this we need to bake a light map
  • Objects need to be static
  • Select cube, mug and plane - inspector>enable static (top right corner)
  • Nothing happened. I'd not got Auto-Generate lighting on. I clicked on the Auto Generate Lighting at the bottom of the screen and the lighting menu popped up. Enabled autogenerate and the light map was baked. Image below

  • Rename plane 'orange light' and duplicate
  • remove the negative '-' in the X position to flip it across to the opposite wall
  • Change Y rotation to 180
  • Duplicate material and rename blue light


  • It still doesn't look too good. That's because imported models may not have LightMap UVs. To do this, select the model in the project window to view the model/rig/animation/materials tabs. Enable Generate Lightmap UVs for the cube and the mug. This means Unity will automatically calculate the lightmap UVs
  • If seams are still visible select object>inspector>Lightmapping>Stich Seams
  • The mug still had seams showing and a warning came up about overlapping UVs. If I haven't created models with Light map UVs there may be a problem with overlap and dark lines showing (known as artifacts). This essentially means that the charts are overlapping on the map. To correct this the pack margin can be increased. Follow this link to rectify https://docs.unity3d.com/Manual/ProgressiveLightmapper-UVOverlap.html
  • Select scene tab>UV overlap - problem areas will be highlighted in red
Image below showing the UV light map, pack margins set at 3.
  • Pack margin increased to 15 removed the red overlap

  • Next go to window>lighting>enivironment>skyboxmaterial - set to none
  • To add a glow import post-processing via the package manager and use bloom.
  • Image below including post-processing stack and assorted effects




















Comments

Popular posts from this blog

Dr Hannah Thompson, Royal Holloway University

Thematic Analysis_ Phase 3 - searching for themes - David Interview - iteration 1 - Coding Memo_051