this patch adds a refract operator to the vector math node
@james egien (cubic_sloth) Check your white space and code is formatted properly. Use clang in your ide if you can.
For code reviewers: Could you also consider the node label patch D6375 if possible? This would mean that the scale float socket could be reused for eta and other functions added in the future.
Please also provide an example for how this math function can be used in practice.
The formatting is not yet fixed in various places. Please run make format to format all c/c++ files correctly.
Afaik, you have to fix the formatting in osl files manually.
Rename Eta to IOR, for consistency with shading nodes.
Change scale to param1 and use it for both scale and eta, to avoid any performance impact.
Don't compute this for every math operation, only refraction.
Use defaults and min/max range similar to IOR in BSDF nodes.
This seems ok now, but needs to be updated after D6375: Nodes: Add dynamic label support for Math Nodes, so it doesn't add a new socket but rather just changes the label dynamically based on the type of operation.