0
$\begingroup$

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.

$\endgroup$

2 Answers 2

2
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ I'd never noticed that before. Nice! $\endgroup$ Oct 21 at 22:15
-2
$\begingroup$

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);

    ...
}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.