[PLUGIN] Paster

Post your completed addons to share with the community

Post » Wed Apr 29, 2015 5:23 pm

You could use the .ZIndex expression to get the z order of the object, then you could draw the instances in the same order with:

For each behindinfront ordered by behindinfront.ZIndex ascending
--- paster: paste behindinfront
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Sat May 02, 2015 10:41 am

Thanks so much! That works a treat!
B
12
S
2
Posts: 12
Reputation: 847

Post » Sat May 09, 2015 8:03 pm

Hello @R0J0hound , can you please help me with this weird thing here..?

I am trying to make a pseudo-3d room with paster and for the most part it works great! But for some reason the textures are distorted, this is evident when they have straight lines and those "brake" and get jagged in some places...

Please have a look at this example capx: http://www.eli0s.com/Tests/Paster_Perspective_Room.capx (right click and save link as)

Am I doing something fundamentally wrong?

Thank you in advance for any tip!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Sat May 09, 2015 8:53 pm

@eli0s
This post is relevant:
plugin-paster_p881398?#p881398
Basically it's because the quads can't be drawn with perspective since there's no real z.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Sat May 09, 2015 10:06 pm

@R0J0hound , damn, it would be too easy if it worked out of the box :)

I saw your other examples and both workarounds are too difficult for my abilities. I'll just stick to the plain good ol' parallax for now...

Thank you so much for taking the time and answering me R0J0, I really appreciate it!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Sat May 16, 2015 11:00 pm

R0J0hound wrote:@TiAm @Somebody
I'm not having much progress with getting the canvas pasting to work reliably. It's currently kind of random if it works or not, so I may end up having to go a slower route of making an off screen texture and rendering everything to that.


Hey, any chance of you working your rojo-mojo on this? ;)

I use this functionality for the pause menu in my current project to do a 'background blur' of all layers but the top menu layer. I just grab the canvas when pausing, paste it onto the paster object, and use an animated blur effect on it.

Problem is...at some point 'load texture from canvas' stopped working on my mobile. Used to work in cw7 and chrome mobile, iirc. Works fine on desktop, except in IE (and it never worked there).

The only other way of doing this (other than the painfully slow CanvasSnapshot function) is to apply the blur to all layers except the top, which is too slow on mobile.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun May 17, 2015 2:59 am

@TiAm
I haven't touched it in a bit, but one thing I found was it seems to grab the frame 4 frames back but not always immediately. If you use the "load texture from canvas" four frames in a row then it should for *sure grab the canvas. At least as I recall.

*tested with chrome on desktop. It might be something internal to how the browser works.

The the main issue is copying the canvas to a texture is not undefined behavior according to the webgl spec, which might explain why iexplorer doesn't work. i had thought it might be an issue of when I grab the canvas but I haven't been able to find any place that works better.

One thing that I could investigate further is enable a flag when the webgl context is created to tell it to save the canvas' texture after every frame. The drawback is it's not something I can do from the plugin, I'd have to change it in c2's runtime. The second drawback is the webgl spec has an ominous warning that says enabling that flag can have an overall performance impact.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Sun May 17, 2015 7:12 am

@R0J0hound

Thanks for replying. The flag idea does sound like it would incur a hefty perf overhead, but...well, I think you know more about this than me. ;)

I'll try capturing the canvas multiple times and see if that works.

Shame there isn't a good, fast way to capture the canvas built into the webgl spec, seems a bit of an oversight.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Thu May 21, 2015 4:42 am

I've been able to get spritefont to paste as expected.

Pasting the text obejct works, but appears to paste erratically. Its position is off, and it pastes the text upside down.

Any idea as to why?

Looks like pasting text objects almost works properly, any chance of making it work as well as spritefonts?

Thanks for your continued support of this plugin.
B
17
S
2
Posts: 88
Reputation: 1,503

Post » Sat Jun 06, 2015 9:37 pm

Probably the most impressive plugin I've seen so far. I love it.

Are the versions in the OP outdated though? Is there a better renderer yet?

Thanks for everything though, Rojo!
B
7
S
2
Posts: 24
Reputation: 567

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests