Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

GLSL Buffer A again please

Still a little green? Ask your beginner's questions here

GLSL Buffer A again please

Postby greenpattern » Wed Jan 10, 2018 3:07 pm

Hi, me again.
I'm back on track of taming GLSL.

I think the instructions found in this page are not complete or incorrect. At least the part on buffers. (it should work out of box so people can understand)

https://nvoid.gitbooks.io/introduction- ... ertoy.html
last section about buffers

I tried couple of times following instruction on convert shaders with buffers and it never works despite applying everything mentioned on this tutorial. Or I might have forgotten something.
in any case please help me out!

I have tried comparing with that ''purple diffusion shader'' kindly converter by David (the only working shader with buffer available) But all is quite messy to understand, I'm now lost.
Attachments
example not woking.2.toe
(5.56 KiB) Downloaded 20 times
User avatar
greenpattern
 
Posts: 174
Joined: Tue Dec 01, 2015 3:05 pm
Location: Edinburgh Scotland, but I'm french

Re: GLSL Buffer A again please

Postby elburz » Thu Jan 11, 2018 4:38 am

If you look at the errors in the Info DAT they can help sort out the issue.

The first thing is to delete line 14. In TouchDesigner the sTD2DInputs is already declared behind scenes, so you dont need that line at all, it causes a conflict.

Once you delete that, it says the next error is on live 107, which says index out of bounds. The only thing in that line with an index is sTD2DInputs[1]. Which would mean it's trying to grab the 2nd plugged in texture, but there's only 1 texture plugged in. If you plug in anything into the GLSL TOP's input (so that there's 2) the error goes away.

Can you send a link to the original shadertoy(or other site) you're working from? Curious to look at the original. Also any recommendations you have to make the section of the book easier, by all means let us know.
--
Elburz Sorkhabi
Creative + Technology
nVoid Art-Tech Limited
http://nvoid.com
elburz
 
Posts: 1970
Joined: Fri Jun 01, 2012 6:55 pm
Location: Toronto, Canada

Re: GLSL Buffer A again please

Postby greenpattern » Fri Jan 12, 2018 11:57 am

Thx Elburz, I know I'm slow student.
once I 'll manage that one I can analyse and manage much more.
I'll try your corrections today.

https://www.shadertoy.com/view/4tV3Wd

its the shader form example last one about buffers. I have tried the whole process few times and was loosing the plot here.

https://nvoid.gitbooks.io/introduction- ... ertoy.html

is the most precious info about shaders in TD for sure, everything worked fine except last one.
THX a lot
User avatar
greenpattern
 
Posts: 174
Joined: Tue Dec 01, 2015 3:05 pm
Location: Edinburgh Scotland, but I'm french

Re: GLSL Buffer A again please

Postby elburz » Sat Jan 13, 2018 3:17 am

No problem, let me know if you're able to get it working with my last post. If you figure out some things we can add, let us know.

I think the issue with what you were trying now that I look at the shadertoy is that you tried to copy and paste the whole "shader input" section into the top of your GLSL shader. Is that correct? That would be explain the declaration of a the sampler2D at the top which wasn't necessary. I find it faster and much more convenient to only declare the uniforms you need for that shader, and when you're doing so you wouldn't include the sampler2D since it's already declared by TouchDesigner.
--
Elburz Sorkhabi
Creative + Technology
nVoid Art-Tech Limited
http://nvoid.com
elburz
 
Posts: 1970
Joined: Fri Jun 01, 2012 6:55 pm
Location: Toronto, Canada

Re: GLSL Buffer A again please

Postby greenpattern » Sun Jan 14, 2018 1:52 pm

Hello, So I tried your corrections here, but there must be something i'm missing.
I might have copied the whole shader input as you said, can remember exactly.
I think I followed instruction to the letter. But maybe I mixed up.
Text port works good, I have already started as list of things that can go wrong in a conversion.
success rate is going up. But that one! I'll print the pages to attach to my wall once converted properly.
Attachments
example not woking3.toe
(5.56 KiB) Downloaded 20 times
User avatar
greenpattern
 
Posts: 174
Joined: Tue Dec 01, 2015 3:05 pm
Location: Edinburgh Scotland, but I'm french

Re: GLSL Buffer A again please

Postby elburz » Mon Jan 15, 2018 3:35 am

In the Buf_A shader you forgot to add all the necessary uniforms to the Vectors page of the GLSL TOP. So in the shader you've declared all the things like iResolution, iGlobalTime, etc etc. But in the GLSL TOP you only actually gave a value to iResolution, iGlobalTime, and iMouse. Once I added iFrame, it started doing stuff, I'd recommend adding all the rest if you need them in the code. I didn't look at the Image shader but I'd bet it's a similar issue because you don't have anything on the Vectors page and I see 2 uniforms declared in the code.

Annoying if as long as your code is ok (uniform defined correctly in the shader) you won't get an error if you dont correctly define them in the GLSL TOPs Vectors page, you just have a not working shader.
--
Elburz Sorkhabi
Creative + Technology
nVoid Art-Tech Limited
http://nvoid.com
elburz
 
Posts: 1970
Joined: Fri Jun 01, 2012 6:55 pm
Location: Toronto, Canada

Re: GLSL Buffer A again please

Postby greenpattern » Tue Jan 16, 2018 12:59 pm

great thx for that fine explanation,thx for your time.
I'll analyze all that and try to apply to next one.
Probably got mixed up with that converter that puts pixel and shader in one.
User avatar
greenpattern
 
Posts: 174
Joined: Tue Dec 01, 2015 3:05 pm
Location: Edinburgh Scotland, but I'm french

Re: GLSL Buffer A again please

Postby greenpattern » Tue Jan 16, 2018 4:20 pm

working fanastic! thx

I found a channel on youtube that could serve many people interested by shaders like me.
first time I found that detailed so clearly.

https://www.youtube.com/watch?v=u5HAYVHsasc
User avatar
greenpattern
 
Posts: 174
Joined: Tue Dec 01, 2015 3:05 pm
Location: Edinburgh Scotland, but I'm french

Re: GLSL Buffer A again please

Postby elburz » Tue Jan 16, 2018 5:28 pm

:D
--
Elburz Sorkhabi
Creative + Technology
nVoid Art-Tech Limited
http://nvoid.com
elburz
 
Posts: 1970
Joined: Fri Jun 01, 2012 6:55 pm
Location: Toronto, Canada


Return to Beginners

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 9 guests