environmental_lighting - JayDee-github/LearnOpenGL GitHub Wiki

Lightmaps and lighting techniques

This implementation applies Lightmaps, directional-lighting, point-lighting and spot-lighting techniques.

Lighting techniques are used to create four environmental lighting schemes:

  1. Balanced mode: simulates a balanced lighting environment.

    Balanced mode

  2. Night mode: simulates a night-time environment.

    Night mode

  3. Radioactive mode: simulates a toxic/radioactive environment.

    Radioactive mode

  4. Volcano mode: simulates a volcanic environment.

    Volcanic mode

The code follows examples outlined outlined in:

Changes over example code

  • Tweaked lighting parameters to create the night, radioactive and volcano modes.
  • Added the ability to switch between modes with the numeric keys 1-4.

Running the implementation

  • Navigate the Solution Explorer to path:

    Solution -> 02.lighting -> 04-06.lightmaps_and_environmental_lighting

  • Left-click the project name and select Set as Startup Project from the pop-up window.

  • Press F5 to run the project.

Interfacing with the implementation

Exiting

Press the ESC key to exit the implementation.

Movement

The movement key-bindings follow an FPS-style scheme:

  • W move forward
  • S move back
  • A move left
  • D move right
  • Spacebar move up
  • Left-Shift move down
  • Mouse-movement look around the world.

The numeric keys 1-4 are used to switch lighting modes:

  • 1 Balanced mode
  • 2 Night mode
  • 3 Radioactive mode
  • 4 Volcano mode