Blending on Unity3D

Valhalla

Nexus Mir Developer
Veteran
Sep 7, 2012
1,948
3
447
150
127.0.0.1
hey has anyone got a way of blending two sprites together on Unity3D?(like the way mir does by removing black but leaving the rest)

ive got a script that works atm but it gets abit glitchy around flares ect (image below)


6IA7wPR.png
 

afshangrudar1

Dedicated Member
Dedicated Member
Mar 26, 2009
184
0
42
You can use a modified particle shader instead of regular shader. The way that mir gets rid of the black is like how "screen" blend mode works in photoshop which is similar to how a flare or particle shader works.
 
Last edited:

Breezer

Mr Mañana
Legendary
Jul 16, 2004
3,370
539
315
First of all, turn the images into a Sprite type, it will be allocated a default sprite shader.

Demo1.png

One that's done, drag that mofo into scene (as shown above) and select it in the hierarchy. You will now be able to see the shader it uses (obviously you'll probably want a normal Sprite shader for your Character base, and a particle one as mentioned above for effects).

demo2.png

Now, if you dont have any materials at hand to test, then make one, by right clicking in the project folder (assets) and creating Material.
Demo3.png


Once the materials made, select it and at the top will be a drop down menu. Here you will want to pick "Particles -> Additive" , once that's done, drag the material ontop of your Mir sprite (effect) and walllah, job done.

demo4.png
 
  • Like
Reactions: Valhalla

Valhalla

Nexus Mir Developer
Veteran
Sep 7, 2012
1,948
3
447
150
127.0.0.1
Got it working perfectly thanks :D

Starting work on a single player Legend of Mir, not sure how itll work out but im just thinking up ideas atm
 

Breezer

Mr Mañana
Legendary
Jul 16, 2004
3,370
539
315
Excellent mate! Glad more people are diving into Unity, let me know if you get stuck on anything else. Also I suggest you look into uniRPG, its a very well handled system for what you're wanting to achieve. Just hit CTRL+9 to bring up the Unity Store and type in uniRPG, its free so go ahead and download / import that into your project.

See below.



 
Last edited:

Valhalla

Nexus Mir Developer
Veteran
Sep 7, 2012
1,948
3
447
150
127.0.0.1
Thanks again! I'm surprised i haven't found that earlier, installing it now. and will do, you're like a go-to man for graphic stuff :P