SGI demos from long ago, running in your browser today.
Old problems require modern solutions.
This is the original SGI demo source code, compiled for the web using Emscripten and SDL2. Rendering is done using an IRIS GL software rasterizer from the Alice 4 project. Event handling is done by SDL2, with events translated into GL’s event system. Each demo is a separate web page, with its own Javascript + WASM compiled by Emscripten from the original C/C++ source. Native Linux, Mac, and Windows builds are also available. Minimal modifications have been made to the original source, in order to run in the browser and to build with compilers 30+ years later. For more implementation details, see the architecture doc.
Working demos
Somewhat working demos
- Bounce (model selection not working on web)
- Flight (cockpit glitches, planes too slow in web version, night mode ‘shimmers’, no network play)
- Newave (no mesh editing, no popup menus, only wireframe)
- Arena (no network play)
Firmly WIP demos
Build instructions
Mac
- Install Homebrew if you don’t have it, then get SDL2 and Emscripten:
brew install SDL2
brew install emscripten
- Build:
git clone https://github.com/sgi-demos/sgi-demos.git
cd sgi-demos
make
Windows
-
Install Winget if you don’t have it.
- Install MSYS2 from cmd.exe, in order to get the clang compiler:
winget install MSYS2.MSYS2
setx PATH "%PATH%C:\msys64\clang64\bin"
- Install clang toolchain and SDL2 in MSYS2 CLANG64 shell:
pacman -Syu
pacman -S base-devel mingw-w64-clang-x86_64-toolchain
pacman -S mingw-w64-clang-x86_64-SDL2
-
Clone emscripten from Github. Cloning seems to work best with MSYS2 rather than using pacman. Follow the default install directions, not the Windows directions!
- Add this line to the
~/.bashrc file in MSYS2 CLANG64 shell:
source /path/to/emsdk/emsdk_env.sh
- Build:
git clone https://github.com/sgi-demos/sgi-demos.git
cd sgi-demos
make
To do
- Fix logged issues
- Enable popup menus, including the classic SGI menu font
- Upgrade rendering to OpenGLES/WebGL (WIP)
- Enable arbitrary window size
- Provide Rudimentary context for each demo: name, author, year (as text in lower corner), code link
- Add popup/overlay help to show key/mouse input to try
- Add more demos, all the demos.
- Electropaint, Cedit, any other IRIS GL demos I can find
- Then OpenGL, GLUT, Inventor, Performer demos in no particular order
- Provide virtual mouse and keyboard for touch devices:
- Only display virtual keys and mouse functions used by the demo; use demo’s qdevice() calls to determine this
- Displayed as transparent virtual mouse and key pictures overlaid on demo
- On always for touch devices
- On/off for mouse/keyboard devices, as hints
- Add brief description/history/context for each demo - can obtain some descriptions from .Info slide files
- Add links to man pages
Credits