stencil_and_blending - JayDee-github/LearnOpenGL GitHub Wiki

Stencil testing and blending

This implementation applies stencil, depth and blending techniques.

Stencil testing is used to create teal outlining on box models.

Stencil

Blending and depth testing techniques are used to render transparent windows.

Blending

The code follows examples outlined in:

Changes over example code

  • The stencil testing and transparency code were combined to form an implementation that applied both concepts. The main drawing loop, data-structures and OpenGL function calls needed to be adjusted to ensure the stencil application didn�t interfere with the transparency application.

Running the implementation

  • Navigate the Solution Explorer to path:

    Solution -> 04.advanced_opengl -> 01-03.stencil_and_blending

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