Hello Guest

Author Topic: Sprite mask with custom shape  (Read 6771 times)

jasperPT

  • Newbie
  • *
  • Posts: 1
    • View Profile
Sprite mask with custom shape
« on: January 11, 2015, 03:49:25 pm »
Hi,

It seems the only current way to use a mask is with a square shape, is there any way of changing the shape or even better using a sprite as the shape of the mask?

Cheers,
Jasper

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite mask with custom shape
« Reply #1 on: January 11, 2015, 11:11:33 pm »
No there isn't, the mask solution uses depth, and the mask geometry is limited to a rectangle.

mangoocean

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Sprite mask with custom shape
« Reply #2 on: June 23, 2015, 08:37:55 am »
Hi,
I've been trying to mask a sprite with depth, but whilst it works, other objects that are ABOVE this masked area in my scene also get cut off and not sure how to fix it. Tried different cameras, different depths and layer sorting.

Any ideas?
Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite mask with custom shape
« Reply #3 on: June 23, 2015, 10:54:52 am »
Different depth sorting should work, but the thing to look at will be the shaders. Run through the frame using the frame debugger to find out what its doing - it could be drawing in the wrongorder.

DarkSlash

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Sprite mask with custom shape
« Reply #4 on: July 24, 2015, 08:51:55 pm »
Wanted to know the same. Sad that can't be done, Unity mask supports custom shapes but only for images objects, not for sprites :(