How do I create a rainbow-colored light shaft?

https://blueprintue.com/blueprint/k84nvhda/
https://blueprintue.com/blueprint/78xfusts/


I want to create a light shaft like the one in the first image.

[Currently Achieved]

  • Dynamically rotate the shaft using Blueprint so that it roughly tracks the sun displayed in CelestialVaultDay.
  • Using a vector pointing toward the sun (SunDir) and the player camera’s GetForwardVector, I create a rainbow-like color change when viewed from the side of the shaft by using their dot product (second image).

[What I Want to Achieve]
At angles similar to looking directly at the sun, the dot product becomes 1, so the shaft appears mostly red. However, I want the light shaft to be colored even at such angles. (third image)

Could you give me some advice?

Currently, I’ve managed to get a realistic look by moving the base of the shaft forward and downward from the character, but I’d like to know if there’s a better way.

Also, I thought I could follow the position of the sun by getting the SunLightComponent in CelestialVaultDay and using GetForwardVector(target:[SunLightComponent]), but the tip of the shaft is slightly misaligned. I’d like to know a solution to this as well.