Skip to content

wedesoft/sfsim

Repository files navigation

This is a work in progress. Aim is to simulate take off, space station docking, and moon landing with a futuristic space plane. Requires OpenGL 4.5 (glClipControl for reversed-z rendering) See sfsim homepage for more details.

Aerodynamic prototype

Installation

Get Code for GNU/Linux

git clone https://github.com/wedesoft/sfsim.git
cd sfsim
git checkout main

Get Code for Windows

git clone https://github.com/wedesoft/sfsim.git
cd sfsim
git checkout windows

Install JoltPhysics

Get JoltPhysics 5.5.0 and build it as follows. Note you might have to install glslc if you already have Vulkan installed.

GCC/Linux

cd Build
./cmake_linux_clang_gcc.sh Release g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DDOUBLE_PRECISION=ON -DDEBUG_RENDERER_IN_DEBUG_AND_RELEASE=OFF -DPROFILER_IN_DEBUG_AND_RELEASE=OFF -DUSE_AVX2=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF
cd Linux_Release
make -j `nproc`
sudo make install
cd ../..

MinGW/Windows

cd Build
./cmake_windows_mingw.sh Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DDOUBLE_PRECISION=ON -DDEBUG_RENDERER_IN_DEBUG_AND_RELEASE=OFF -DPROFILER_IN_DEBUG_AND_RELEASE=OFF -DINTERPROCEDURAL_OPTIMIZATION=OFF -DUSE_AVX2=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF
cmake --build MinGW_Release -j `nproc`
cmake --install MinGW_Release --prefix /usr/local
cd ..

Build

  • Build Jolt wrapper library: make jolt
  • Build Worley noise: clj -T:build worley
  • Build Perlin noise: clj -T:build perlin
  • Build blue noise: clj -T:build bluenoise
  • Build cloud cover: clj -T:build cloud-cover
  • Download space ship model: clj -T:build download-spaceship
  • Download NASA Bluemarble data: clj -T:build download-bluemarble
  • Download NASA Blackmarble data: clj -T:build download-Blackmarble
  • Download NOAA elevation data: clj -T:build download-elevation
  • Download NASA JPL ephemeris data: clj -T:build download-ephemeris
  • Extract elevation data: clj -T:build extract-elevation
  • Convert day map sectors into pyramid of tiles: clj -T:build map-sectors-day
  • Convert night map sectors into pyramid of tiles: clj -T:build map-sectors-night
  • Convert elevation sectors into pyramid of tiles: clj -T:build elevation-sectors
  • Convert tile pyramids into pyramid of cube maps: clj -T:build cube-maps
  • Download Moon color images: clj -T:build download-lunar-color
  • Download Moon elevation: clj -T:build download-lunar-elevation
  • Build atmosphere lookup tables: clj -T:build atmosphere-lut
  • Perform all build steps above: clj -T:build all
  • Enable integration tests (requiring results of above build steps): touch .integration

Further Build Steps under Windows

  • Update version number in src/clj/sfsim/version.clj
  • Build JAR file: clj -T:build uber
  • Create Windows executable: java -jar packr-all-4.0.0.jar scripts/packr-config-windows.json (delete out-windows folder first)
  • Upload to Steam: sdk\tools\ContentBuilder\builder\steamcmd.exe +login <account_name> <password> +run_app_build C:\Users\....\sfsim\scripts\sfsim_playtest_windows.vdf +quit

Further Build Steps under GNU/Linux

  • Update version number in src/clj/sfsim/version.clj
  • Build JAR file: clj -T:build uber
  • Create Linux executable: java -jar packr-all-4.0.0.jar scripts/packr-config-linux.json (delete out-linux folder first)
  • Upload to Steam: sdk/tools/ContentBuilder/builder_linux/steamcmd.sh +login <account_name> <password> +run_app_build /home/..../sfsim/scripts/sfsim_playtest_linux.vdf +quit

Lint

Run

  • Run tests (recommended to use xvfb-run): xvfb-run clj -M:test
  • Run test for specific module (rendering for example): xvfb-run clj -M:test sfsim.t-render
  • Run the global cloud cover prototype: clj -M etc/cover.clj
  • Run main program: clj -M:run

Converting Blender file to GLB

If you want to modify the spacecraft model, you need to edit the Blender model and convert it to GLB again. The Blender model can be converted to GLB as follows:

  • apply all modifiers in Blender (first to last)
  • delete lights and camera
  • delete reference images
  • delete invisible objects used for object differences
  • export to GLB with baking animations enabled (animation mode "NLA track"!)
  • exit Blender without overwriting model

External Links