Emission masking not working on Android device

Node-based Shader Editor

Emission masking not working on Android device

Postby TripleOneGames » Thu Dec 21, 2017 9:04 am

I'm currently testing on the Samsung Galaxy S5. Unfortunately, it's all I have to test. When attempting to mask emission with a gradient, it doesn't work, but it does work on PC and iOS.

Example:

Image

The bottom image is how it appears on the Android device.

I'm basically using lerp from 1 to 0 from a point in world space to mask the emission. I'm using the same technique to create a color gradient in the albedo color, however, the albedo gradient works fine on the Android device.

Here is how my shader is set up:

Image

My guess is the gpu on that device, simply can't handle emission masking. I can say without a doubt that it's not an issue with the values, as the same values work for the albedo gradient. I'm hoping there is something I'm missing, or there is some kind of workaround I'm not thinking of. If not it's no biggie. Any help or tips is appreciated.
TripleOneGames
 
Posts: 6
Joined: Mon Dec 11, 2017 3:57 am

Re: Emission masking not working on Android device

Postby Amplify_Borba » Thu Dec 21, 2017 12:04 pm

Hello, thank you for taking the time to report this issue!

We're going to need a few more details in order to best help you out with this situation.

What is the target graphics API you're using, Open GL ES 2.0 or 3.0?

What Android version did you build for?

Also, would you be able to provide us with a shader sample as a Unity package with textures and any custom functions you might have so that we can debug it on our side?

Looking forward to your reply!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Emission masking not working on Android device

Postby TripleOneGames » Thu Dec 21, 2017 2:00 pm

Sure thing!

I'm using:

GLES 3.0 and Vulcan (have both on the graphics API list)
Minimum Android version 6.0
Targeting Android version 7.1

Here is my shader:

VertexCollapse.rar
(3.78 KiB) Downloaded 104 times


I'm not using any textures or custom functions with this one. Thanks!
TripleOneGames
 
Posts: 6
Joined: Mon Dec 11, 2017 3:57 am

Re: Emission masking not working on Android device

Postby Amplify_Borba » Thu Dec 21, 2017 2:16 pm

Thank for sharing the shader together with the additional details.

One additional request, would you please remove Vulcan from the list and force GL 3.0, and report back with your findings?

We'll proceed to register your issue, however, the developer for this asset is going to take some time off for the holidays so we might only be able to get back to you next year, apologies for any inconvenience caused.

Thanks in advance!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Emission masking not working on Android device

Postby TripleOneGames » Thu Dec 21, 2017 4:17 pm

No worries. There's no rush. I can always patch it in at a later if need be. I did try with only the GLES 3.0, and unfortunately, same result. Thanks for trying help anyways. I'll check back later. Even if it's not resolved in the end, I still feel this is a 5 star asset and have left a 5 star review on the asset store. Cheers, and happy holidays!
TripleOneGames
 
Posts: 6
Joined: Mon Dec 11, 2017 3:57 am

Re: Emission masking not working on Android device

Postby Amplify_Borba » Fri Dec 22, 2017 12:21 pm

TripleOneGames wrote:No worries. There's no rush. I can always patch it in at a later if need be. I did try with only the GLES 3.0, and unfortunately, same result. Thanks for trying help anyways. I'll check back later. Even if it's not resolved in the end, I still feel this is a 5 star asset and have left a 5 star review on the asset store. Cheers, and happy holidays!


Thank you for reporting back and for your understanding, we'll get back to you as soon as possible on this matter.

We hope you have a Merry Christmas and a Happy New Year!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Emission masking not working on Android device

Postby Amplify_Borba » Wed Jan 03, 2018 6:20 pm

TripleOneGames wrote:No worries. There's no rush. I can always patch it in at a later if need be. I did try with only the GLES 3.0, and unfortunately, same result. Thanks for trying help anyways. I'll check back later. Even if it's not resolved in the end, I still feel this is a 5 star asset and have left a 5 star review on the asset store. Cheers, and happy holidays!


Hello, hope you've had a good time during the holidays and new year celebrations!

Regarding the issue you've reported, after extensive tests we found a way to solve your problem but not exactly the root of the issue.

Everything indicates to be an issue from Unity that we can neither track nor know for sure why it's happening. It only happens when you have a "lerp" operation that uses a property value in some fashion. If that dependency happens the value from the lerp gets outside of the range provided from the input values, and starts to get negative or inverted. Since The "HSVtoRGB" node uses a lerp at the end and it's input parameter for the "value" is a property it's destroying your effect.

We also found that this does not happen in GLES 2.0 which further indicates that the issue stems from Unity. Even the compiled assembly code from the shader looks fine and even if you use a global property like _SinTime the problems still occurs.

Since you need both GLES3.0 and VULKAN we tried to come up with a solution and the best so far was to either convert the property value into a constant or to add a saturate operation after the "HSVtoRGB" node (which contains the lerp).

NodeSetup.png
NodeSetup.png (141.17 KiB) Viewed 2448 times


We'll dig a bit further and most likely open up a bug report in Unity issue tracker, thank you once more for reporting this and don't hesitate to get back in touch if you come across any other issues!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Emission masking not working on Android device

Postby TripleOneGames » Mon Apr 09, 2018 10:55 pm

Sorry for the delay guys. I got busy with another project. I was able to test this workaround and test on Android and it does work! Thanks again for your time and help with this issue.
TripleOneGames
 
Posts: 6
Joined: Mon Dec 11, 2017 3:57 am

Re: Emission masking not working on Android device

Postby Amplify_Borba » Tue Apr 10, 2018 9:59 am

No problem, thank you so much for confirming that the workaround did work out for you!

Please let us know if you come across any further issues, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests