Skip to content
Snippets Groups Projects
README.md 58.89 KiB

FocusTerra Realtime Wave Simulator

This repository contains all files that make up the realtime wave simulator exhibit at FocusTerra.

While the project was originally developed on macOS, it was later ported to Windows (Visual Studio 2019).

Dependencies are OpenGL, ImGui and SDL, and all of them are contained in this repository.

Table of Contents

Project Organization

The repo is organized in the following folders:

  • src (and subfolders) contains all .cpp
  • include (and subfolders) contains all headers
  • shaders contains all GLSL shaders
  • lib contains libraries
  • FocusTerra contains the Visual Studio project file
  • FocusTerra\x64\Release and FocusTerra\x64\Debug contain the executables
  • build is left over from the macOS days (contains a currently broken Makefile)

Resources

Resources are organized in a single folder called ft_top. It contains the following:

  • A folder bin that contains the executable and SDL2.dll
  • A folder fonts that contains the font used by the GUI, namely Cousine-Regular.ttf
  • A folder resource that contains
    • The colour palette in ft_palette.conf, ft_palette.texture
    • The Image Button images in the folder images
    • A folder textures that contains the predefined structure textures. There are two versions, one for the FocusTerra resolution (in rocket), and one for Pascal's resolution (in home).
  • A folder shaders that contains the used GLSL shaders.

The program accesses these resources at runtime.

File Formats

This section describes the file formats external files are expected to follow.

GUI Images

Gui Images, such as the button textures, are loaded using stbi. The exact calls can be found in GuiHandler::load_image_to_texture_. The important parts are

data = stbi_load(file.c_str(), &width, &height, &nrChannels, STBI_rgb_alpha);
//...
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);

Images are expected to be RGBA, i.e. to have an alpha channel. Not being very fluent in image formats, I believe this is the only limitation. To be save, I'll state that images are expected to be loadable with the above calls.

Damping Textures