Workaround- how to substitute HDRI by lamps (EEVEE)

When we use HDRI in EEVEE we will see light leaks or reflections that supposed not to be there, and so we use best lamps / lights. But lamps look quite sterile and HDRI’s give natural light with one click (if you have an asset manager).

So I thought about a workaround to get my light so that is comes as close as possible to an HDRI. Pretty sure we need sunlights because, like in an HDRI, the position of the sun doesn’t matter ( except something with shadowmaps, i’ve read).

EEVEE can handle 8 sunlights. Now I want to get values from the HDRI somehow and use those values for the sunlights.

Any idea how I get an approximation of the HDRI with 8 sunlights (qua color / lightstrength / direction) ?

There is a programm called smartIBL which converts hdri to lamps. AFAIK there is no importer for Blender, though, only for a bunch of other 3d apps.

The way I undrestand it license wise anyone can port it over to Blender, though. So if you know how to Python you might be able to to do it:

1 Like

Thanks, I will check if smartIBL has some tools I can use. Most important for me it getting an idea how to set colours and values. I did an experiment with 8 suns, see below in a minute.

Experiment with 8 sun lamps in a circle pointing inwards. Used two empties. One empty to contraint the rotation of the suns (damped track). And another empty as parent to rotate the suns. I’ve set one sun (Sun) quite strong and the other suns way lower (sky).
Then I got a big cube with quite some colours and that is for baking the indirect light (so there is no black sky between the suns which is odd. Cube is scaled to outside of the sun circle.
This is a result:

Ah, sorry, I remebered incorrectly. It´s been a while since I dealt with sibl.
It appears that it was not sibl which created a light rig from an hdri but a Lightwave script called Lightbitch by the same developer:

Ah yes, that looks like the tool I need.

Update: ahw, seems it’s a pluging for Light Wave.

If you want a little light reading on the subject (pun intended), check out this paper on how to slice up an hdri probe into individual lights:

It’s some early Paul Debevec work, He practically invented hdr imaging and rendering, so he would be the best source of info.

1 Like

Ah that is super, maybe a bit technical for me, but it will surely help diving into this matter. I see there is a LightGen Plugin for HDRShop, which is free for non-commerical and academic use. Maybe we can use that.

Ouch…. the eight sunlights gave an HDRI-ish look, but it was not a succes because they are harder to handle light leaks it seams:

For example, See the reflection on the floor on the left.

Used settings:

  • Bias: 0.001
  • Bleed Bias: 0.5

Contact shadows;

  • Distance; 0.2
  • Softness: 0.2
  • Bias : 0.9
  • Thickness: 0.2

Scene - Shadows:
Method; VSM
Cube Size: 1024 px
Cascade Size: 1024 px
High Bitdepth: on
Soft shadows: on
Light Treshold: 0.01

Also, it takes now 12 seconds to render this scene on 720p, 12 seconds per frame. Probably because there are 8 sunlights. Often I render 720p in 3 or 4 seconds. Using GTX 1080 TI.

I have here a Blend-file in case some one wants to look at it;!AqmgMdon3tl6kioOzWtPJnz1gWsX

I turned of the lights from view (not from render) so you could see reflections that don’t belong there like under tables.

Instead of sunlight I tried out spotlights in a circle (There is one point-light more);

Still quite a work to set all lights properly and rendertime increases the more lights you have.

What do you think, do you see odd reflections and does it look HDRI-ish to you with these spotlights?

I have no idea how this will work out, but what if you use a rough glossy to kind of create an occluder which then drives a hdri lookup map which you simply emission add to the rest? Reflection coords to drive the hdri, maybe some inverted axis, with shader2rgb for the occluder creation.

Requires two passes, one to create the occluder mapped back as screen coordinates in the second pass.

This is kind of a trick I’ve used in the past (not Blender) to blend close real reflections with a lookup hdri if the distance to ray hit became large (smooth gradient). We had direct control over traced rays, but in Cycles this isn’t possible. In Eevee we don’t have any rays at all, but you may be able to pull some tricks with the shader2rgb.

This is all theory in my head, I have no idea if I would be able to pull it off or how well it would work.

Ah, eh, :grin:
Wow impressive, but it sounds all quite above my head. To be honest, I have just a very little idea where you are going to. But if you have updates, I am curious. If we can help other users having a better light setup, why not.