How can I create an emboss effect in Blender and set the angle and height. This node doesn't exist in Blender.
This effect is popular to convert a normal map into a curvature map.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
Creation of the emboss filter effect
Blender has no emboss effect node, you have to recreate it, hopefully this effect will be available in the future into one node.
An emboss effect basically duplicates an image in two directions defined by an angle direction, one of the two images has his colors inverted. From 0/(-)180 the direction is only horizontal, from 90/-90 it is noly vertical. If the angle is set to the left with for example 95 the horizontal images are inverted, if it's at the bottom like -20 the vertical images are inverted.
The emboss takes three inputs:
To better understand how the angle works, it will define a multiplier for the X and Y direction:
So here is the node setup to achieve the emboss effect, you can download the node setup here: https://drive.google.com/file/d/18BIzLtwe_27HdtuB2ZZ_lfYCcq3Ym4Qv/view?usp=sharing
The node setup starts the three inputs above. The image is set in black and white and one is inverted.
For the Angle it is converted into a radians in order to works for the value is multiplied by Pi: 3.14159265359 then divided by 180. To define the direction multiplier the X value uses Cosine (the second value doesn't matter, it has no effect) and the Y value uses Sine.
The height is divided by two, because to have a separation of 50 pixels for example you need to move at 25 pixels in each direction. The value is multiplied by the direction multiplier then the X is plugged to the X input of a Translate or Transform node and the Y to the Y input.
The non-inverted image colors must have is translation values inverted and for the inverted image colors the translation values aren't inverted. In the node setup above the top translation has the image inverted and the bottom has the values inverted.
Finally both images are combined with a Mix or Value node at 0.5.
A Gamma node at 2.2 can be added after it to convert the image in Linear like the generated emboss effect of Photoshop. Keep it in sRGB (without the gamma node) to work on it with gradient colors or to overlay it.
What can you do with the Emboss effects?
Almost every game artists use the Emboss to generate a curvature map from a normal map. On a normal map the Red channel creates lighting coming from the right, so with an emboss at 0 degree and height generally of 1 to have 1 pixel width (Substance Painter's curvature use an height of 8) overlayed with the green channel with an angle at 90 degrees and the same height as the red you can generate a curvature map. Don't forget to set your normal as Linear in the "n" menu to convert the image in sRGB to get a correct result: