Closed OwenTheProgrammer closed 3 weeks ago
Ah, for safety of the xy components not being within the ranges and out of bounds like NaN values, I'll change the topic to request normalization as an option
http://paste.amplify.pt/view/raw/ad521618 --- add function switch to make option --- set default as included for backward compatible --- added sticky notes
I agree the normalization should be optional. However, we need to keep in ON by default to ensure backwards compatibility.
Just a note about the proof: we can't ensure the inputs are normalized, and often they aren't (e.g. sampling normal maps), so normalization is sometimes necessary.
This is a very quick change, so I moved it up to v1.9.7.
Because of the way this function is structured, we can guarantee the length of the resulting vector will be 1 unit in length, thus normalized. This will not be recognized by the compiler, meaning the normalization will not be optimized away automatically.
Math Proof
Shader Assembly Difference
This removes 3 shader instructions for free
This will also put this node ahead of SG in terms of performance, as they also implement it the same way