[PLUGIN] Paster

Post your completed addons to share with the community

Post » Wed Jul 20, 2016 11:38 pm

There seems to be a bug when paster object has negative width and angle set. There is flickering in the non-rotated and non-mirrored area (where it'd be if it weren't rotated or mirrored).
I am clearing and resetting angle/width before pasting, so it must not be drawing/clearing the correct areas.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Wed Jul 20, 2016 11:47 pm

I think what happens is that, it doesn't runs the actions in the correct order.
I paste object and then mirror/rotate, but it acts as if the mirror/rotate was done before the paste.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Thu Jul 21, 2016 2:45 am

Hmm, interesting. I've never enountered that. Then again I haven't used webgl in a while either.
I probably won't be able to look into it very soon.

Webgl queues up draw calls until a "present" or "flush" call sends everything to the gpu to draw. If you're interested in tinkering with it you can try adding glwrap.flush() to the end of the paste function in the plugin's runtime.js. It may not be that exactly though. It might solve the out of order issue, but it will also make it slower.
B
91
S
31
G
102
Posts: 5,233
Reputation: 67,252

Post » Thu Jul 21, 2016 4:48 am

I managed to get the effect I wanted, but what I found weird is:
- every tick
+ load texture from canvas
+ clear to rgba(0,0,0,0)
If I put the clear above the load texture, then it won't clear it. Some reason it only clears if you do it last. This happens if webgl is disabled (I haven't tested with webgl enabled at all yet).
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Thu Jul 21, 2016 5:11 am

That "load texture from canvas" doesn't work reliably with webgl on since it relies on undefined behavior of the webgl spec. I never got around to removing it.

That said, it makes sense to me that it would clear only if you clear last. If you cleared first, it would clear but then it would be filled with a copy of the canvas.
B
91
S
31
G
102
Posts: 5,233
Reputation: 67,252

Post » Thu Jul 21, 2016 7:27 am

I'm using canvas2d though, not webgl, and I want it to be filled with a copy of the canvas.
What I meant is that it doesn't clear at all if it is above. It just loads the texture without clearing first.
So for some reason I have to clear it at the very end so that it is cleared in the beginning of the next event cycle.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Thu Jul 21, 2016 4:52 pm

@Prominent
It may be because C2 didn't redraw yet. So it doesn't matter what you draw to the object before grabbing the canvas, because c2 hasn't redrawn the canvas.

Edit:
Also I cannot reproduce the flicker issue. Can you show the event used?
B
91
S
31
G
102
Posts: 5,233
Reputation: 67,252

Post » Thu Jul 21, 2016 5:36 pm

Hm.. but the issue is that it isn't clearing the paster object when that event is first. It draws the canvas to the object but the previous image isn't cleared.

https://1drv.ms/u/s!AhHSZHEulqh_gWVgeYYDfLejkXNJ
There's an example of the flickering.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Thu Jul 21, 2016 6:11 pm

There probably is nothing i can do about that.
B
91
S
31
G
102
Posts: 5,233
Reputation: 67,252

Post » Sun Sep 11, 2016 7:25 pm

Hi, pardon me if this has been answered before.
I can't get lighting to work for my game when using paster to make a split screen. Seems to be out of alignment or most likely I'm using it incorrectly?

https://dl.dropboxusercontent.com/u/42843139/share/pasterlight.capx
B
17
S
3
Posts: 32
Reputation: 1,176

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest