Can we Use HDR images like a sun to receive shadows or even to replace directional light (Sun)?

Hi all,

Is there a way to get shadows from HDR images like a Directional light/Sun?
Maybe there is a way to use a HDR image and not use a sun at all? Or maybe link the HDR image and the sun together some how?

For example, when using Corona in 3Ds Max, you can light the entire scene with a simple HDR image without the use of any other lights. You also get accurate shadows, and by that I don’t mean ambient shadows, but accurate directional shadows.

Is there a way to achieve something similar in Unreal Engine 4?

Many Thanks.

HDR image can contain unlimited amount of bright spots so you can’t use directional shadows. Proper shadows would need raytracing. If you know that your HDR image contain just one sun then it would be easiest to just add single directional light to scene.

Thanks for answering. But if my HDR did only have 1 bright spot for the sun, then could I get that to cast directional shadows without a directional light/sun? For example, I could get the shadows from the HDR and based on the rotation of the HDR the shadows would also turn?

There’s a thread somewhere in the Architecture forum on how to use HDRI for lighting.

It wont work like that. In HDR cubemap every pixel is light source and not only bright ones. For correct shadowing you would need to raycast to every pixel. But for performance reasons this is not possible. If you use that HDR image as static sky light you can build quite accurate shadowing but even then the HDR image is first converted to low order spherical harmonics so lighting and shadowing will be quite soft.