A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by Elringus, Jan 16, 2015.
I've send U the email.
We bought the plug-in yesterday. It's really useful, so thank you for that!
One minor issue we have is the way the blend modes interact with the UGUI mask component. We want to do some subtle highlighting on a progress bar with the overlay blend mode; but we need to mask it out because it's got an irregular shape.
I've attached a picture showing the difference.
I'm not a programmer; so I'm not sure if this is a case of 'this is the only way it can work' or if it's just unintended.
Unfortunately, due to the way masks are currently implemented in Unity, they are “blocking” grabpass and therefore making impossible to use the Blend Mode effect. I will try to research the topic more, but can’t promise there will be any solution. Sorry for the inconvenience.
That's fair enough. The mask implementation has been a consistent pain for us in using UGUI anyway; so I'm not too surprised that it's a limiting factor on this too.
Thanks for the quick response!
This looks super useful, but I wonder, what would be the behavior of this on android devices without tegra?
Is there any fallback?
It will work in Grab and Unified Grab modes, but performance might be rather poor, depending on the device.
Just wanted to inform you, that due to a known bug with GrabPass in Unity 5.2 (case #724452) Blend Mode effect will not render properly in the editor when any of the aspect constraints are set for the game view (like 16:9, 4:3, etc).
This problem only affects the editor (it will not show in any of the builds) and it will not show when using the “free aspect” mode.
Most likely, this bug will get to the final 5.2 release, but is promised to be fixed with one of the first patches.
In most cases, it shouldn’t be a problem to use the “free aspect” mode in the editor as a temp workaround, but if it is, please consider waiting for the patches before upgrading to Unity 5.2.
EDIT: The bug has been fixed in 5.2.0p1.
Hi, I've bought the plugin but I'm experiencing a rendering problem on 5.2.0f3. I've put a simple plane with the blending shader between the camera and the scene, but everything behind the plane is shifted. Please help! Thanks!
Just as I wrote in the previous post, there is a bug in Unity 5.2, which causes Blend Mode effect to render incorrectly in the editor. Just install the latest patch (https://unity3d.com/unity/qa/patch-releases) and it should solve the problem.
It's sorted. Thanks very much!
I'm pretty hopeless when it comes to shaders within Unity (learning, but slowly), so last week I bought this asset to resolve a particular issue which it did instantly with the Pin Light mode.
I've build my game to Android (Tegra) using the Framebuffer render mode (as advised in the documentation) and, although the image is transparent, the completely transparent parts of the image become visible. So rather than having an image that blends nicely onto the the image behind I end up with the full box on display which ruins the effect.
Is there anything I can do to make the fully transparent alpha level stay fully transparent in Framebuffer mode?
There is a bug in the current version of the plugin, which prevents framebuffer shaders to compile correctly with Unity 5.2. It’s just a guess, but your problem could be related. Please contact me via the support email with the invoice number and I will send you the new version with the fix, so we could check if it will help to solve the problem.
This kind of functionality would also be wonderful for particle systems! I would also instantly buy this if it were a feature. Is it possible to apply a black mask over the background? Or sample the background color to subtract from the color? Render on different cameras maybe?
I’ve made some progress with the “selective blending” feature using alpha channel as a mask. It’s far from perfect, but does its job in simple cases like this:
I’m still not sure if it’s at all possible to achieve such selective blending in a way that would integrate with the plugin and work in all cases (like with particles and different camera clear flags) and will continue working on this, but if someone would like to try using current implementation — you may get it here: https://get-asset.appspot.com/BlendModes (you’ll be asked to enter invoice number in order to download the package)
Hi, this is a very interesting plugin for me. Is there a place where the android devices / operating system that support the required mobile friendly GL extension are listed?
I’m not sure such thing exists, unfortunately. There are so many android devices that it’s nearly impossible to list them all, not speaking of listing all the extensions they support. In theory, at least all the PowerVR and most of the NVidia Tegra chips should support the extension, but then it’s also a question if the drivers exposes it.
I just bought Blend Modes for my current project but I realised that it isn't compatible with Spine animated sprites. It's extremely important for me to make them work together because I'm making extensive use of Spine sprites for this project. Do you know if there's a way to achieve that?
Thank you for your patience!
It’s trivial: just apply a blend shader to the material of the sprite atlas.
Here is a brief tutorial:
Like this, you can also use blend effect with any generic renderers. More info about the feature in the docs: https://goo.gl/tSAmB7 (look for the “Using custom blend materials” section).
Thank you for your answer. It was my fault, I was using an old version of the Spine runtimes. I've updated them and now it works perfectly!
when i use the any of the 3 rendering modes on the ipad air2 ios 9 it give me weird results how can i fix them on image component
Hello, I've just replied you by email, but feel free to post here, if you wish.
thanks for the great and fast support i hope you will help me figure out the issue
@Elringus please help me.
In this image I'm using color dodge blend effect. But the result is not the same as obtains in Photoshop (The example below was done in photoshop, the example above was assembled with the Blend Effect in Unity).
I'm using this button on a video in a RawImage using the UI Unity. And the Color Dodge is very dark.
I can reproduce the effect created in photoshop somehow?
I can only see one image in your message (apparently the one from Unity). Could you please provide the second one, from PS? Also, please check tint color of the Image in Unity (it affects the resulting look).
@Elringus both buttons are in the same image, the bottom button I exported with background from PS and the other I created on unity and positioned above to compare. The triangles are separated PNG with white Tint.
Oh, I see now. So, if I understand correctly, the problem is with the 2 little triangles inside the big one? Are they done as separate images? If that’s the case, then it looks like each of them is using color dodge blend mode in PS. Please check that in Unity a Blend Mode Effect component is attached to each of them and that the render mode is set to Grab (not Unified Grab).
Blend Modes looks like a great asset. Does it already/ do you plan to support the "Color" blend mode (which blends hue and saturation but not luminosity) ?
Hi, I’ve researched the component blend modes a bit (Hue, Saturation, Color, Luminosity) and looks like it won’t be too hard to implement them. Will probably add this for the next update. Thanks for the suggestion!
@Elringus That would be amazing! Do you have an idea of when that might be?
In a couple of weeks, I think.
I will buy two copies if you do
Just to clarify ... Blend Modes works for meshes, but not skinned meshes, right?
Actually, it works nearly for any objects via custom material editor. You may create a blend material with desired blend mode and assign it just as any other materials to a skinned mesh or other renderers.
Hi @Elringus! This asset is great, but I'm currently running into a problem.
It seems that whenever an image is using a blend mode it gets rendered in front of everything else. The first screenshot shows the desired effect: The My Fighters button is behind the top bar. The second screenshot shows the My Quests button, which is using a blend mode. When blend modes are enabled the My Quests button is always rendered on top of all of the other UI elements.
Is there any way around this?
Hi, I’ve tried to reproduce the issue but it worked ok in my case:
There I have a square and a circle images in a canvas. Square is placed at Z = 0 with a blend mode effect attached and circle is placed at Z = 10 without a blend mode. As you can see, the square is not rendering “through” the circle.
Make sure that you are using either Grab of Framebuffer render modes, as the Unified Grab could potentially lead to this kind of problems.
If the problem persists, please contact me by email with a more detailed setup info or a repro project.
Version 2.3 with 4 new blend modes (hue, saturation, color, luminosity) and an enhanced editor is now pending review on the store.
As usually, if you've already purchased the plugin, you may download the new version right away here: https://get-asset.appspot.com/BlendModes
Hoping you can help. I'm getting some intermittent errors using Version 2.3 of Blend Modes on Unity 5.3.2. I tried installing the latest Unity Patch, but it hasn't solved it.
Sometimes the shader seems to be displaying correctly in the editor, but most of the time I get visual errors, and occasionally a logged error in the console.
GLSL Compilation Failed:
ERROR: 0:50: '&&' does not operate on 'bvec2' and 'bvec2'
I’ve just ran several tests on Unity 5.3.2, but wasn’t able to reproduce the issue you’ve described. Please try to re-download and reimport the package (sometimes they got corrupted). Also make sure that it’s not something project specific (does this issue occurs in a clean project?).
If the problems persists, please contact me via email with a more detailed info (like what OS you are using, scene setup, steps to reproduce the issue, etc). A simple repro project would also be of great help.
I have been using the plugin for a while but recently when I came back to it seems to have stopped working.
I used to be able to make multiple layers of UI Image in a canvas and use the blendmode component to blend them all into each other, it seems to only work on certain layers and doesn't behave like it used to.
this seems to have stopped working - I have updated to the new plugin, grab mode and am using unity 5.3 of 4 personal
If that happened after the update, try to delete the package from the affected project and reimport it. Also, make sure you are using Grab or Framebuffer render modes (not Unified Grab) in case you want multiple layers to blend with each other.
If the above won’t help, please contact me via support email with a more detailed info (scene setup, screenshots, any error messages you may see in the console) and I will assist you further.
Does anyone know if BlendModes is supported on PlayStation 4?
Haven't tested it on the dev kit yet, but I don't think there's anything in the shader that wouldn't be supported.
In theory, it should work ok, as I’m not using anything special or platform-specific in the shaders.
Please let me know if something will go wrong with it — I will be happy to assist.
How do I do Add blend mode?
I see Subtract, but no Add...
Hi, please use the Linear Dodge mode -- it has the same effect as Additive or Add.
We want to use your plugin for our new game, but our game is for mobile devices. I read that plugin uses framebuffer extension for performance on mobile. We'll probably use 2 or 3 layers (full screen png sprite) for blending and performance is very important thing for our game (for example, 20/25 FPS will cause some problems for the player). We'll support iOS 7.1+, so there is no problem for iOS devices; but on the Android side, I'm not sure which devices supports framebuffer extension (yeah, Tegras, but I don't have any list for all the devices). Is there any way to detect framebuffer extension? So that way, if there is no support on the device, we can use grab or unified grab render mode for fallback (idk which one has more performance on mobile). Or, maybe, not to use blend mode (disabling layer gameobjects) at all, if there is no framebuffer extension.
There is actually a way to detect whether the framebuffer_fetch is available, but only inside shaders. Adding this:
#pragma only_renderers framebufferfetch
Right at the start of the CGPROGRAM block will trigger shader fallback if the instruction is not supported. You may then add a fallback to the desired shader which it will use in that case:
This way, devices which supports framebuffer_fetch will use it and all the other will stick with UnifiedGrab mode.
I’m currently working to integrate this functionality to the plugin, so it will be more user-friendly, but meanwhile you may just send me a request and I will modify the shaders to suite your needs.
Wow, that's great! So, will be so much impact on the performance, if we use unified grab for fallback with 2-3 full screen layers? I'll send you a request for this, as soon as we purchase and integrate your plugin to our game. Thank you
The impact will depend on the device, but it should be OK for the most mid-high end ones.
You may try this WebGL demo to test performance: http://elringus.me/static/blend-modes-webgl/ Just be aware that webgl adds quite an overhead so it will work faster in native environment.
I´m having trouble getting the FrameBuffer (MeshDefault) shader working on iOS. When i run it on the device I get the following error message in the log output and it fallbacks to the regular diffuse shader:
(Filename: Line: 649)
Note: Creation of internal variant of shader 'BlendModes/MeshDefault/Framebuffer' failed.
Setting up 1 worker threads for Enlighten.
-------- GLSL link error: ERROR: Input of fragment shader 'vs_COLOR1' not written by vertex shader
Any idea of how to fix this? SpriteDefault Framebuffer works as expected though. I´m on unity 5.3.4 and using openGL 3.0 on iOS.