Instant Mask is smooth mask!
It is mask an image on MeshRenderer and SpriteRenderer, UnityGUI, Particle.
Mask Image(s) cut or made hole shape of other one image.
It can express a smoothly semi-transparent mask such as anti-aliase and gradation!
Features :
Smooth Mask with Alpha or Grayscale texture
Can each adjustable such as Position, Rotation, Size, degree of Masking etc.
Up to three mask images apply to one base image in same time
Dynamically create a masking image, or can also export masked image file
Not increase the excess load, Batches and SetPass(DrawCalls) always in 1 at one object
Easy setup and easy use
Written in C# and comes as full source code for you
when I’m trying to mask image of dimensions 1024x1024 there is huge frame drop (~10FPS). I’ve also tried this in demo scene from package and there is the same problem. I’m trying to create puzzle game where each puzzle element is masking whole image.
Hi, centralpixel.
Thank you for your writing, I have been able to realize a bug.
In Version.1.03, this will be fixed. I want you to wait a little.
In the attached image, it show the FPS in the same conditions in Version.1.03.
It is inevitable that process is heavy if you change some value with ‘InstantTextureMask’.
A power is required to generate a big image.
If the weight of the process prevents the game progress, you can solve by ‘InstantShaderMask’ with UnityGUI.
Hi, there.
Next Version 1.10 should be coming soon.
In this virsion, with shader and particle, it will be able to apply some masks on one image objegt
at the same time.
What changes, please look at the above article.
And subtlety details, please look at the under image. Simply say, you can apply some masks on one base image, and do not worry about can not express.
Hi, I’m having trouble importing new images for either the base or mask. Importing masks is the most bothersome problem right now. Choosing them directly through the Inspector doesn’t do anything, and I can’t find the part in the code to allow new images.
Hi, Sir_Starshine.
Anyway, please check ‘Reasd/Write Enabled’ in image settings.
In addition, there is a possibility that can be solved if you look here.
Sorry, it is difficult for me to identify that cause because your information is rough.
It seems you reach an impasse in use of Unity basically for now.
It is necessary more detailed description if this asset not work well.
Hi, myouji
I have a plane I use as floor to my game.
On this plane Im using a seamless texture repeating this tile texture 3 times on X and Y covering the entire floor with 9 copies of this seamless texture.
For my project I need to put roles in two places on this floor. Is that possible to do that by using your Instant Mask?
Hi, would it be possible to create a “scratch card” or “eraser” effect with this Asset? I have a source image (a sprite) and I want to “scratch” away parts of it when I click.
Is it possible to apply multiple “cut out” masks to one object?
Also, would it be possible to apply a mask with e.g. 50% opacity and then apply another one with 50% and it would add up to 100% opacity (see image)?
Basically, I need an effect like in the image below:
If this is possible, is there a demo or a video or something so I could see the effect in action? I would really appreciate it! Thanks!
Hi, Etienne L.
You want to be like the under image?
It’s possible using mask with shader.
The position of the masks are determined with Tiling and Offset it is same as a texture on shader basically,
so it is need some calculation for adjustment of the exact position of masks.
(The calculation is also same as a texture on shader basically.)
Hi, heybudgames.
It is possible, but it need a little knack.
You split the sprite in a regular grid for animation,
and you set the Tiling and Offset of mask with shader just overlap in each of the grid.
So It is in a state that the same shape masks apply in each frame of animation.
However, if you change the part of mask state such rotation, the mask position is displaced from grid.
In that case, there is a need to write a script like a mask shift to next grid every frame.
(It might be good to add the script in this asset if some requests comes.)
Hi, TripleType.
Seemingly shader is not working properly.
Basic things, import this asset to a new project once more and check again.
If it will be no good, please try check the package that is attached in under.
(write after day: the package was already deleted)
If you will look images properly in that package, I may find the cause by it.