Sprite rect transform

Node-based Shader Editor

Sprite rect transform

Postby aroig_gsn » Thu Apr 19, 2018 10:17 am

Hey there! me once again

I was wondering, is there a way to access a sprite's rect transform from a node or something? Its because we're using a UI shader to project a second texture on each sprite (color dodge blend mode for shining effects). And it works perfectly until you pack the UI sprites on atlases, then the second texture ends up being projected on top of the whole atlas, not each individual sprite.

Any workaround?

thanks!
aroig_gsn
 
Posts: 6
Joined: Mon Mar 05, 2018 11:19 am

Re: Sprite rect transform

Postby Amplify_Borba » Thu Apr 19, 2018 11:05 am

Hey there!

Apologies but I'm not sure I fully understand what you're trying to achieve, would it be possible for you to send us a sample project with the issue present in order for me to best help you? Feel free to send it via [email protected], 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

Re: Sprite rect transform

Postby aroig_gsn » Fri Apr 20, 2018 9:59 am

Just sent it ! Thank you for your assistance!
aroig_gsn
 
Posts: 6
Joined: Mon Mar 05, 2018 11:19 am

Re: Sprite rect transform

Postby Ricardo Teixeira » Fri Apr 20, 2018 3:20 pm

aroig_gsn wrote:Just sent it ! Thank you for your assistance!


Thank you for the sample, we really appreciate it.

Unfortunately, due to the way Unity handles this type of specific use, you'll have to use an additional script to properly overlay the numbered texture. We actually included a sample that you can use as a starting point, be sure to check the SpritesMask scene.

I took the liberty of adjusting your sample, please check the attached file.

You'll have to pass and adjust a custom set of UV's using the script included(copy>pasted the node network from our sample); the included script must also be added to the asset using it.

Image

Be sure to press Play if the effect is not initially displayed correctly.


Thanks!
Attachments
AtlasOverlay.zip
(990.31 KiB) Downloaded 131 times
Sales & 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
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests