HDRI Sun Aligner v1.6

I have been thinking about the best way of sampling the color temperature of the sun in the HDRI:

  1. Sample the values in the HDRI directly, but as it is 32 bit float that needs to be tone mapped I’m note sure if this is the best way forward.

  2. An indirect approach could be to set up a sample scene with a diffuse gray plane aligned towards the sun, then render the scene and probe the color of the plane. I believe this would work in theory, but is seems a bit complex to set up…

1 Like

Hi Alex74,
1 - No. To avoid compromising the 32 bit depth of an HDRI, you must not use tone mapping but fusion exposure. You have simply to sample the center (circa) of your source light (Sun on outdoor HDRI, Studio lights for indoor scenes) and give the three RGB value (or HSV, HEX…) to the color of the 3D software light.

2 . To match the intensity, instead, you have to use False Colours pass (or display mode) to match the False colours of the original HDRI render with the False Colours of a rendered scene used 3D software lights (After you have removed from the HDRI the original lights such the Sun from an HDRI outodoor, or studio lights from an indoor HDRI).
(The False colours give as the levels of intensity of light (in EV) of the scene)

What I did was simply using your add to create a Sun, relocate it if needs, matching with the position of the original sun above all concerning shadows and reflections.
Then I use the Color picker to get the original sun color RGB values and gave them to the added sun.
Finally, I rendered both images, I saw them with the False color values to try to match the light intensity of the original HDRI sun with the virtual sun added with your plugin. This is the most physically accurate method I found the right position of the original HDRI sun, his color and his intensity.
I hope it helps.

2 Likes

Hello Ake!! How are you doing?

I found your addon and made some changes to work in blender 4.0 and also some modifications to fit on what i was needing. I hope you don’t mind about.

to work in Blender4.0 i just changed the bpy.ops.hdrisa.calculate_sun_position(override, ‘INVOKE_DEFAULT’) line in HDRISA_OT_dummy to bpy.ops.hdrisa.calculate_sun_position(‘INVOKE_DEFAULT’) only.

Only removed the override, until now looks to work so far haha. also changed the layout of the panel and made the Sun Energy 5.0 and the alignment automatic when it is created. Also made the Search for the Environment texture to loop in the Node Tree and Node Groups to fit on my personal World Texture Group. Thanks for this amazing addon!

Captura de tela 2023-12-07 222449

If Ake allows I can share it!!

6 Likes

Can you give me please?

It’s on GitHub; you can just download it? :thinking:

I need recovery version by @Robert_Kezives , because i have errors.

Oh I see, sorry!

1 Like

Sure!
The mods what i have made is working perfect for me, but if you have some problem you can contact me then i can help.

AlignSunRotation-MOD.py (20.0 KB)

2 Likes

It’s works now. Big thanks :heart:

1 Like

I’m glad to hear that. this original code from Ake is amazing and work better than the blender one. having some issue i can try to help! :slight_smile:

1 Like

Are you maybe know how correct shadow soften if use hdri maps?

It can be soften by increasing the Angle on Sun Lamp property. To soften it Direct on the HDRI image maybe you can try to blur the image, i have never tried it before but i think it can work. But i think only change the sun lamp property will solve your problem

1 Like

I tried to blur the hdri map with nodes, and it worked exactly! :partying_face:

1 Like

Hi @Robert_Kezives, thanks for looking into my code and sorry for the late reply from my side :slight_smile: I tested the addon in Blender 4.0 (using the latest code from GitHub, download ZIP “hdri-sun-aligner-master.zip”) and it worked without errors.

Then I looked at my previous commits realized that I have forgot make a new release after the latest updates. One example is that “HDRISA_OT_dummy” was removed, but it’s still included in the 1.5 release.

Would you mind have a quick test of the latest version (Code → Download ZIP) to verify it works for you as well? I can then make a release version bump to 1.6 to sort out the confusion.

1 Like

Hello Ake!!

oh, I did not noticed that when i first try your code!! I went straight to the release tab.
I did the test and the Master version is working perfectly, all the features!

I think you can make the new release for it, will help people without attention as me lol, i still confused on github website.

Thank you for develop this code, it help a lot!

Hi, new release 1.6 is up on GitHub! :slight_smile:

3 Likes