Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions comfy/examples/fragment-shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@ fn update(state: &mut GameState, c: &mut EngineContext) {
});

// When we switch a shader the uniforms will get their default value
// TODO: why does this need to be called twice?
use_shader(shader_id);
use_shader(shader_id);

let time = get_time() as f32;

// We can only set one and then draw and the other uniform will be set
// to the default value we specified when creating the shader.
set_uniform_f32("time", time);

// We can only set one and then draw and the other uniform will be set
// to the default value we specified when creating the shader.
draw_comfy(vec2(0.0, 0.0), WHITE, 0, splat(1.0));

// This will set "intensity" while retaining "time" from the previous set in this frame, as
Expand Down