Joined: May 28, 2015
Post Count: 607
Status:
Offline
Sunlight simulation and variable light source
Currently, the computation of the light source power is done only once (in the constructor of the PhotoRenderer class then in the exportLightSources method). When a sunlight simulation video is made, the apparent power of a light source varying with the position of the sun is not taken into account at each frame.
By moving the management of this computation into the render method, this solves the problem but greatly increases the estimated rendering time. We go from less than 2 hours to more than 6 hours for a timelapse of 8 seconds.
----------------------------------------
EnkoNyito
France
Joined: Nov 7, 2005
Post Count: 9388
Status:
Offline
Re: Sunlight simulation and variable light source
I'm not sure to understand what you want to change. If you want to change the power of the sun according to its position in the sky, you should just change how sunPower is computed in the render method of PhotoRenderer class. exportLightSources method is used to export the other light sources, but they are not supposed to vary, just maybe turned on and off.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Joined: May 28, 2015
Post Count: 607
Status:
Offline
Re: Sunlight simulation and variable light source
In fact I wanted to make a video timelapse with a new light panel whose apparent power varies depending on the position of the sun. This computation is done in the exportLightSources method.
It works great for simple or multiple photo rendering but not for video rendering.
----------------------------------------
EnkoNyito
Joined: May 28, 2015
Post Count: 607
Status:
Offline
Re: Sunlight simulation and variable light source
Since Sweet Home 3D 7.0, lights with the lightSourceMaterialName# property are handled differently. By default, in the render method, updatedItems = null. For video rendering, even if I add updatedItems = this.variableLights, the auto light panel does not turn on after sunset.
----------------------------------------
EnkoNyito
Joined: May 28, 2015
Post Count: 607
Status:
Offline
Re: Sunlight simulation and variable light source
Taking into account the new values of sunDirection at each frame, the light panel turns on automatically after sunset.
Now there are two problems.
Problem 1: With a new update method By removing the previously created light panel from the renderer, the updated light panel loses its appearance while keeping its lighting. If it is not removed from the renderer, the updated light panels are added to the previous one which weighs down and modifies the rendering.
Problem 2: With updatedItems != null When removing the previously created light panel from the renderer, there are the following messages:
GEOM error: Geometry "object09c1d2eb-25b8-4875-8459-a2f1a1c61250-0" was not declared yet - instance is invalid API error: Unable to update "object09c1d2eb-25b8-4875-8459-a2f1a1c61250-0.instance" - removing API error: Unable to declare camera "camera", name is already in use
Then
java.util.MissingFormatArgumentException: Format specifier '%s'