0

I'd like to have a helper function in the Common tab that does something fancy with texture input and returns the result. I'd like the function in question to be able to use any iChannel, like:

vec3 do_something_fancy( in channelType channel, in vec2 uv, yodeling monkey_nuggets) {
    vec4 lookup_result = texture(channel, uv);
...

}

I've taken a few guesses as to the type of iChannel[0-4] but have struck out.

2 Answers2

2

You can click 'Shader inputs' above the panel containing the code to obtain a dropdown with all the types:

enter image description here

As can be seen here the type is either sampler2D or samplerCube.

Reynolds
  • 1,238
  • 6
  • 13
-2

Google was useless for answering this one, but I was surprised that Bard got it on the first go:

vec3 do_something_fancy( in sample2D channel, in vec2 uv, yodeling monkey_nuggets) {
    vec4 lookup_result = texture(channel, uv);
...

}