Page 1 of 1

How do I convert Vertex Position into normalized values?

PostPosted: Tue Mar 19, 2019 10:31 pm
by dyangca
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!

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

PostPosted: Wed Mar 20, 2019 10:25 am
by Amplify_Borba
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.

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

PostPosted: Thu Mar 21, 2019 5:25 pm
by dyangca
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