I was eager to use the new AtmosphericLightVector material node to get rid of a material parameter collection that I used to retrieve the directional light direction in my materials, but as soon as I plugged it in I started getting strange results. After some tests I realized that the AtmosphericLightVector material node returns a vector which is actually the opposite of the light direction.
To reproduce the issue just create a new level, drop a directional light in it and check the “Atmosphere Sun Light” property. Then create a new material and assign it to a mesh in the map, like in the screenshot below. On the left you can see the directional light oriented towards [1, 0, 0], while on the right you can see that the vector returned by AtmosphericLightVector is [-1, 0, 0].
I don’t know if it’s supposed to work this way by design, and if it is please bear with me, but it feels a bit puzzling having to multiply the vector by -1 to actually get the direction of the light.
A minor issue that I also would like to point out in the current implementation is that a zero vector is returned from the node when previewing the material in the material editor. Previewing the material this way is a pain and much harder than it was with the material parameter collection approach where a default test value could be set. A much more useful approach would be to return the direction of the light in the material preview viewport, so that changes to light direction could be previewed in real time.
I really like the new node and was hoping to finally get rid of the verbose material collection parameter approach, but as of now it feels a bit unpolished and unnecessarily hard to use.
Thanks.