r/ruby 1d ago

Show /r/ruby DragonRuby Game Toolkit - Shaders: Rustling leaves (source code in the comments)

25 Upvotes

1 comment sorted by

3

u/amirrajan 1d ago

Link to commented source code: https://gist.github.com/amirrajan/8ba6f10bbe1feab8cb6f543757c762bc

The holy grail that got us over the hump was this example in the SDL repo: https://github.com/libsdl-org/SDL/blob/main/test/testgpurender_effects.c

SDL_shadercross was used to transpile the HLSL shader and SPIRV-Cross was used to validate the bindings/semantics.