Very realistic sun studies for architects

very cool, will have to try this out!

This is really cool. This would be good when filming live-action video for later use with the camera tracker and compositor. Just make note of the time that youā€™re shooting and you can match the exact position of the sun.

Is this only for Cycles? Or does it work with BI?

Steve S

It seems to be done very very well! I have a questionion/request. Is it theorically possible to make the sun/emitter-mesh to position based on the lighter point of an HDRI texture that I set as environment? In this way the real sun light correspond to the Texture sun. It would be really good!

Thank you for your work!

Thanks guys, glad you like it.
Regarding comments on hard work, Iā€™d say that building stone walls is hard work or tilling the soil with black flies nipping at you is hard work. Writing software is more like basketball or ping pong.
Regarding questions:
[Steve S]: The widget works for Cycles and BI. Its just that with Cycles there is a special hook to Cycleā€™s Sky Texture which has always had sun direction variables built into it. The sun widget merely makes use of them to rotate the sky texture so that its sun shows up at the correct direction and elevation for given times and places. So too, with objects.

[Lell]: HDRI textures donā€™t have sun direction variables associated with them nor do their lighting values differ as the texture is rotated as with the Cycleā€™s Sky Texture. Without an X,Y,Z coordinate as a sun direction reference, the widget has nothing to go on. Still, if you select a sun lamp as an object used by the sun widget, you need merely to line it up with the light in the HDRI.

Hope that answers your questions

Thank you for your kind words and may the widget reap many blessings for you in your renders.
Regarding your (?)s.
Steve S: The widget can be used for anything Blender uses. It merely positions objects in 3D space relative to the sun position for a given time and place and correctly positions the sun direction for sun lamps. There is a special hook for Cycleā€™s sky texture which internally has a vector for sun directionā€”the widget merely makes use of it. If you are using BI, simply ignore the sky texture and use a sun lamp in the ā€œUse Objectā€ selection. In Cycles, the Sky texture, though it has a sun, does not in itself cast a shadow. So if you want proper shadows, you also need to use a sun lamp. The sun widget will let you use both the texture and the lamp and keep them in sync.
Lell: HDRI textures have no sun direction vector associated with them so their is nothing that the widget can use as a reference point. But Iā€™m sure that one could write code to analyze the texture, determine the brightest spot and regard it as the sun position and place a lamp accordingly. But Iā€™ll leave that to younger minds.

Hope that answers your questions.
X

Considering that the sun in the HDR points at the center of the scene, it could be made that the calculated sun points to the center of the scene from a point for example 10 units away from the center, in the position of the lighter point of the HDR. The lighte point of course, must take into account the mapping coordinates of that map. If you could access tha texture pixel values, maybe you could do that. I donā€™t know how much complicated this is. If you canā€™t no matter! Thank you anyway!

thanks for the nice script, it really shines under cyclesā€¦!

yet had some minor update problems when rendering animations, and sometimes you need to disable/re enable, I guess itā€™s a Blender related thing -happened if program loses focus for a while-

maybe a way to bake / export animation of sun and sky texture could be useful, and should also help with those issues
great addon!

if we enter sun position from the hdri background as pixel co-ordinate(manually this can be read in blender image editor or Hdrshop) and script converts into sun lamp posn. it will be useful to align sun to hdri background.

Havenā€™t used this as yet, though the idea looks epic. +1 for a thanks for this script.

Great work xaire. Thank you. Iā€™m working on a project that involves knowing sun positions and hoping I can make use of your addon. Could you tell me the accuracy of the calculations over a range of years? Part of my project may involve past and future solar eclipses.

I have a correction for your help menu which reads:

  -Use Ctrl for course increments or Alt for fine

it should read:

  -Use Ctrl for <i><b>coarse</b></i> increments  or Alt for fine

Thank you again.

Liero, your welcome.
When animating, the Properties panel must be visible as stated in the documentation. If it isnā€™t, the script canā€™t run. And yes, there are times when flipping back and forth between screens which will kill the callback function which then requires the script to be re-enabled.

Rusted,
I do have a version which lets me align the sun lamp with the hdri texture and then bind them so that they move together. However, when doing this, it only makes sense to rotate things on the Z axis for 99% of hdri textures and this I do by moving the North Offset slider. This will be confusing to most users so I need to work out a better way of presenting the panel when binding the sun lamp to an Environment texture. Items such as month, date, time etc. mean nothing at this point. Iā€™d like to keep the panel clean looking for a function of this type.

dragonbyte,
Nice catch on the coarse. As I get older, the spelling continues to deteriorate. Regarding the accuracy of the widget, we live by faith. Iā€™m trusting the work of NOAA and NOAA trusts the work of Jean Meuss. They spell out the accuracy at this page. In case that link gets blocked, they state ā€œThe sunrise and sunset results are theoretically accurate to within a minute for locations between +/- 72Ā° latitude, and within 10 minutes outside of those latitudes. However, due to variations in atmospheric composition, temperature, pressure and conditions, observed values may vary from calculations.ā€ Years are good for about -2000 to +3000. Hope this helps.

xaire, yes, that helps. Thanks for the link. I know what you mean about spelling. My spelling accuracy has also suffered as Iā€™ve aged. I attribute it to the increase in wisdom Iā€™ve acquired ā€“ my brain can hold only so many gigabytes.

xaire
,

Rusted,
I do have a version which lets me align the sun lamp with the hdri texture and then bind them so that they move together. However, when doing this, it only makes sense to rotate things on the Z axis for 99% of hdri textures and this I do by moving the North Offset slider. This will be confusing to most users so I need to work out a better way of presenting the panel when binding the sun lamp to an Environment texture. Items such as month, date, time etc. mean nothing at this point. Iā€™d like to keep the panel clean looking for a function of this type.

thanks for working on this.what is the formula for converting sun posn coords in hdri image(latlong format) to sun lamp position.

In Blender 2.65 (last build 53208 for windows 64 bit) the script does not appear in the panel World.
the problem is the version of python?

You have to download and install it.

Kind regards
Alain

Tried to download but get an error message saying ā€œfailed to access data baseā€ or something like that. Was it taken down?

Hm, in recent trunk I cannot activate the addon. It shows up in the addons, but i cannot activate it with the checkboxā€¦ I also tried changing the version number in the header to 2,6,5, but that didnā€™t really help. any ideas?

Thereā€™s a typo at line 8?

File "/Applications/Blender/blender.app/Contents/MacOS/2.65/scripts/addons_contrib/development_class_viewer.py", line 8
    "description": "List text"s classes and definitions",
                              ^