Get the ping a` ponging
So I am trying to come up with a dynamic chainable simulation system… yeah I know that’s a mouthful.

ANYWAYS, it’s structure is modeled off my GOL simulation ping-pong setup that was really really sloppy (but at least it worked {with a memory leak though im pretty sure}) which can be seen here if you have not seen it yet:

What I am trying to do is get the top scene actually passing the updated RTT’s to the next pass in line. I’m thinking maybe the step I am missing is generating the PostProccess on each step? But before I did that I wanted to check if anyone has any input on the topic.

I know these facts, the rtts are being updated correctly once at least and the initial texture buffer is also being set correctly.

What I dont know, is why its not flashing red and black now. Ideally we should even be able to chain the first step in the process on itself. I see that in the initial run its flashing once… so I gotta be close.


@Deltakosh, so do I need to do the PostProcess during each step?

I tried doing that here:

but I still cant seem to get things continually looping like I was hoping.

welll… this is my last post before I am a married man! woop woop. Peace out all, wont be around for a few days. Catch y’all on the flipside.


Hey not sure to get the question. Can you simplify the PG or point me where you have an issue?


WOAH! congrats man

Congrats!!! That’s awesome!

Thanks all, it was lots of fun!
Ok let me see if I can explain this better, cause I have a sneaking suspicion its really close.

so I have the SimulationSystem object which the idea behind is that you can create a rtt and have a shader process over it then pass it out to the next rtt on the chain or where ever they need to go.

In this version I have the console logging out when the links are being set which when I read over it it seems correct:
(2) VM79:233 Set Initial Buffer

VM79:236 Setting link:0 - On Step:0
VM79:236 Setting link:0 - On Step:1
VM79:236 Setting link:0 - On Step:0
VM79:236 Setting link:0 - On Step:1

So it shows me that I am at least trying to bind the rtt to the correct uniform samplers on each “step”
If we look at this one:

On line 142-173 is the area that I am trying to get really working… If it was working It would be flashing red and black.

The idea with each step is that a rtt will get updated by the post process then stored in that state. The the rest of the steps have access to the last update that was stored on a steps rtt.

Basically trying to be able to chain the rtt’s output together then display it.

Here is a example where if I get it working right it is just one step passing its own information to itself
Where if it was doing what I was hoping would be a black cube that gets 0.1 added to its color every step then when its gets over 1.0 it snaps back to 0.0.

Would I need to clone the rtt to pass it back to itself on a postProccess pass?

Maybe Ill just kinda start over on this idea cause I was able to quickly make the old setup do it…

Im super close with:

I ended up kinda starting over, but at least now I get this error:
[.WebGL-000001BB54D33040]GL ERROR :GL_INVALID_OPERATION : glDrawElements: Source and destination textures of the draw are the same.

Which I though could be fixed by changing line 255 from
effect.setTexture(this.linkNames[i], this.parent.compiled[this.links[i]].rtt)

though it got past the error it did not seem to get things working… :woozy_face: I bet once Ive had a good nights sleep and really thought about this ill get it. but if anyone sees anything that just sticks out as to why its not working please chime in. any input at this point would be awesome.

UPDATE Ive been able to proof out that the rtt’s are being updated once or at least the shader is affecting them like one pass has happened. which is making me lean tword they are not saving they state back or updating it I guess?

Not really seeing why the old GOL version works and this one does not…

Can you isolate the problem? I mean on a simpler pg?

It might be hard to isolate it.

Basically I am trying to have a rtt get a PostProccess applied to it, then have the results get bound to
another PostProccess which then pass the results to the first PostProcess

I think everything is really close, just that the rtt’s are not updating from the shaders like they should.

I just gotta figure out why this example works:

What should I do with to make the bug visible?

Give me some time today after I get some work done, Ill redo the PG with a bunch of incremental comments and see if I cant work this out.

1 Like

I was finally able to figure out a chainable simulation material… the whole time I had it right, I just did not finish up the idea but also did not realize how close I really was.

There might be a better way to do this, but for now this will open up the ability to do all the GPU simulations my heart desires.
image < woot cake day!

Anyways this setup with an 8k resolution is like 200 million concurrent calculations running at 60 fps no problem.


very Nice @Pryme8

Happy cake day buddy!!!

man, did you just create a GPU-based Game Of Life?! how awesome is that…

1 Like

More then just that, I created a system for doing any kind of GPU simulation. The GOL was just a Hello World. Now when I do my procedural content there will be the ability to do simulation passes over my textures as well. So flowing water on a heightmap becomes a possibility and other physic systems now.


i love the raw idea always
how can we make medal in forum’s ::))) for you :slight_smile:

1 Like