Skip to content

A 3D rendering application for a scene consisting of multiple models, using OpenGL and ImGui

License

Notifications You must be signed in to change notification settings

feedop/OpenGL-Demo

Repository files navigation

OpenGL Demo

Author: Filip Skrzeczkowski

An OpenGL Demo program featuring a Star Wars inspired scene.

How to build?

The package contains a Visual Studio 2022 .sln file. Use it to build and launch the project. When starting, please make sure that the directory containing the solution file and all the resources is the working directory.

How to use?

Upon launching the application two windows should appear. An OpenGl window containing the scene and an ImGui window for configuration. In order to move around the scene use WASD and arrow keys.

Important note: The controls work only if the OpenGL window is focused.

Controls:

  • W, S - turn up/down (adjust the pitch angle), please note that W corresponds to "dive down" and S to "pull up"
  • A, D - turn left/right (adjust the yaw angle)
  • left and right arrow keys - roll left/right (adjust the roll angle)
  • up and down arrow keys - increase or decrease velocity respectively

Configuration

Use the second ImGui window to:

  • change the shading method,
  • choose one of the three cameras (third-person camera can be inverted too),
  • switch to night time (the main directional light gets weaker over a few seconds),
  • select the fog density and its color,
  • enable turbulence (periodic rolling left/right of the player model),
  • adjust the relative direction of front-facing spotlights attached to the player model

Technical aspects

The application is written in C++ 20. It uses OpenGL for graphics and ImGui for UI as well as Assimp for model loading. Three shading methods are implemented:

  • Texture only (no light)
  • Gouraud shading
  • Phong shading (includes deferred shading)

The scene contains a main directional light, several static point lights (big ships' engines) and spotlights attached to moving objects (both front and back).

Video example

StarWarsBattlefront3_compressed_even_further.mp4

Credits

Based on https://learnopengl.com/

Models downloaded from:

About

A 3D rendering application for a scene consisting of multiple models, using OpenGL and ImGui

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages