Use of undeclared identifier 'sTD2DInputs'

Hey there!

I’ve stumbled upon something strange - when I put GLSL Top somewhere and uncomment the line that says

, I get the error in Info DAT:
Use of undeclared identifier ‘sTD2DInputs’

Even though in Operator Snippets the same code clearly works. More than that, if I copy GLSL Top from Operator Snippets to my newly created patch, it shows the same error in Info DAT.

I’m on TD 099 final on Mac OS X.

Are you also commenting out the line below?

From:

void main() { // vec4 color = texture(sTD2DInputs[0], vUV.st); vec4 color = vec4(1.0); fragColor = color; }

To:

void main() { vec4 color = texture(sTD2DInputs[0], vUV.st); //vec4 color = vec4(1.0); fragColor = color; }

For this to work correctly you’ll also need to connect a top to an input on the GLSL TOP - as sTD2DInputs is referring to the inputs on the TOP. Without a connecting op, you’ll see an error as there isn’t a texture to sample from.

1 Like

Here’s a quick tox so you can do a sanity check.

Same for both GLSL TOPs - only difference is that the second has another top as an input.
base_glsl_inputs.tox (910 Bytes)

1 Like

Thanks, that worked!

Woohoo!

Glad that got you sorted.