GLSL shaders in iterators: a breakthrough (Toneburst should definitely take a look)

idlefon's picture

Hello everyone! So I've been trying to make the shaders work in iterator especially after I read a couple of threads (toneburst was in all of them :) ) about how it could be only done with Render In Images (which will ruin the 3d fun) or kineme SuperGLSL. I figured out the solution (which will work for the built-in Particle System patch as well) and it is to put the shader in a 3d transformation patch first and then put the whole thing in an iterator. it has it's downside ofcourse. the downside is that the global uniforms will not change immediately after changed (you have to restart the viewer). I tried to force the variable to rely on the iterator' position. the result is that it sometimes work and sometimes doesn't. I attached the comp. check it out and see if you can solve the global uniform problem. That will be fantastic!

PreviewAttachmentSize
Multi-GLSL in Iterator.qtz15.96 KB

gtoledo3's picture
Re: GLSL shaders in iterators: a breakthrough (Toneburst ...

There has never been a problem using the iterator and shaders that I'm aware of. Done it plenty. Always works (for me). I'm not sure about that SuperGLSL/kineme patch, as I never really used it much - I'm almost certain it doesn't work correctly in SL.

There is a problem using the shadow lighting option with iterator though (grasping for what you could be thinking of...)....

Also, it is more effective to put the iterator inside of the GLSL, not the other way around, which makes the GLSL evaluate many more times.

(haven't looked at your test file)

idlefon's picture
Re: GLSL shaders in iterators: a breakthrough (Toneburst ...

It seems you are right, it works ok without the 3dtransform patch. I was referring to threads like http://kineme.net/FeatureRequests/MultiPassGLSLShaderPatch and 1-2 posts on toneburst's blog. by the way it still has the global uniform problem when using GLSL in an iterator (can not change the uniforms without restarting the viewer). do you have the same problem goerge?

Sorry everyone for making a fuss about nothing important.

cwright's picture
Re: GLSL shaders in iterators: a breakthrough (Toneburst ...

the uniforms thing is a known bug, unfortunately.

gtoledo3's picture
Re: GLSL shaders in iterators: a breakthrough (Toneburst ...

Ahhhh, no, I apologize, I may be misunderstanding- the uniforms thing is a definite problem...I wasn't aware of anything with that one, I have to educate myself on that apparently.

edit- wow, that's a heck of a bug. There's no way to even turn off/on the sphere, iterator, whatever, and have it re-evaluate... I'm realizing that is one big bummer for many things!