- Home /
Shader Graph - How to draw Circle?
Expecting circle as output. What's wrong with this setup?
Answer by tuinal · Jul 20, 2020 at 04:40 PM
-1^2 = 1^2 = 1. You're losing the sign when you square a negative value, so everything is getting translated to the top right corner. I think using multiply with value x Abs(value) would work.
You shouldn't need the abs() (in fact, wouldn't that make it wrong?), just multiply the value with itself. The problem is not that the sign is lost (that's intentional, distances are always positive) but that pow() is not defined for negative values at all (because it can also be used with non-integer exponents, which gives non-real results when used with a negative base).
Alternatively you could also use the dot product on the whole vector, that might be even faster and easier to read.