Skip to content

Instantly share code, notes, and snippets.

@amirrajan
Last active August 1, 2026 20:33
Show Gist options
  • Select an option

  • Save amirrajan/26e9b833ce7faeb8111a18f00eda8e78 to your computer and use it in GitHub Desktop.

Select an option

Save amirrajan/26e9b833ce7faeb8111a18f00eda8e78 to your computer and use it in GitHub Desktop.
DragonRuby Game Toolkit - Uniforms Definition
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;
};
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