im trying to compile this shadertoy shader,
the problem is that i can’t figure out how the buffer channels in shadertoy can be recomiled to something that would work in a glsl top…
ive recompiled some shaders succesfully, and i use the shadertoybrowser tox for most of the recompiling… but i could use a litle help with this multiple buffer thing…
should i have a glsl top for every buffer?
or should al the code from the diferent buffers be in one glsl top? and if this is the case… how ?
Does anyone have a working example using any multi buffer shader? I want to do something similar with some other shadertoy shaders, only I’m stumped how to link the TOPs together?
// do stuff
fragColor1 = color1;
fragColor2 = color2;
}
[/code]
Then use two Render Selects after the GLSL Top. Drag each render select onto the “Target TOP” of the feedback tops, and wire the feedback tops into the GLSL. You’ll also need to wire a different “reset” top for the feedback tops.
Thanks David. I’ve built the network you described and got the main GLSL buffer to compile after fixing a few syntax errors . I still don’t get where the code for the second and third buffers goes though. I’m guessing I need additional GLSL TOPs somewhere? I don’t think I can just merge the code into one as they all have a mainimage() function.
Sorry if these sound like dumb questions. I’m a relative noob at TD, and zero previous experience with GLSL. Simple, practically useful documentation not so easy to find on this.
layout (location = 0) out vec4 fragColor1;
layout (location = 1) out vec4 fragColor2;
Declare your output variables, and where they go. fragColo1 will go to the first buffer (first location) while fragColor2 will go to the 2nd buffer (location = 1). When you write to these variables, that is what controls what goes to those buffers.
No you don’t need a 2nd GLSL TOP for this.
In the OP’s original example there are several buffers each implementing a mainImage function. If I have a single GLSL top that I put all the code into I will have to rename these, won’t I? So how/from where will they be called?
If anyone has a basic example of this they could post, I’d be very grateful.
im gonna give it a try to get this baby working today!!
i was thinking, would it be an idea to have a subdirectory in the tox. section for glsl filters?
i think it would be nice for beginners to have a wide range of filters and generators to get started learning TD. (when i started in TD i had to do crazy shit for a simple kaleideoscope wich ran on just 12 fps
Same problem here implement buffer A and B to the touch designer glsl convert tool.
I understand close to nothing of your explainations I’m afraid. (I need drawings or something)
very confusing this converter since you only have one shader instead of pixel and vertex, where do you connect these A&B buffers once you have announced them (where? in main code), no inputs appear when I do, then it all ends up in a glsl top instead of a normal glsl so cannot connect txt to that.
A mini example showing these buffers connected would really help. thx
Or a sort of GLSL snipet like someone suggested in facebook forum could really help making entire Touch designer learning experience a pleasure. Because this part of gathering info about glsl form various sources and versions, for people like me with no coding background. Kills it! (to the risk of sounding like an idiot,I’m just offering an honest opinion,I try brainwash with all glsl tutorials I can find at the moment and still unclear).
It is still not clear for me, and I am probably not the only one.
So multiple buffers GLSL only need one GLSL TOP?
My first idea would be to have as many GLSL top as the buffers.
How is it working for example for this shader shadertoy.com/view/4dcGW2?
Yes, you just need 1 GLSL TOP, and set the parameter to increase the number of buffers. You use a Render Select TOP to pull the result out for buffers above the first one. But all the code to write to all the buffers all goes inside one GLSL TOP.
So in your example you use multiple GLSL.
I seen that you use feedback even when a glsl is not connected to himself. isnt it possible to connect directly different glsl without feedback?
I seen that you change the line vec2 uc = …
I was missing that. what is vUV.st?