DirectionalMap
Overview
DirectionalMap blends colors based on alignment of the surface normal and a specified “prime direction.”
This is useful for view-dependent effects or physical phenomena like dust accumulating atop surfaces.
Note that DirectionalMap cannot know about downstream normal mapping; you must connect relevant normal maps to this node.
![prime direction: axis of object](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/scene1.jpg)
![prime direction: observer](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/scene2.jpg)
![prime direction: look-at object](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/scene3.jpg)
Attribute Reference
Adjustment attributes
bias
Float bindable
default: 0.5
controls the rate at which the effect increases as the shading normal approaches the prime direction
clamping_behavior
Int enum
0 = “clamp” (default)
1 = “absolute”
determines how surfaces facing opposite the prime direction are handled
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/clamping_0.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/clamping_1.jpg)
falloff_type
Int enum
0 = “cosine” (default)
1 = “linear”
determines how the effect falls off as the difference angle increases
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/falloff_cosine.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/falloff_linear.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/falloff_plot.png)
smoothstep_end
Float bindable
default: 0.55
the value at which the effect is considered 100% on
smoothstep_start
Float bindable
default: 0.45
the value at which the effect is considered 100% off
use_smoothstep
Bool
default: False
apply smoothstep function to result
Normal attributes
input_normal
NormalMap
default: None
specifies an alternate shading normal when bound. The binding multiplier is ignored
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/normal_mapping_0.jpg)
input_normal_dial
Float bindable
default: 1.0
controls the amount of influence of the alternate normal
General attributes
color_a
Rgb bindable
default: [ 0, 0, 0 ]
the color of the effect when the difference angle is greatest
color_b
Rgb bindable
default: [ 1, 1, 1 ]
the color of the effect when the difference angle is smallest
custom_direction
Vec3f bindable
default: [ 0, 1, 0 ]
specifies a custom direction in world space as the prime direction
object
Node
default: None
the object to use when 'prime direction' is set to 'axis of object' or 'look-at object'
object_axis
Int enum
0 = “+X axis”
1 = “-X axis” (default)
2 = “+Y axis”
3 = “-Y axis”
4 = “+Z axis”
5 = “-Z axis”
which axis to use when 'prime direction' is set to 'axis of object'
polarity
Int enum
0 = “perpendicular” (default)
1 = “parallel”
determines which directions are given color A and which are given color B. Switching this effectively swaps the colors
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/polarity_parallel.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/polarity_perpendicular.jpg)
prime_direction
Int enum
0 = “observer direction” (default)
1 = “custom direction”
2 = “axis of object”
3 = “look-at object”
which source is used for the prime direction
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/prime_source_0.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/prime_source_1.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/prime_source_2.jpg)
![](https://docs.openmoonray.org/assets/images/user-reference/scene-objects/maps/DirectionalMap/prime_source_3.jpg)
use_reference_space
Bool
default: False
use reference space position and normals