Page MenuHome

Nodes: Add Refract and Faceforward functions to Vector Maths nodes
ClosedPublic

Authored by Charlie Jolly (charlie) on Mar 5 2021, 12:49 AM.

Details

Summary

Nodes: Add Refract and Faceforward functions to Vector Maths nodes

Cycles, Eevee, OSL, Geo, Attribute

Based on outdated refract patch D6619 by @james egien (cubic_sloth)

I picked up the old patch assuming it was acceptable due to Brecht's code review.

refract and faceforward are standard functions in GLSL, OSL and Godot shader languages.
Adding these functions provides Blender shader artists access to these standard functions.

GLSL:
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/refract.xhtml
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/faceforward.xhtml

See: https://asawicki.info/news_1301_reflect_and_refract_functions.html

Diff Detail

Repository
rB Blender
Branch
arcpatch-D10622 (branched from master)
Build Status
Buildable 13618
Build 13618: arc lint + arc unit

Event Timeline

Charlie Jolly (charlie) requested review of this revision.Mar 5 2021, 12:49 AM
Charlie Jolly (charlie) created this revision.

Adding the same reviewers that were on the unfinished patch this is based on.

Hans Goudey (HooglyBoogly) requested changes to this revision.Mar 8 2021, 9:44 PM

I'm going to request changes based on this comment by Jacques on the original patch:

Please also provide an example for how this math function can be used in practice.

This revision now requires changes to proceed.Mar 8 2021, 9:44 PM

I picked up the old patch assuming it was acceptable due to Brecht's code review.

refract is a standard function in both GLSL and OSL shader languages. It is available in Godot. Adding this to Blender shader nodes provides this as a complementary function to reflect and gives shader artists access to this standard function.

See: https://asawicki.info/news_1301_reflect_and_refract_functions.html

GLSL: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/refract.xhtml

Okay, thanks. That information should be part of the patch description so it can become a commit message when that time comes.

This revision now requires review to proceed.Mar 8 2021, 10:39 PM
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)Mar 8 2021, 10:55 PM

Add Faceforward which should now complete the Vector Math functions

Charlie Jolly (charlie) edited the summary of this revision. (Show Details)Mar 19 2021, 8:24 PM
Charlie Jolly (charlie) retitled this revision from Nodes: Add Refract function to Vector Maths nodes to Nodes: Add Refract and Faceforward functions to Vector Maths nodes.
This revision is now accepted and ready to land.Mar 22 2021, 2:29 PM