Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 6
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5398 times and has 5 replies Next Thread
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
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
[Jul 14, 2018, 1:03:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
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
[Jul 14, 2018, 7:49:56 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
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
[Jul 16, 2018, 12:33:28 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sunlight simulation and variable light source

Problem solved with an acceptable video rendering time. Phew..
----------------------------------------
EnkoNyito
[Sep 3, 2018, 11:54:28 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
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
[Mar 12, 2023, 3:52:13 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
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'

----------------------------------------
EnkoNyito
[Mar 24, 2023, 10:24:47 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved