Shadertoy to sparksl

hello I just tried to convert shaders from shadertoy to sparksl but there is some code I don’t understand

vec3 color = texture (iChannel0, middle / iResolution.xy) .rgb;

can anyone explain about iChannel0? and how to apply it in spark ar?

Thank you.

I’m not super familiar with shadertoy, but I have some experience with it. From what I understand, iChannel0 is a texture that is being sampled. In Spark SL, you would sample textures by using the method on the texture itself.

yourTexture.sample(uv);

To sample the middle of a texture, you would do yourTexture.sample(vec2(.5, .5));

1 Like