Query Mask Clip value within the shader

Node-based Shader Editor

Query Mask Clip value within the shader

Postby sethhall » Sat Sep 22, 2018 11:58 pm

Hi,

I'm working some Opacity Mask stuff and am trying to use the Mask Clip parameter. When I plug a node into the Shader.OpacityMask attribute I see that the 'Mask Clip Value' parameter shows up in the Inspector.

Is there any way to query that parameter? There is the 'Template Parameter' node but unlike teh Particle Texture, I can't use it to template the Mask Clip. That being said, is there any way to access this value within the shader itself?

Thanks,

Seth
sethhall
 
Posts: 20
Joined: Mon Jun 25, 2018 11:09 pm

Re: Query Mask Clip value within the shader

Postby Amplify_Borba » Mon Sep 24, 2018 10:05 am

Hello Seth!

The Template Parameter node is only meant to be used within templates, to access shader properties and global variables declared over the current template shader.

In the Surface shader, you can either create a Float property with its Property Name set according to the shader property you want to access, the Type set to 'Global' and the Variable Mode to 'Fetch', as per the example below:

Image

Or you can configure the Mask Clip Value by a custom shader property, which will allow you to access its value through the node you set up for this effect:

Image

Please let me know if this helps, 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: Query Mask Clip value within the shader

Postby sethhall » Tue Sep 25, 2018 12:22 am

Ahhh! Perfect. This is exactly what I was looking for :D .. Thank you.

Seth
sethhall
 
Posts: 20
Joined: Mon Jun 25, 2018 11:09 pm

Re: Query Mask Clip value within the shader

Postby Amplify_Borba » Tue Sep 25, 2018 7:38 am

Glad to know, please don't hesitate to get back in touch if you have any further questions, 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: Query Mask Clip value within the shader

Postby sethhall » Sat Jan 26, 2019 5:42 pm

I am still struggling a bit with properly driving the Mask Clip Value to suit my needs. I have tried to parameterize it via the instructions above but I need the ability do reference a variable in these slots instead of just properties.

https://drive.google.com/open?id=19od3DoIU3DPQBfGeMEXXQ5oTV0CgIE-M

These slots where I can override what is currently here, is it possible to reference shader variables?

Seth
sethhall
 
Posts: 20
Joined: Mon Jun 25, 2018 11:09 pm

Re: Query Mask Clip value within the shader

Postby Amplify_Borba » Tue Jan 29, 2019 10:41 am

I don't think I fully understood the issue but, according to the screenshot, you're currently using inline properties in the Z Offset and you should follow that same procedure for the Mask Clip Value.

Do note that the clip is done when the Alpha minus the Mask Clip Value is less than or equal to 0.
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 25 guests