blinn_and_gamma - JayDee-github/LearnOpenGL GitHub Wiki

Blinn lighting and gamma correction

This implementation applies blinn-lighting and gamma-correction techniques.

The user can switch between Blinn and Phong lighting simulations to compare differences. They can also toggle gamma-correction.

Blinn lighting:

Blinn

Phong lighting:

Phong

No gamma-correction:

No gamma

With gamma-correction:

Gamma

The code follows examples outlined in:

Changes over example code

  • Ability to toggle between lighting and gamma-correction modes.
  • Adjusted various lighting parameters to show the differences between modes.

Running the implementation

  • Navigate the Solution Explorer to path:

    Solution -> 05.advanced_lighting -> 01-02.blinn_lighting_and_gamma_correction

  • 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.

Rendering manipulations

The numeric keys 1 and 2 are used to switch rendering modes:

  • 1 Toggle between Blinn and Phong lighting (Blinn is default)

  • 2 Toggle gamma-correction (on by default)