I am making a material for a sky sphere and I am creating a mask of the stars in a particular part of the sky. To do this I am trying to make use of the length node, to do what it says it should, but it produces a very strange result. The VectorLength node on the other hand works as intended.
This is what the VectorLength node produces which is exactly what is desired:
This behavior is extremely bizarre and my attempts to get Length working through clamping and maxing have not had an effect. Anyone have an explanation of this?
In any case, you have to feed it a vector 3. You can’t have the length of a float, which is what you currently have.
The graph off to the left is a vec3 so a vec3 goes into VectorLength. Unless the Max node somehow casts to a float and takes the max of each value of the vec3? That would be a strange implementation of Max and I assumed Max is the same as in glsl (as well as clamp). It would be nice to be able to see what exactly is going on under the hood of Length though.
Length is happy to work with a scalar, v2, v3 and v4. Vector Length only works with v2 & v3. You can debug both nodes but they should return identical values in OP’s example - a vector whose every component has the same scalar value (length).
So yeah, the result is unexpected (to me, at least).