Who says C2 doesn't support skewing sprites?

Discussion and feedback on Construct 2

Post » Sat Mar 23, 2013 3:14 am

ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Mar 23, 2013 4:33 am

@shinkan it was awesome experiment but hard to implement, this sprite has more than 64 frames were splitted.
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Sat Mar 23, 2013 4:32 pm

I'm pretty sure there is a mode 7 effect or plugin.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Mar 23, 2013 9:43 pm

Joannesalfa@

@shinkan it was awesome experiment but hard to implement, this sprite has more than 64 frames were splitted.

sqiddster@

I'm pretty sure there is a mode 7 effect or plugin.

Heres a simplified version...using Mode7 plugin-




DEMO

CAPX

B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sat Mar 23, 2013 10:59 pm

@chrisbrobs @sqiddster Good one! does mode7 effect apply horizontal skew and perspective?
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Sun Mar 24, 2013 1:25 am

The link you posted looks like it works by issuing a separate draw call for each line of pixels in the image. This will totally destroy performance, since a single skewed object which is 400 pixels wide will take as long to render as 400 sprites.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Mar 24, 2013 3:04 am

@Ashley

Would you explain why C2 doesn't support skiwing sprites like Construct Classic does?
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Sun Mar 24, 2013 3:38 pm

It's quite a complicated feature (since it ought to skew the collision mask as well and affects the bounding box which is used everywhere in the engine), and it's not possible to do it in a performant way in the canvas2D renderer. You could probably use a WebGL shader to do it if you really need it, but it won't affect the bounding box or collision mask.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Mar 24, 2013 5:13 pm

@Ashley - While having it skew the collision mask would be nice as an option, I don't think it's necessary - besides, I can imagine many situations where I wouldn't want it to do so, as it could use CPU time better suited elsewhere, since some of the collision polygons could become quite complicated to generate and as such possibly hit performance for a collision mask the developer might not even want to use (I suppose, come to think of it, if it was something like the collision polys were only built if a collision check was done on the object, that would be cool). As I recall, CC didn't have correct collisions on distorted sprites either, but it was still a great feature regardless.

Or another thought - what if it just used the polygons already generated by the distortion grid itself? It would be less accurate, but quicker to generate - although that could result in quite a lot of polygons to check for collisions with.Arima2013-03-24 17:14:59
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Next

Return to Construct 2 General

Who is online

Users browsing this forum: shinichild and 16 guests