Skip to content

Commit

Permalink
use standard fragment_output pipeline and add objectid
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Dec 15, 2024
1 parent 27bf01f commit e5dee75
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions GLMakie/assets/shader/shadertoy.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit e5dee75

Please sign in to comment.