Matching the sunlight with opengl shadow

Well…just a noobie on the openGL shadow.

If you are using openGL solid shading, and then go to display options and activate shadows, you will have a shadow cast in realtime in openGL, but the control to change it to match a scene light doesn´t seem to be there, you have the settings for the shadow, where you can change the light direction similar to the sky texture, but I do not see how this could be connected to either the world sky texture or a scene light, Ivé been looking at those options to activate it from the world panel, but nada.

Could it be possible to link this openGL shadow to match the pitch and heading of a sunlight?
And with that I mean fully updating when rotating the sunlight.

Sorry, but I don’t think that is possible. You can link the skytexture to a light but the shadow will only be seen in lookdev, Eevee & Cycles. And the skytexture will only show in Cycles.

Thanks Mikael, that´s what I feared.

and Yes…I tried the skytexture in cycles and in openGL but the openGL (skytexture UI ctrl) is disconnected from the world texture seen in cycles.

One may think it shouldn´t be impossible though, if it can display a shadow like that, why not improve it to work with the directional change of a sunlight.

Hopefully someday.

There is a plugin that works with HDRI. HDRI Sun Aligner.

Yes, but does it really connect to the opengl shadow and sunlight direction?
That was the whole idea, and not really a matter of matching a sunlight to a background HDR.

Try it out.

No…sorry, not until I get a confirmation that it can do what I want…I need focus on this, not messing around with something that eventually doesn´t work for this case.

Hi MI65, I’m the developer of HDRI Sun Aligner. In brief, it works as follows:

  1. You need to have a scene with an HDRI world environment defined.
  2. The addon finds the brightest spot in the HDRI and calculates the coordinates of this point.
  3. With this information, you can add a new sun lightsource that is aligned with the “real sun” in the HDRI, thus providing shadows that line up with the HDRI light.
  4. As a bonus, you can also rotate any object with the same rotation vector.

I do not think you understand.
This has nothing to do with lining up a sunlight with any background texture…and to get that to work in cycles or eeve.

This has to do with the matching of the sunlights direction…pitch heading to match the openGL shadow produced in the openGL lighting options.

If you can confirm that the addon…connects the light direction with the openGL skytexture controls (not the world sky texture controls) then it may work…but otherwise it won´t work.
It´s a matter of the sunlight pitch and heading data being connected to that openGL shadow display option.
All you have to say…or show…is an image or animation confirming that it would work.

Thanks anyway for trying to help.

No, I don’t think my addon will be helpful in your scenario.

Thanks for confirming the case scenario.

I will look in to the addon later when I will focus on HDR backgrounds and matching of sunlight…so thanks for all that, but that will be when I work a little also with Lightwave and Sibl, which also has this built in.

But I could also manually dial in the sun in Lightwave to match the sunlight or any bright spot…cause the physical sky will allow for the sun to be seen in VPR, and as such I just rotate the pitch and heading to
match the sun in the hdr manually, then I turn the physical sky off once that is set…so in essential Sibl isn´t necessary to get that working…it takes some seconds of more work perhaps, but fully doable, Sibl you would get a request in the setup…then you are done.

As for blender, …for this case anyway, it´s more of an architecture realtime feedback of where the sun is and how it would cast it´s shadows, so as direct and quickly as possible without having to render.


Thanks for the update; I just found another sun position addon that is now included in the latest version of Blender, in case you like to check it out:

Perhaps the sun position addon could be updated to also influence the OpenGL sun? Guess it could be useful for some to animate time of day/year to see where direct sunlight falls, but in workbench engine? I don’t know if it’s even possible to drive it externally.