separating iterations

strontiumDog's picture

hello

i've been chatting on the vidvox forum about this, and am hoping to widen the audience to get a solution.

to cut a long story short, i've got a composition which uses midi in to trigger iterations of spheres on screen at different y vals. currently it looks like this after a good suggestion from someone there.

but i want moving spheres with completely separate interpolation values, but which begin at the same point, like this except obviously arbitrarily generated with midi notes-on.

the thread if you're interested is here.

really, i'm going to be creating arbitrary numbers of 3d objects on screen which will move/fade away from the 'camera', but need to be separated in order to act as though they're independent.

can anybody see where i'm coming from?

thanks IA s

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
nice

(loved the giant yellow "lame" note in the fake one :)

you could possibly build something like this using javascript (or possibly a custom patch, I think Toby Spark make one for cases like this). The problem is that the interpolation patch sucks inside an iterator (as do a number of other patches), so you have to make hack-arounds.

Alternatively, you could try using a queue to store the times of the events (attach the counter input to the queue's record input, and have a patch time go to the value input), then inside the iterator use the appropriate index's value (start time), work some math with the current time (to find your time delta), and derive position stuff from that. That's a lot of words for an otherwise rather simple concept -- let me know if it make sense and does what you need, or if you want to see a sample implementation or something.

strontiumDog's picture
do drop

hi christopher

thanks for the info - agree on the interpolator - a right pain.

i'm going to try the queuing idea now, but if you could drop a sample qtz for me to compare that would be great; also - i notice the queue patch doesn't have a record input. could you clarify which input you mean?

thanks s

cwright's picture
dental work

sorry for the confusion; the queue's input is titled "Filling" (not record, though that's what it controls -- if values are recorded/added to the queue or not).

I'll try to whip up a compo sometime (so swamped, sorry :/ )

strontiumDog's picture
javascript version broken too

thanks for your time.

having never worked with queues and there being almost no documentation on it or it's use, and finding it's (queue) output incompatible with an interator input, i can only imagine placing the queue inside the iterator to get any use out of it. which obviously is not what you meant.

if you get a second to rustle anything, wicked.

i'm trying with a javascript patch using the iterator variables index to generate the right x and y (and z) vals:

function (__number x, __number y, __number z) main (__index inputNumber)
{
   var result = new Object();
 
   // z
   result.z = -(inputNumber / 10);
 
   // y
   result.y = (inputNumber / 10) - 0.4;
 
   // x - start a new x val from -0.9
   result.x=-0.9;
 
   while (result.x<=0.9) {
      result.x = result.x + 0.1;
      return result;
   }   
}

this doesn't move my sphere's anywhere (like x=-0.9 to x=0.9). only iterative spheres are placed incrementally as values change. this is because the while loop executes and by the end of the loop the function returns without further iterations occurring (all iterative spheres are placed at x=0.8).

can anyone tell me how i can get the javascript patch to return the object, update the view, and iterate further, updating the view on each iteration?

i guess linked with this, does anybody know how i can include the passing of time in javascript used this way - ie. sleep(1) might be nice.

thanks again s

cwright's picture
loopless

the while loop in that won't do anything, since you're returning on the first iteration -- you need state stuff for each index (an array, one item for each iteration, to store where it currently is, for example).

The queue will probably be fine, once you figure out how to use structures a bit.

I'll try to make an example sooner or later.

strontiumDog's picture
sorted

hello - goto10 has kindly provided the example so no need to worry. thanks very much for your help though.

the complete thread on vidvox is listed above in my first post with full details.

s

toneburst's picture
I don't know if this is

I don't know if this is relevant, but when I was working on this fake SSAO effect http://machinesdontcare.wordpress.com/2008/09/15/more-ssao/ I worked out a group of JS scripts to create and manipulate structures containing X, Y, Z and Color values for groups of objects. I also worked out a JS patch to take two such lists and interpolate between them.

I don't have access to the QTZ at the moment, but I will dig it out, if anyone thinks it might be useful.

a|x

strontiumDog's picture
octopus

toneburst, i'd be interested. no javascript qtz work should be left on the shelf. i'm sure once i rig up a couple of examples i'd think up some use. i've already started thinking about a vOctopus in 3d space getting angrier as t++.
s

toneburst's picture
Here You Go Then

The SSAO effect was never as impressive as I'd hoped, but you might find the JS stuff useful.

a|x

PreviewAttachmentSize
tb SSAO Test 170908.qtz54.57 KB

psonice's picture
Ooh, nice. Improved version!

You got it working a lot better than I did (mine ended up with some nice depth shading, but no ssao effect somehow :/ ).

Anyway, I've tweaked it a bit to remove the bright edges and changed the shadow parameters a bit.. looks quite a bit better I think. Next step I think is to make the blur directional, to give more realistic shadows.. I'm tempted to give that a go, but it means taking time from the nice new UI i'm working on.. guess i'll have to see whether temptation wins ;)

PreviewAttachmentSize
tb SSAO Test 170908 psonice remix.qtz56.02 KB

gtoledo3's picture
I can't figure it out...

I can't figure it out... both of these are crashing my system.... ;o(

psonice's picture
crash

Both work fine here, but when I tried the first one it complained that i was missing the v002 blur plugin. Have you got that installed? if you have, try removing the plugin to see if that stops the crash (the composition won't work right of course).

If it's the plugin, let vade know about the crash and I'll do a version with the cheapblur filter instead.

gtoledo3's picture
Yeah... that's along the

Yeah... that's along the lines of what I was thinking too. I do have that installed... but maybe there has been more than one build?

To clarify though, it doesn't crash when I open it, only when I render.

I'm going to take your suggestion, and maybe even just opening it up to swap out a cheap blur quick to see if that works...

I get the dreaded 88.88fps for a few seconds... and then ka-blooey.

The only other variable I could think of is that I updated xCode/QC versions last night, before trying to open this file.

psonice's picture
Meanwhile, back in the lab...

I quickly hacked angled shadows and soft shadows over the backdrop in over lunch. All 100% fake naturally :D

It's rather slow at the moment, because of the motion blur filter I used to get the shadows to angle. A cheap motionblur filter to replace it would work wonders for the framerate, but I'm out of lunchbreak..

Wait, didn't vade do a v002 motion blur plugin? i'll replace it with that if he did, it should be much faster...

edit now MUCH faster, and it requires the v002motion blur plugin. Thanks vade! (get it here: http://002.vade.info/ ) (updated .qtz attached)

It could be improved a lot by having a better motionblur method (it should blur in one direction, i.e. from point A out one direction, the standard motionblur plugins tend to blur out in 2 opposite directions.

PreviewAttachmentSize
tb SSAO Test 170908 psonice remix v3.qtz59.96 KB

toneburst's picture
Sorry Guys

Should have mentioned it needs the v002 blur. Everyone should have it, anyway, It's so amazingly fast, it opens up all kinds of possibilities.

a|x

gtoledo3's picture
Hmmm.... to be clear, I

Hmmm.... to be clear, I definitely have the v002 blur, and clearly see the patch when I open the composition.... I am going to go over and make sure that there hasn't been an update, and that is what is making it crash?

Weirdness!!!

I am going to send some bug reports because all of those plugs generally work, but I get different crashes with them (in general) so I avoid them.... I do think the example comps (v002) are amazing in what they do with the frame rates, and the quality of the blurs are really nice.

No worries about the plug-in thing... I posted something the other day and didn't even remember that histogram operation is a Developer Example Plug in...

toneburst's picture
Nice!

You've sorted out the edges! Cool. How did you do that, then?

a|x

gtoledo3's picture
This is disturbing.... I

This is disturbing.... I doublechecked the v002 plugin... latest build installed.

So, I patched in a gaussian really quick, erased the v002... STILL crashed. Lowered the iteration amounts (wild guess)... still crashed!

I hope this latest QC build isn't hosing up everything.

gtoledo3's picture
Is this something that would

Is this something that would be reasonable to report to the Developer List?... I'm not sure of the "netiquette". ;o)

EDIT:

These both render without crash in Quartz Crystal... but the second I change iteration amount they both crap out, and all I'm left with is the gradient background....Rotations, etc., work fine....

cwright's picture
file

george, why not fling the file (composition and your copy of the plugin) at me, and I'll do some tests to see what's crashing, and if it's reproducible (on a macbook or MBP) -- that'll help narrow it down before bringing it up to the list.

psonice's picture
Files are already there

The files are already here on the thread - look up a bit, and try the attachments in mine and tonebursts posts.

For the record, I've run it on an imac with xcode 3.1 + 10.5, with radeon 2400.

psonice's picture
Clamping

From what I remember, it was just a bit of clamping needed.

I noticed that the shadow map was being subtracted from the colour image, so should be darkening it, but it was actually brightening the edges somehow. So I clamped the output of the bit where the difference map is created, and it fixed it.

It seems the 'bright edges' is a really common thing: http://www.gamedev.net/community/forums/topic.asp?topic_id=463075&PageSi...

(and actually the original link you posted about this technique specifically mentions clamping this stage.. but I think he suggested clamping to the range 0-2, which makes very little sense in a GLSL case :D )

cwright's picture
yeah

There are like 3 versions of the composition (wasn't sure if it was a particular one), and there are a couple versions of vade's blur plugin I think (I might still be using a beta version, since I don't blur that much, and when I do, I don't like the subsampling artifacts).

Anyway, tried out the "remix v3" version of the comp (with whatever plugin version I have), and it runs without crashing -- small window, full screen, everything. The background/boxes disappear randomly at times, but no instability. (2.5fps! yay! ;)

gtoledo3's picture
Process: Quartz

Process: Quartz Composer [497] Path: /Developer/Applications/Quartz Composer.app/Contents/MacOS/Quartz Composer Identifier: com.apple.QuartzComposer.editor Version: 3.1 (63.2) Build Info: QuartzComposerEditor-630200~2 Code Type: X86 (Native) Parent Process: launchd [65]

Date/Time: 2008-11-27 08:40:39.828 -0500 OS Version: Mac OS X 10.5.5 (9F33) Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000bf7ffffc Crashed Thread: 0


Thread 0 crashed with X86 Thread State (32-bit): eax: 0x00000000 ebx: 0x94022d25 ecx: 0xbf80000c edx: 0x00000000 edi: 0xa079a924 esi: 0xbf8010fc ebp: 0xbf801058 esp: 0xbf7fffd0 ss: 0x0000001f efl: 0x00010282 eip: 0x94022d6c cs: 0x00000017 ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037 cr2: 0xbf7ffffc

Mannnnnn. I am the odd man out here :o)

I could still send the comp and the plug... but it looks like a bug report scenario? I definitely have the most recent v002, and installed correctly etc,... I have used the v002 in other things.

This is actually a little shocking, because I have never had a flat out reliable crash like this... And what a bummer, because I have really been wanting to try this shading method out with 3D Lettering.

gtoledo3's picture
Process: Quartz

Process: Quartz Composer [497] Path: /Developer/Applications/Quartz Composer.app/Contents/MacOS/Quartz Composer Identifier: com.apple.QuartzComposer.editor Version: 3.1 (63.2) Build Info: QuartzComposerEditor-630200~2 Code Type: X86 (Native) Parent Process: launchd [65]

Date/Time: 2008-11-27 08:40:39.828 -0500 OS Version: Mac OS X 10.5.5 (9F33) Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000bf7ffffc Crashed Thread: 0


Thread 0 crashed with X86 Thread State (32-bit): eax: 0x00000000 ebx: 0x94022d25 ecx: 0xbf80000c edx: 0x00000000 edi: 0xa079a924 esi: 0xbf8010fc ebp: 0xbf801058 esp: 0xbf7fffd0 ss: 0x0000001f efl: 0x00010282 eip: 0x94022d6c cs: 0x00000017 ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037 cr2: 0xbf7ffffc

Mannnnnn. I am the odd man out here :o)

I could still send the comp and the plug... but it looks like a bug report scenario? I definitely have the most recent v002, and installed correctly etc,... I have used the v002 in other things.

This is actually a little shocking, because I have never had a flat out reliable crash like this... And what a bummer, because I have really been wanting to try this shading method out with 3D Lettering.

Like I said, the weirdest thing was that it still won't run, even when I patch in a regular gaussian blur... So that leaves me to thinking it is something with the javascript maybe? And when I drop it in Quartz Crystal, it stays open, I can manipulate all the properties except iteration amount... then all I get is the background, with no "going back". That is with any three of the comps.

psonice's picture
Iterations/crash

The iterations thing happens to me too.. don't know if it's something I changed, but I think it was like that from the start. You can change the iteration count and restart the composition to get it working with the right number.

If the crash is happening with a regular gaussian blur then most likely it's a core image or glsl problem. What GPU do you have?

gtoledo3's picture
SOLVED!

I figured out exactly what causes the crash...

Change the render in image setting to "default". I guess I can't do 32 bit render in image on this with the QC render, lol.... weird...

GMA X3100, which is supposedly supposed to support 32 bit, unless I misread something.

psonice's picture
x3100 = no 32bit modes

None of the intel GPUs (including the x3100) support 32bit/channel, or any floating point formats. Infact they only support 8bit integer rendering, so you can't even use the 16bit integer mode.

Odd that it crashes though, usually it just doesn't draw anything. I'm guessing it looks ugly as hell with 8bit rendering?

gtoledo3's picture
boy this file name is getting long....

Yep yep yep.... The basic file with rendering mode set to auto, for anyone who is on a Macbook...

gtoledo3's picture
with GL Tools...

psonice wrote:
None of the intel GPUs (including the x3100) support 32bit/channel, or any floating point formats. Infact they only support 8bit integer rendering, so you can't even use the 16bit integer mode.

Odd that it crashes though, usually it just doesn't draw anything. I'm guessing it looks ugly as hell with 8bit rendering?

Oh, so I can't have fun too ;o) ????

Check this out...

(note: changing the iteration amount during runtime is obviously still too much for a Macbook to handle... suprising kind of.)

toneburst's picture
I noticed the published

I noticed the published Iteration Count control doesn't seem to be working in psonice's remixed versions. It seems to be 100 or nothing (ie nothing renders if the Iterations control isn't set all the way to the top). Dunno why this should be, though it's probably some weirdness in my JavaScript patches that didn't show up before.

a|x

toneburst's picture
Ah.. clamping...

I thought 'clamping' in that context meant clamping the image bounds, rather than the colours. Doh.. silly me. Well noticed Chris!

I have to say though; I actually quite like the bright edges. It gives the mesh a quite pleasant translucent look, like a kind of really cheap subsurface scatter. This is no coincidence, in fact, as you can approximate SS by building a 'thickness map' by differencing depth-maps for front and rear-facing fragments. Mike Pan, whose blog I got this SSAO technique from, also mentions this variation on the same method to do subsurface scatter too.

No easy way to do it in QC though, I suspect.

a|x

gtoledo3's picture
SHADOWS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

On my system, even your original one does this.

It is COOL though.

Maybe this should be split into a separate thread at this point?

THIS has FINALLY clued me into getting my most sought after effect! SHADOWS IN QC!!!! Forgive me for eradicating the GLSL shader, but what I have been trying to figure out for awhile is "how to" emulate shadows in QC, and simply chopping out what you have in the render, and substituting whatever, works pretty ok.

I also was messing around using some zoom blur kernels with and without the Vade blurs, for the shadow macro with your original comp and was getting some really visually appealing results. ( I didn't do that with this .qtz)

This was pretty quick, so hopefully it makes sense.... it has FOV published...but you can go "into" the comp and mess with the GL Logic Ops... I just reposted this, cleaned it up, and unpublished the GL Logic Ops since some of them yield no output.

PreviewAttachmentSize
working particle comp with shadows and fov.qtz40.51 KB

leegrosbauer's picture
It's not a laptop issue, I suspect.

gtoledo3 wrote:
... changing the iteration amount during runtime is obviously still too much for a Macbook to handle... suprising kind of ...
I'm running a 2.8GHz iMac. Changing iteration count wipes the foreground imagery on all these SSAO Test files, nonetheless. ;-)

gtoledo3's picture
Version with "Apple Developer Distortion" example...

I plopped in a modded version of the Distortion example with primitive selections, and HSL color change with iterations.... it also is wrapped in a Kineme GL Logic Op...

Hope it is fun... I love that Distortion example, and you can get a lot of variability by tweaking the math operations....

PreviewAttachmentSize
SSAO MUTANT with Kineme GL.qtz45.96 KB

leegrosbauer's picture
That's crazy :-)

gtoledo3 wrote:
... I plopped in a modded version of the Distortion example ...
That one makes me grin. And .. the aforementioned iteration issue is gone. Fun!

toneburst's picture
Very nice!

You don't get the full effect of the SSAO stuff when everything is moving around so much. You could probably strip out that altogether without it looking much different, and just go with the basic lighting in the Render In Image patch, and the Soft Shadow effect.

Nice transformations, though.

a|x

gtoledo3's picture
Yeah, if it is moving quick

"You don't get the full effect of the SSAO stuff when everything is moving around so much. You could probably strip out that altogether without it looking much different, and just go with the basic lighting in the Render In Image patch, and the Soft Shadow effect."

Yeah, if it is moving quick you don't consciously note it as much...

This is a example of setting it at a "slower moving" preset....

PreviewAttachmentSize
SSAO MUTANT with slow preset demonstration.qtz45.96 KB