Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by SlotGamer

I'm looking to speed up my rendering issues and I just got done watching a google rendering optimization video:

https://www.youtube.com/watch?feature=player_embedded&v=n8ep4leoN9A

which makes me realize how important layers are for letting the GPU do the heavy lifting. Now, I wonder if the reel symbols in my slot game should be put into individual layers and I should just move these layers instead of calling drawImage(x,y) on each of these symbols with a new position every frame?

Does ImpactJS have the ability to do this per image? Or maybe it would be better for me to create a new layer in ImpactJS and draw my sprites onto this layer first and then scroll this layer in back of the slot machine layer?

I know ImpactJS has the layer concept for scrolling backgrounds and maybe this is what I need to hook into when I draw my sprite images on it at the beginning of each spin?

Maybe I just need to create another canvas and render these sprite images to this other canvas and somehow make this canvas a new layer scrolling in the background?

Any help in this area would be greatly appreciated!

1 decade ago by SlotGamer

I was thinking each slot reel would be a separate layer although i think the tradeoff is this will take more GPU memory.

1 decade ago by paulh

I'd use a different assett sprite which has some motion blur etc and then swap em back for the result...

1 decade ago by SlotGamer

More specifically, I was reading about how Chrome composites layers on the GPU and as long as you don't change anything with these layers (you just translate them), then all the work will be on the GPU and not the CPU as far as compositing them together for the final image each frame.

I'm interested if anyone knows how I can accomplish this using ImpactJS because as far as I understand, I need to stop calling DrawImage() every frame and instead, just translate these layers. I think this is known as the z-index hack which puts an image into its own layer.

How would I accomplish this z-index hack in Impact is what I am interested in.
Page 1 of 1
« first « previous next › last »