What happened to uInstanceIDOffset ?

Hi,

So I was playing with my embryo of a GLSL particles system posted a while ago :
viewtopic.php?f=4&t=2453&hilit=uInstanceIDOffset

I noticed that visually it seems there were a lot less particles than if I opened the file in touch077, and after digging a bit, it looks like this line in the rendering shader

//vec4 newpos = texture2D(pointPos, vec2(mod(nr+gl_InstanceID*(uInstanceIDOffset+1),res)/res,(floor(float(nr+gl_InstanceID*(uInstanceIDOffset+1))/res))/res));

is not referencing correctly all the instances. If I remove *(uInstanceIDOffset+1) I get the same result and I see no mention of uInstanceIDOffset in the wiki anymore, but it looks like I’m not getting all my 44100 instances.

Not sure if it’s a bug or if something needs changing.

Thanks!
Vincent

Or maybe in my old post Achim has a point and I was doing something wrong though it looked nicer. Going to dig a bit more.
Still curious why uInstanceIDOffset is not needed anymore though.

Now I see

// For instancing functions, if you don’t provide an index,
// it will use (gl_InstanceID) or (gl_InstanceID + uTDInstanceIDOffset), depending on the situation

in the wiki, but replacing uInstanceIDOffset with uTDInstanceIDOffset gives an error with GLSL version 1.2 in Touch088.

Going to quickly try switching to glsl 4 for this one.

Ok, updated the other older thread, had a bug in the indexing that produced pretty results in 077 and not 088 anymore!

And looks like neither uInstanceIDOffset or uTDInstanceIDOffset is needed and it works fine with GLSL 1.2 or 4 (with the correct syntax)