|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Sunlight simulation and variable light source |
|
| Print at Dec 19, 2025, 9:18:06 AM | View all posts in this thread on one page |
| Posted by enkonyito at Jul 14, 2018, 1:03:16 PM |
|
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 |
| Posted by Puybaret at Jul 14, 2018, 7:49:56 PM |
|
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 creator |
| Posted by enkonyito at Jul 16, 2018, 12:33:28 AM |
|
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 |
| Posted by enkonyito at Sep 3, 2018, 11:54:28 PM |
|
Re: Sunlight simulation and variable light source Problem solved with an acceptable video rendering time. Phew.. ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Mar 12, 2023, 3:52:13 AM |
|
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 |
| Posted by enkonyito at Mar 24, 2023, 10:24:47 PM |
|
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 invalidThen java.util.MissingFormatArgumentException: Format specifier '%s'---------------------------------------- EnkoNyito |
|
|
Current timezone is GMT Dec 19, 2025, 9:18:06 AM |