Skip to content

Nvim/SDL_gpu_demos

Repository files navigation

SDL3 GPU is pretty good

Apps

The repository contains two (WIP) apps for now:

  • pbr: GLTF model viewer, with supports for most features from the GLTF PBR spec
  • grass: A dense, real-time grassblade field simulation aiming to offload as much as possible to the GPU (terrain and grassblade generation, frustum culling and draw-call generation are all GPU-driven thanks to compute shaders)

Common features

  • Minimal framework and collection of utilities to reduce boilerplate
  • Support for HDR textures and cubemaps
  • Support for KTX file format
  • Image based lighting
  • Multiple HDR post-processing shaders
  • Generation of missing tangents and bitangents at runtime

build

Program

The project uses CMake Presets for easy configuration:

mkdir build
cmake --preset rel-ninja # or `debug-ninja`/`debug-asan`
cmake --build --preset release # or `debug`/`asan`

You can then run it:

build/rel-ninja/sdl_demos [APP_NAME]

Valid app names are pbr and grass.

The following libraries are expected to be installed system-wide:

  • SDL3 (you can choose to build by defining the BUILD_SDL CMake option)
  • glm
  • simdjson (it's supposed to be fetched & built as a dependency of fastgltf, but it doesn't work for me)

These are built along with the project (make sure to clone submodules):

Shaders

Use the shaders.sh script to build the shaders related to the app you want to run:

# TODO: add this as a CMake target someday
./shaders.sh grass
./shaders.sh pbr

About

Collections of small 3D applications using the new SDL3 GPU API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors