How do I convert Vertex Position into normalized values?

Node-based Shader Editor

How do I convert Vertex Position into normalized values?

Postby dyangca » Tue Mar 19, 2019 10:31 pm

Hi, my first post, apologies if this has been answered before but I couldn't find it via search. I am loving learning ASE so far, but ran into a hurdle.

I am trying to make a simple dissolve shader, and I'd like a slider (float, min 0, max 1) to determine the extend of the effect. I am using Vertex Position node to get local vertex info, so for example if a cube is 5 units tall, then I'd have to input 2.5 into the slider to dissolve the whole thing.

I'd like to get normalized vertex positions regardless of the scale of the object, so I can just slide the slider from 0 to 1 to get it from completely dissolved to completely visible. So my question is how do you manipulate the Vertex Position so that it's always between 0 and 1?

thanks!
dyangca
 
Posts: 3
Joined: Mon Mar 11, 2019 4:26 pm

Re: How do I convert Vertex Position into normalized values?

Postby Amplify_Borba » Wed Mar 20, 2019 10:25 am

Hello, thank you for getting in touch and for your support!

I recommend trying out the Remap node, and you can also check out our DissolveBurn sample as it makes use of this node to a similar extent.
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: How do I convert Vertex Position into normalized values?

Postby dyangca » Thu Mar 21, 2019 5:25 pm

https://imgur.com/a/6St9kzW

Thanks for the reply. I've played around with the remap node but couldn't quite figure out exactly how to implement it. I think I get the gist of how it works but not sure how to feed the min/max value properly. Please take a look at my set up in the pic.

The end result I'd like is to dissolve something that's 1 unit tall or 100 units tall by sliding the slider from 0 to 1.
thanks
dyangca
 
Posts: 3
Joined: Mon Mar 11, 2019 4:26 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 4 guests

cron