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 3683 times and has 5 replies Next Thread
HawkDawg
Advanced Member
Member's Avatar

USA
Joined: Oct 6, 2015
Post Count: 199
Status: Offline
Reply to this Post  Reply with Quote 
Question About Photo Rendering

I'm trying to figure out how the photo rendering actually works.
As I mentioned in this post - http://www.sweethome3d.com/support/forum/viewthread_thread,6297_offset,10#27474 - the first two pictures in that post took a little over 6 hours and 5 hours to render, and that particular sh3d file is about 70 MB, while the following two pictures, taken from a sh3d file that is about 135 MB took considerably less time.

This one took 22 minutes.



This one took 25 minutes.



Any ideas/advice as to why the major difference in rendering time?
----------------------------------------
Hawk
----------------------------------------
[Edit 1 times, last edit by HawkDawg at Nov 24, 2015, 3:01:30 PM]
[Nov 24, 2015, 2:32:42 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
mazoola
Advanced Member
Member's Avatar

USA
Joined: Mar 25, 2015
Post Count: 153
Status: Offline
Reply to this Post  Reply with Quote 
Re: Question About Photo Rendering

I've not studied the SunFlow code -- and the project evidently died out before much, if any, technical documentation was created, but typically the biggest factors determining how long an image takes to render are the number of light sources, the number of transparent/translucent objects, and, to a lesser extent, the number of reflective objects in a scene. (Assuming all other settings remain the same, that is. Should you decide, say, to use the advanced photo processing plugin and activate caustics in your final scene, you could easily increase your rendering times by a factor of 10 to 100 -- probably even more.]

To render an image, for each pixel a pathway (vector) first has to be plotted from the location of the virtual camera lens in the 'direction' of that pixel until a virtual object is encountered. Once this initial target is detected, additional vectors are then plotted from the point where the original vector met object to each of the light sources in the scene. The color and amount of light returned is then calculated based upon each source's potential contribution to the total. Once all those calculations are complete, a value is stored for the pixel, and the process begins again.

In some cases, additional rays must be cast beyond simply one per light source per pixel -- for instance, if the object encountered by the original cast ray is translucent/transparent or reflective. In the first instance, rays may need to be traced from the object to each light source in order to determine the contribution made by the object's specular, ambient, and/or diffuse reflectivity. Then, an additional ray is shot 'through' the object -- typically on a path that diverges from the original vector from camera to object, depending on the object's degree of diffraction. This second ray continues until it, too, encounters an object -- at which point the entire process may repeat, depending on the desired amount of recursion set in the program. Finally, though, once all of the vector definitions and calculations triggered by the initial ray are complete, a final color value is assigned to the pixel.

Note this can be a very processing-intensive calculation to make. For instance, if your scene contains a red rose inside a blue-tinted bell jar, pixels representing the rose could be calculated based upon (a) the amount and color of the light source reflecting from the bell jar plus (b) the amount and color of the light source reflecting from the surface of the rose (c) diminished by the degree of opacity of the bell jar and (d) color-shifted by the intensity of tint in the bell jar's glass, with (e) the precise area of the rose used in calculation 'b' determined by the glass's degree of refraction -- (f) times the number of unobstructed light sources in range.

It appears the living/dining room layout on your first post contains at least 25 light sources -- not counting the sun. In contrast, assuming it was generated using only the 'sun,' the last image above contains only a single light source; all things else being equal, it would require only 4% as many calculations to render.

There are numerous ways one can attempt to accelerate the render process -- many of which appear to be implemented in SunFlow by default. (For instance, when you first load a plan file, you may notice all of your furniture items in the 3D window initially display as groupings of featureless white blocks. These are the 'bounding blocks' defined for each object to accelerate collision detection between objects and rays. As you might imagine, complex objects require complex equations to model them -- so if you're shooting rays for a lot of light sources in a room full of complex items, the system is going to crawl. However, if you define a simple, rectangular bounding block *containing* the item, and you conduct your initital collision text against the bounding block, and only model the full item once a hit on the block itself is detected, the greater simplicity of modeling the block more than offsets the cost of the occasional doubled pic. As I said, SunFlow seems to contain a number of accelerators and simplifiers as default, so your image is likely running about as optimally as can be expected.

The easiest way to speed things up is to cut back on the number of lights you use, with lesser improvements possible from cutting back on highly reflective and transparent/translucent surfaces. Keep in mind that "lights" means "anywhere, on any level" -- if your basement lights are on while you're trying to render a view of the penthouse, each pixel mapped will waste a few microseconds to calculate whether or not the basement lights shine on it. (I've taken to placing lights on their own levels, one level per floor, and making unused levels not visible.)
[Nov 25, 2015, 9:12: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 
HawkDawg
Advanced Member
Member's Avatar

USA
Joined: Oct 6, 2015
Post Count: 199
Status: Offline
Reply to this Post  Reply with Quote 
Re: Question About Photo Rendering

Well, that kind of all makes sense.

It appears the living/dining room layout on your first post contains at least 25 light sources -- not counting the sun.

Not sure how you count 25 light sources. I had ceiling lights turned off. The kitchen light has 4 light bulbs. The bedroom light has 2. The bathroom has 1. The living room (behind the camera) has 7 and there's one more light in a lamp behind the camera. That's 15, not counting the sun.

Maybe I'm missing something, but thanks a bunch for the explanation.

That would help to explain why the photos taken, shown in the other topic I linked to, would take so much longer. I had ceiling lights turned on, plus at least 40 more lights, plus the semi-transparency of the pool water, plus all the glass.
Off the top of my head I'd guess there's about 30 to 35 default ceiling lights, on top of the lights I added.
----------------------------------------
Hawk
----------------------------------------
[Edit 2 times, last edit by HawkDawg at Nov 25, 2015, 10:40:26 AM]
[Nov 25, 2015, 10:23:43 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
mazoola
Advanced Member
Member's Avatar

USA
Joined: Mar 25, 2015
Post Count: 153
Status: Offline
Reply to this Post  Reply with Quote 
Re: Question About Photo Rendering

Not sure how you count 25 light sources.


Plus the 10 small spots in the staircase....
[Nov 25, 2015, 10:42:17 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
HawkDawg
Advanced Member
Member's Avatar

USA
Joined: Oct 6, 2015
Post Count: 199
Status: Offline
Reply to this Post  Reply with Quote 
Re: Question About Photo Rendering

Not sure how you count 25 light sources.


Plus the 10 small spots in the staircase....

Ah! We're talking about different photos and buildings. I thought you were talking about the shots in the first post in this topic, but you were talking about the photos in the other topic I linked to.
In that case, you underestimated the number of lights. smile

In the living room/kitchen alone there's at least 35 or 36 that I placed.
4 track lights with 4 bulbs each. 3 ceiling fans with 1 bulb each. 11 stair lights. 4 under-cabinet lights (I think - 3 or 4). Plus one fixture at the back door with 2 bulbs, and the 7 pool lights.
Then there's about 3 more lights that I added throughout the rest of the house.
Add to that all of the default ceiling lights, about 35 or so.

I think I see why it takes so long to render a photo in that house. laughing

I'm running a photo render right now of the same camera position as the night and day shots in the other topic. This time with the add ceiling lights box unchecked. I'll post back when it's done as to how long it took. I'm guessing, with the removal of the 35 or so default ceiling lights, it should take a little less time. biggrin
----------------------------------------
Hawk
----------------------------------------
[Edit 3 times, last edit by HawkDawg at Nov 25, 2015, 11:37:56 AM]
[Nov 25, 2015, 11:25:53 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
HawkDawg
Advanced Member
Member's Avatar

USA
Joined: Oct 6, 2015
Post Count: 199
Status: Offline
Reply to this Post  Reply with Quote 
Re: Question About Photo Rendering

I went back and unchecked the default ceiling lights and took another photo. What took 5 hours and 5 minutes before, this time took 3 hours and 1 minute.
I then made all light bulbs I added invisible and this photo only too 8 minutes to render.

Thanks so much for explaining the rendering process. This will go a long way to help in the future.
----------------------------------------
Hawk
[Nov 25, 2015, 2:02:46 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