Dear ImGui - Interactive settings for ocean water


The last crucial piece of the project implementation relates to GUI. It is tedious having to restart the application for testing different settings, and I wanted to be able to change the settings of the ocean in real time.

Using a GUI I wanted the following settings to be modifiable in real time.

For ocean:

  • Wave length
  • Amplitude
  • Wind speed
  • Wind direction
  • Normal displacement amount 
  • Vertex count
  • Tile count
For application:
  • Camera movement speed
  • Camera rotation speed
  • Enable/disable wireframe mode
  • Enable/disable skybox
  • Enable/disable skybox lighting
  • Selecting skybox cubemap

A very convenient and handy tool for debugging graphics applications is Dear ImGui, or simply ImGui. Integrating ImGui is simple and it has an implementation agnostic interface for whichever window environment and graphics library you are using.

When the ImGui library is linked properly to the application, dialogs and GUI utils are easily drawn to the screen by initializing an ImGui context. When a context is running, each frame you Begin drawing your dialogs, such as sliders, checkboxes and comboboxes, and end the drawing at the End.

Example:

ImGui::Begin(...)
...
ImGui::SliderInt(...);
...
ImGui::End();

The final version of the application would look something like the following GIF.



GIF illustrating ImGui panel for changing settings in real time.

Kommentarer

Populära inlägg i den här bloggen

CUDA cuFFT vs FFTW

Gradients and Choppy waves.