Nate

Blog: 3.6 beta has clipping



Feedback is welcome! :clap:
头像
Nate

Nate
  • 帖子: 9241

Abelius

Great!

My only doubt is... could this be used to hide another skeleton's attachment? (being both skeletons in the same project)

That's the main use I'd have from this feature. Something like, erm... an enemy sword dissapearing behind a character's stomach (the center of it, not the border).
头像
Abelius
  • 帖子: 137

mfedorov

Wow! Amazing!
头像
mfedorov
  • 帖子: 253

badlogic

Abelius: no, the clipping is limited to the skeleton the clipping attachment belongs to.
头像
badlogic

Mario
  • 帖子: 2065

Abelius

badlogic 写道:Abelius: no, the clipping is limited to the skeleton the clipping attachment belongs to.
Fair enough. Mmm... and what about when we have skeleton attachments? Would it be possible then? :happy:
头像
Abelius
  • 帖子: 137

badlogic

Very likely. But that first requires skeleton attachments to be implemented :)
头像
badlogic

Mario
  • 帖子: 2065

majzim

I have a question. Will we be able to put a clipping mask on each image, or each bone, or will this be one clipping per skeleton?
头像
majzim
  • 帖子: 29

badlogic

You can have multiple clipping areas per skeleton. Each clipping area is "active" from its place in the draw order to the "end slot", also defined on the clipping attachment. You can have multiple clipping areas as long as they do not overlap in the draw order.

Please note that clipping is a heavy calculation at runtime. Use it judiciously.
头像
badlogic

Mario
  • 帖子: 2065

Shiv

is there any way to put some feather effect in clipping or making the clipping from a path which gives a much smoother and round edges ?
头像
Shiv
  • 帖子: 51

Nate

No, this clipping must be a polygon, sorry. Clipping with feathering would probably be done using an image mask and require shader support.
头像
Nate

Nate
  • 帖子: 9241

Shiv

requirement of this is highly unlikely but is there a way to invert masking ?
头像
Shiv
  • 帖子: 51

Nate

No, unfortunately inverting the clipping polygon introduces too many complexities to be able to support it. However, runtimes are free to implement clipping how they like. We may add an option to runtimes that can support it to perform clipping using the stencil buffer. This has other downsides (affects shader pipeline, breaks batching, etc) but does allow for inverting the clip polygon.
头像
Nate

Nate
  • 帖子: 9241

soni31884

Hi Nate,

I tried to use clipping in cocos2dx with spine-beta runtime branch. I tried to use the alien example exporting in 3.6.16-beta . Upto 4 points in clipping it was working in cocos2dx , after 5-6 points the alien does not load to the scene. I think may be the computation might be the problem.Let me know if it can work.

Regards
Soni
soni31884
  • 帖子: 5

badlogic

Could you send your modified alien example to contact@esotericsoftware.com?
头像
badlogic

Mario
  • 帖子: 2065

soni31884

I sent.
soni31884
  • 帖子: 5

badlogic

头像
badlogic

Mario
  • 帖子: 2065

badlogic

The issue has been fixed, thanks for reporting!
头像
badlogic

Mario
  • 帖子: 2065

EvilEntity

Ive been playing with clipping with libgdx backend, works great! Very useful.
EvilEntity
  • 帖子: 36

Channfree

Is it possible to say you wanted to animated a painting and you wanted a subject to move off of the frame. Could you mask the whole painting or rig so that works and you not working with a lot of extra space.
头像
Channfree
  • 帖子: 33

Erikari

Channfree 写道:Is it possible to say you wanted to animated a painting and you wanted a subject to move off of the frame. Could you mask the whole painting or rig so that works and you not working with a lot of extra space.
Sure, but isn't it better to "mask" the subject through mesh creation so that they can move and then clip just the exceeding part of the painting that needs to not be shown outside?
头像
Erikari

Erikari
  • 帖子: 1970

Channfree

Very true
头像
Channfree
  • 帖子: 33

Erikari

I was wondering, I was testing Spineboy creating a random clipping around him, I exported it and then imported it in the web widget test file I had, the animation is working, but there's no clipping at all, is it unsupported?

Also I noticed that when Spineboy shoots it looks like the additive blending is affecting the body but not the background even if it's set up as a color inside the widget.
头像
Erikari

Erikari
  • 帖子: 1970

Nate

Clipping is supported with all runtimes. Did you update your runtime to the latest 3.6?

I'm not sure about what you are seeing with additive. Got a screenshot?
头像
Nate

Nate
  • 帖子: 9241

Erikari

I previously used the file Badlogic sent me a couple weeks ago,
I just updated and yes, clipping is supported, tint black isn't supported though, and that's what I see:
test-webwidget.png


Also in case you need it, here's all the files


---

And If I change the color of the tint:
test2.png


---

Testing the additive setting with grey instead of red proves additive blending works also perfectly fine. It's just the tint black that has a funny behaviour...
您没有权限查看这个主题的附件。
头像
Erikari

Erikari
  • 帖子: 1970

badlogic

Whoops, there was a bug. I fixed the bug. Please get the latest spine-widget.js from here spine-runtimes/spine-ts/build at 3.6
头像
badlogic

Mario
  • 帖子: 2065


回到 Editor