Why don't use a constant instead of Clamp here?

I’m learning Unreal Engine and I’m very confuse why clamp is used here:

I think Clamp always will return 2. Why don’t use a constant instead of ViewSize to Ceil to Clamp?

Why are they using Clamp when it always returns 2?

You can find the complete material [here][2].

i don’t know much about clamp but i guess
clamp is used to make the value come between the value( 2-1 in this case) the value can be 20 or 30 but clamp helps to get the value between 1 and 2 in this case, i don’t know much about view size but it’s an input value which can be anything (even 30 or -0.1) so to get that to be what we want we use clamp

I’m fairly positive after looking at this that they intended to use a normalize to range here. ViewSize gives a 2Vec, so unless ViewSize-Ceil has a weird interaction under the hood, there is no reason to ceil-clamp here (as far as I can tell).

ceil and view size

just tried it :

high value i guess.

try it yourself if you are interested (could be useful to me, maybe to you as well?)

Yes, it is very strange and confusing.

Yes, I’ve been trying it and it always returns 2.

are you using clamp? well the value is high so it will use the highest possible i guess.

as you can see in my answer without clamp the result is …high

Thanks, but your answer doesn’t help much. That is obvious.

Agreed, with a non normalized value it will always be 2 unless the ViewSize is 1x1 or less.

Doesn’t make any sense, probably a mistake on their part.

The value will always be 2 unless the ViewSize is less than or equal to 1x1, which doesn’t make any sense. It must be a mistake, I cant think of any reason why you would want to do that.

As nnerl1n mentioned above, they were likely meaning to use a Normalize node between the ViewSize and Ceil but forgot to add it. This way makes a little bit more sense, but is still an odd way of finding a multiplier for line thickness.

Either use a normalize or just a constant, or even ignore all of it and double the input scalar value. =)

agreed .

Thanks. So, I can use my common sense with Unreal. I was thinking that there was a hidden reason to use those three nodes.