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.
Sunlight simulation and variable light source
This topic has been viewed 9033 times and has 5 replies
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 [font=courier new]sunPower[/font] is computed in the [font=courier new]render[/font] method of PhotoRenderer class.
[font=courier new]exportLightSources[/font] method is used to export the other light sources, but they are not supposed to vary, just maybe turned on and off.
If you want to change the power of the sun according to its position in the sky, you should just change how [font=courier new]sunPower[/font] is computed in the [font=courier new]render[/font] method of PhotoRenderer class.
[font=courier new]exportLightSources[/font] 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 creator
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.
This computation is done in the exportLightSources method.
It works great for simple or multiple photo rendering but not for video rendering.
EnkoNyito
Re: Sunlight simulation and variable light source
Problem solved with an acceptable video rendering time. Phew..
EnkoNyito
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, [font=courier new]updatedItems = null[/font].
For video rendering, even if I add [font=courier new]updatedItems = this.variableLights[/font], the auto light panel does not turn on after sunset.
By default, in the render method, [font=courier new]updatedItems = null[/font].
For video rendering, even if I add [font=courier new]updatedItems = this.variableLights[/font], the auto light panel does not turn on after sunset.
EnkoNyito
Re: Sunlight simulation and variable light source
Taking into account the new values of [font=courier new]sunDirection[/font] 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 [font=courier new]updatedItems != null[/font]
When removing the previously created light panel from the renderer, there are the following messages:
Then
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 [font=courier new]updatedItems != null[/font]
When removing the previously created light panel from the renderer, there are the following messages:
Code: Select all
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 useCode: Select all
java.util.MissingFormatArgumentException: Format specifier '%s'EnkoNyito
Who is online
Users browsing this forum: No registered users and 3 guests