From e5dee7539263d94d494dd372689ec96946f4e0d8 Mon Sep 17 00:00:00 2001 From: ffreyer Date: Sun, 15 Dec 2024 14:37:41 +0100 Subject: [PATCH] use standard fragment_output pipeline and add objectid --- GLMakie/assets/shader/shadertoy.frag | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GLMakie/assets/shader/shadertoy.frag b/GLMakie/assets/shader/shadertoy.frag index a7afe50a676..b7d4cd16a5a 100644 --- a/GLMakie/assets/shader/shadertoy.frag +++ b/GLMakie/assets/shader/shadertoy.frag @@ -4,12 +4,13 @@ {{TOY_SHADER}} in vec2 f_uv; -layout (location = 0) out vec4 fragment_color; -layout (location = 1) out uvec2 fragment_groupid; + +uniform uint objectid; + +void write2framebuffer(vec4 color, uvec2 id); void main() { - vec4 color = mainImage(f_uv * iResolution.xy); - if (color.a <= 0.0) discard; - fragment_color = color * 0.5; + vec4 color = mainImage(f_uv * iResolution.xy); + write2framebuffer(color, uvec2(objectid, 0)); }