Last active
August 1, 2026 20:33
-
-
Save amirrajan/26e9b833ce7faeb8111a18f00eda8e78 to your computer and use it in GitHub Desktop.
DragonRuby Game Toolkit - Uniforms Definition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Texture2D scene : register(t0, space2); | |
| SamplerState sampler0 : register(s0, space2); | |
| // Scalar uniforms passed from Ruby via `uniforms: [{ name:, value:, type: }, ...]`. | |
| // Members must match the array order. Fragment uniform buffers live in space3 | |
| // (b registers) for SDL_shadercross HLSL. | |
| cbuffer Uniforms : register(b0, space3) { | |
| int tick_count; | |
| float time; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def tick args | |
| args.outputs.shader = { | |
| path: "shaders/effect.frag.hlsl", | |
| uniforms: { | |
| tick_count: { value: Kernel.tick_count, type: :int }, | |
| time: { value: Kernel.tick_count.fdiv(60), type: :float }, | |
| } | |
| } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment