Page 1 of 2

Rendering basics - some pretty heavy questions.

Posted: Thu Feb 03, 2011 4:17 pm
by Cosmasad
Good morning friends,

Yesterday we ran our first rendering. It took 8 hours at an SL of 16. The result could definitely use improvement. We contact Jeremy Hill at the Maxwell for Rhino section and he gave us some tips. As this is pretty heavy, obscure stuff a lot of it is going over our head. As it is general stuff that doesn’t really belong in the Rhino plugin section, we are following up with it out here in the general section hoping that we can generate a dialogue that can illuminate some of the issues that follow. The quotes are all Jeremy’s:

When we asked Jeremy why the rendering took so long and why it is still grainy, he responded:

“If the image is grainy, it means that it needs to render longer, and/or that your scene and/or materials are poorly-designed and are slowing down the progress unnecessarily… firstly, do not ask Maxwell to render things which do not matter. If you draw some geometry twenty miles away from your scene, Maxwell is going to render it, even if you can't see it at all -- Maxwell is an unbiased renderer, so it does not attempt to make guesses about your intentions.”

Okay, is Jeremy saying that Maxwell renders (or processes) geometry that is off camera? If we have a model of a three room space and we have pointed our camera to one corner of one room, and set Maxwell to render it, does it render the information in all three rooms even though the camera can’t see it? Does it process the information behind the camera – even though it can’t see it? If so, how should we handle it? Should we delete the other spaces, hide them, or put them on another layer and turn them off?

“Secondly, build materials which mimic materials you might find in the real world. In the real world, you will never find the color [255, 255, 255]; at best when you see something white, you are looking at something more like 220-230.”

Is Jeremy really saying to avoid white because it takes longer to render or because it won’t look right?

“You will also never find a perfectly reflective surface in the real world; so don't ask Maxwell to render one. Just think about a ray of light hitting a surface and bouncing back -- what would the world look like if no energy were lost (converted to other forms, that is) when light bounced around? Well, what's your Maxwell world going to look like if you tell it that such materials exist?”

Again, how do we avoid “perfectly reflective surfaces”? How do we spot them and how do we tone them down?

“Lastly, you can help out the calculation a bit sometimes; think about a light ray trapped in a room -- it will bounce around until all of its energy is lost. As I wrote above, Maxwell takes your scene as you give it, so it's not going to do anything tricky to try to help here, but nothing is stopping you from helping; open up a wall behind the camera if it won't adversely affect the image; by doing so, you can let some of the less interesting light rays escape out into nowhere, and therefore cease to represent a calculation cost.”

What does this mean? How is light trapped in a room? Should we really “open up a wall behind the camera?”

“It sounds to me like a combination of the two then: an image which needs to render longer, which is then being stretched quite a bit beyond its native resolution for full-screen display. There is no conclusive answer to the question of how long a render needs to be calculated; it is completely scene-dependent. I could build you one scene which would be finished in two minutes, and I could build you another which would not be complete within the span of your lifetime. Maxwell is not a 'this region is done, move to the next' type of renderer, -- it is rather, as they say, a light simulator, and it will keep on simulating more and more light interactions the longer you let it work. As to the question of scene size (MB), Maxwell hardly cares at all about complexity of geometry; what matters is how difficult it is to calculate light rays, and that depends on the makeup of the scene, and on the materials used.”

What does this mean? Any help we can get would be appreciated.

Thank you.


Cosmas Demetriou

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 03, 2011 4:57 pm
by numerobis
i think you should take a deeper look into the manual and the available tutorials - this is all very basic stuff and JD has explained it already very clearly...

i would suggest you to try this great tutorial from Jason (Half Life):
http://www.vtc.com/products/Maxwell-Ren ... orials.htm
the frist lessons are free and cover already most of your questions - but i think you should consider to buy the whole tutorial because it's very complete and well explained and worth every €!

other than that there are many tutorials on
http://think.maxwellrender.com/index.php

and last but not least the pdf manual - here is the part about scene optimisation:
13.02 Optimization methods and Tips
There are several things you can do to optimize a scene, mostly related to emitters:
• Make sure your emitting surfaces are as low-polygon as possible. Usually, a singlesided
polygon will be sufficient.
• If possible, do not completely enclose your emitters inside a dielectric object. All light
that is emitted through the dielectric object is considered caustic light and will take
longer to render.
• Make sure your emitter is not intersecting other geometry. In most cases this will not
be a problem but it may add to the render time and produce strange results in the
lighting. Regular geometry can intersect other geometry.
uuVery important: Do not use very white or fully saturated materials in your scene. For
example, a completely white (255, 255, 255) material will take a very long time to clear and
will also make the contrast in the image disappear. Also avoid completely saturated colors
such as pure red (255, 0, 0). Pure white or pure saturated materials do not exist in real life
so it is better to decrease the saturation a bit. For a white wall, around RGB 220, 220, 220,
which is the albedo of white paper, is sufficient.
• For interior renders where window glass reflections are necessary, use the AGS glass
material for the windows instead of real glass. This will create the reflections but will
not produce caustics, thus speeding up the rendering.
• Perhaps you simply need more time for rendering, depending on your machine specs.
Check http://www.benchwell.com to know how fast your machine is.

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 03, 2011 6:09 pm
by Half Life
The previous reply covered pretty well but I'll reply in particular here and follow with some required reading.
Cosmasad wrote:Good morning friends,

Yesterday we ran our first rendering. It took 8 hours at an SL of 16. The result could definitely use improvement. We contact Jeremy Hill at the Maxwell for Rhino section and he gave us some tips. As this is pretty heavy, obscure stuff a lot of it is going over our head. As it is general stuff that doesn’t really belong in the Rhino plugin section, we are following up with it out here in the general section hoping that we can generate a dialogue that can illuminate some of the issues that follow. The quotes are all Jeremy’s:

When we asked Jeremy why the rendering took so long and why it is still grainy, he responded:

“If the image is grainy, it means that it needs to render longer, and/or that your scene and/or materials are poorly-designed and are slowing down the progress unnecessarily… firstly, do not ask Maxwell to render things which do not matter. If you draw some geometry twenty miles away from your scene, Maxwell is going to render it, even if you can't see it at all -- Maxwell is an unbiased renderer, so it does not attempt to make guesses about your intentions.”

Okay, is Jeremy saying that Maxwell renders (or processes) geometry that is off camera? If we have a model of a three room space and we have pointed our camera to one corner of one room, and set Maxwell to render it, does it render the information in all three rooms even though the camera can’t see it? Does it process the information behind the camera – even though it can’t see it? If so, how should we handle it? Should we delete the other spaces, hide them, or put them on another layer and turn them off?
You can choose to leave the geometry there but it will take longer to render because in a nutshell what Maxwell is calculating is the bouncing (and transmission/bending) of light, whether on camera or not -- If you give the light a more complicated path to follow it will take longer to resolve. The basic concept is if you simplify the path of the light it will resolve quicker... but it is particularly pointless to allow Maxwell waste processing cycles on geometry/materials/emitters that do not effect what is seen on camera. So my advise is to (do whatever Rhino does to) "hide" the non-relevant portions before rendering any particular camera.

It is also worth saying that SL 16 may only be the beginning depending on what type of materials you are using -- Dielectrics (glass,water,etc), Displacement, and SSS/thinSSS can all lead to longer render times... I tend to render to at least SL 20 for most of my scenes and for tough to render materials much higher. Render time is irrelevant because it will vary completely dependent on what you are giving to Maxwell... you are in control of render time not Maxwell because you can make different decisions whereas Maxwell is a fixed variable.

Poor materials settings will also lead to longer render times... as a general rule of thumb I would make sure my saturation and brightness values of any color based material does not exceed 225 (for reflectance 0) and I would avoid excessive use of "Additive" blending mode. I would also check my material image maps and make sure that none of the images set to Reflectance 0 have any values exceeding the 225 limit as well.

Materials is a complicated subject and one that takes time to master and understand -- this will be an ongoing learning process for you and you will have to resign yourself to running many hundreds of tests to learn how to get to the best solution and to build the experience necessary to get the best possible results in the least amount of time.
Cosmasad wrote: “Secondly, build materials which mimic materials you might find in the real world. In the real world, you will never find the color [255, 255, 255]; at best when you see something white, you are looking at something more like 220-230.”

Is Jeremy really saying to avoid white because it takes longer to render or because it won’t look right?
We are working in spectral color in Maxwell (not RGB) -- if you design something in a graphics application and print it out, the "white" portions will simply be paper... in that instance the paper becomes "white"( although the true value of paper rarely exceed RGB 225) and all the colors printed upon that paper will be skewed downward in brightness to adjust to that new limit of brightness that the paper surface presents... this is a type of colorspace gamut and is a very complicated subject and one which you can wrestle for years (I have).

The bottom line is Maxwell does not put that limitation on you but for the sake of speed and realism it is best to obey the laws of physics and not exceed the brightness or saturation of objects in the real world. Again going back to the graphics applications,they may show bright and saturated colors because they are not bound by the same physical limitations(when choosing a color, basically RGB vs CYMK) but the printers can not print certain colors and will adjust them down in brightness and saturation to fit into the physical limitations of paper and ink.

Cosmasad wrote: “You will also never find a perfectly reflective surface in the real world; so don't ask Maxwell to render one. Just think about a ray of light hitting a surface and bouncing back -- what would the world look like if no energy were lost (converted to other forms, that is) when light bounced around? Well, what's your Maxwell world going to look like if you tell it that such materials exist?”

Again, how do we avoid “perfectly reflective surfaces”? How do we spot them and how do we tone them down?
Increase the roughness parameter slightly -- although I am not one to harp on this issue because I think in alot of instances a perfectly smooth surface with a bit of bump/normalmap/displacement is better than a modification in roughness (which looks "fake" sometimes)... regardless, this has not been a huge issue with render times for me.
Cosmasad wrote: “Lastly, you can help out the calculation a bit sometimes; think about a light ray trapped in a room -- it will bounce around until all of its energy is lost. As I wrote above, Maxwell takes your scene as you give it, so it's not going to do anything tricky to try to help here, but nothing is stopping you from helping; open up a wall behind the camera if it won't adversely affect the image; by doing so, you can let some of the less interesting light rays escape out into nowhere, and therefore cease to represent a calculation cost.”

What does this mean? How is light trapped in a room? Should we really “open up a wall behind the camera?”
Light is basically energy -- and some of that energy is absorbed with each surface it hits (unless you set the reflectance 0 for 255 and have a perfectly smooth surface)... the remaining light energy will continue to bounce until it is completely exhausted. This exhaustion of the light energy is the completion of the render in Maxwell -- noise is simply the result of light energy still bouncing around. If you open a wall the weakened light can escape into nothingness and will no longer need to calculated, thus less noise.
Cosmasad wrote: “It sounds to me like a combination of the two then: an image which needs to render longer, which is then being stretched quite a bit beyond its native resolution for full-screen display. There is no conclusive answer to the question of how long a render needs to be calculated; it is completely scene-dependent. I could build you one scene which would be finished in two minutes, and I could build you another which would not be complete within the span of your lifetime. Maxwell is not a 'this region is done, move to the next' type of renderer, -- it is rather, as they say, a light simulator, and it will keep on simulating more and more light interactions the longer you let it work. As to the question of scene size (MB), Maxwell hardly cares at all about complexity of geometry; what matters is how difficult it is to calculate light rays, and that depends on the makeup of the scene, and on the materials used.”

What does this mean? Any help we can get would be appreciated.
This is partially a reference to how other render apps calculate -- the bottom line here is you want to think "reality" in all aspects of Maxwell scene design: Scale of geometry, complexity of geometry, material parameters, and camera parameters. But the important thing is when I say "reality" I'm talking Physics and Math. To that end here are some links to read in your off time:

http://en.wikipedia.org/wiki/Light
http://en.wikipedia.org/wiki/Spectral_color
http://en.wikipedia.org/wiki/White
http://en.wikipedia.org/wiki/Unbiased_rendering

There is much much more -- the learning may take years to fully master all elements... to that end my advice is that you still have to produce in the meantime so I would not worry about being perfect the first project (or first 10 projects) you do. Do what you have to do to get the work out the door and make note of the parts that you need to study and test for later.

Also be prepared to use the services of a render farm for complex renders with lots of emitters -- the average desktop machine may take ages to resolve what a render farm can produce in an hour.

Best,
Jason.

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 03, 2011 10:03 pm
by Half Life
Bear in mind what I said in the previous post is a gross oversimplification for the sake of expedience -- if you are are interested in the Math and Physics behind the scenes you can go very far down the rabbit hole with Maxwell.

Here's some more relevant links:

http://en.wikipedia.org/wiki/Spectrum_of_light
http://en.wikipedia.org/wiki/Color
http://en.wikipedia.org/wiki/Color_vision
http://en.wikipedia.org/wiki/Conservation_of_energy
http://en.wikipedia.org/wiki/Color_space
http://en.wikipedia.org/wiki/CIE_1931_color_space
http://en.wikipedia.org/wiki/RGB_color_space

If you can't tell I love wikipedia :wink:

Best,
Jason.

Re: Rendering basics - some pretty heavy questions.

Posted: Fri Feb 04, 2011 3:29 pm
by Cosmasad
Thank you all for the in depth explanations. We have printed it out and will be studying it and reviewing it over and over again.

Jason we will continue taking your tutorials on VTC this weekend -- and will read the manuals more carefully.

Our renderings are definitely looking better and emitters working.

It just takes a while. :)

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 10, 2011 5:42 am
by Cosmasad
Hey Jason,

I am following up on the message in this thread where we talked about turning off or hiding parts of the model that the camera doesn't see. I have a question that may seem rather obvious. The question that I have is what happens if you are a rendering an architectural interior and you have a physical sky turned on with sunlight coming through a window? If the room has four walls and a ceiling, and you hide the walls that are off-camera then won't sunlight pour through those openings?

I am talking about a complicated model with four rooms in it. We have a camera pointed at three walls of one room. We can hide the other rooms so Maxwell doesn't waste time rendering them, but what do we do about the light that's let in?

Your thoughts are appreciated.

Thank you.


Cosmas Demetriou

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 10, 2011 5:56 am
by Half Life
Yeah, that trick only really works when you have the environment set to "None" -- which is for interiors with either no windows or at night.

Having sun along with regular emitters raises it's own issues -- my best advice there is to raise the power of your emitters much higher than you need before you render (then reduce in Multi-light)... what this does is compensate for the fact that the sun is much more powerful than any emitter. Maxwell prioritizes powerful emitters so by raising the interior light you are saying "hey don't forget about me!".

Best,
Jason.

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 10, 2011 3:28 pm
by Cosmasad
Hi Jason,

That's interesting. Okay, so if we have sunlight coming in through windows and interior lights, in a room with medium brightness (a restaurant during lunch hour), would I double the wattage, would I triple it, would I make it 10x brighter and just bring it down in Multilight? What's a good rule of thumb? Also, the idea of pumping up the intensity and being able to bring it down with Multilight sounds so easy. Is there a downside?

Is Multilight really so forgiving?

By the way Jason, where do you hail from? I'm curious about the time difference.

Thank you.

Re: Rendering basics - some pretty heavy questions.

Posted: Thu Feb 10, 2011 5:33 pm
by Half Life
I'm in Tampa FL -- I just work late when I'm recording.

There is no hard and fast rule because it will depend on which directions the windows are facing and what time of day/year it is... the sun is a stronger influence sometimes and weaker others.

This is a case of personal taste and experience will guide you eventually.

Multi-light is awesome if your machine can deal with the demands of it.

Best,
Jason.

Re: Rendering basics - some pretty heavy questions.

Posted: Fri Feb 18, 2011 12:22 pm
by Mihai
Cosmasad wrote:
I am following up on the message in this thread where we talked about turning off or hiding parts of the model that the camera doesn't see.
.....
If the room has four walls and a ceiling, and you hide the walls that are off-camera then won't sunlight pour through those openings?
You don't have to be so careful about hiding what the camera doesn't see in most cases. You should think about it more in terms of - if I hide/unhide this geometry, will it affect the lighting in the area that my camera sees? In your case, ofcourse you shouldn't hide the walls the camera doesn't see because that would completely change the lighting in that room. You should hide geometry in more extreme cases, lets say you have a model of a whole neighbourhood which spans 2km, and you're doing a render of just a single house. Will a building that's 1km away influence the lighting of the house the camera sees? No, so you can go ahead and limit that scene to maybe just the buildings that surround the house the camera sees because they will perhaps cast shadows, block some light etc...otherwise your house will render like there's nothing around it.

What makes a lighting situation complex? First it's important to understand that when Maxwell renders, it converts the RGB values you set in your materials to "spectral space", meaning it converts those RGB values to energy values - electromagnetic radiation - which is what "light" is in the real world. Lets say you have a bright green wall. Your eyes see it as green because white light hits that wall, the pigments in the wall absorb all wavelengths of light except the wavelengths that produce green light and reflect back to you only the wavelengths that produce green light. That absorbed light, or energy, is mostly converted into heat. All materials absorb some of this energy that hits them, the darker ones absorb more, lighter ones absorb less and reflect most of it back.
So in context of Maxwell materials, a brighter RGB value of a material, means that material will reflect back more of this energy. So you might think of "white" in the RGB sense as being 255 RGB, but in Maxwell you're specifying a material that will reflect back all the light (energy) it receives, which doesn't exist. What happens then is a ray of light hits this surface, bounces off of it without any energy being absorbed, bounces off another surface again without loosing any energy and would keep bouncing around infinitely if Maxwell didn't internally still apply rules of energy loss to keep things realistic. But it still has to calculate all these bounces which in practice results in noiser renders and complete lack of contrast in your renders. In reality even a white piece of paper absorbs a lot of light so if you were to measure its reflectance in spectral space and convert it into an RGB value, it would be something around 215-225.
Going back to complex lighting situations, an interior render will take longer to render compared to an exterior because Maxwell has a lot more calculations to do, the light keeps bouncing around different surfaces, as opposed to an exterior render where most light rays bounce between surfaces just a few times before going out into infinity and Maxwell doesn't care about them anymore.

So it's important to keep track of the RGB values you set for your materials to keep their reflectance (brightness) values realistic. This is also important when you're using textures, if you have a texture with RGB 255 in it, you can clamp that value using the "RBG Clamp" parameter in the texture picker. If you set its second value from 255 to 225, then any value higher than 225 in that texture will be clamped to 225. (btw this "rule" of keeping the reflectance lower than 255 only applies to the Refl 0° color, the Refl90° can be set all the way up to 255 if you want)

It might be more convenient to work with Hue, Saturation, Value in the Color Picker, instead of RGB. You can then control the brightness of a color just using the Value slider, instead of messing with 3 RGB sliders if you want a darker or brighter red for example. I find it also easier with HSV because in my head it's closer related to spectral space than RGB.

Re: Rendering basics - some pretty heavy questions.

Posted: Fri Feb 18, 2011 1:40 pm
by Cosmasad
That's fascinating, Mihai and Half Life and thanks for the explanation. Every time I hear it a little more of it sinks in. As far as interiors are concerned, let's say that you have a very modern space with reflective surfaces ... marble floor, some stainless steel trim, glass surfaces etc and natural light pouring in the windows. The lobby of a modern office building. This may be naive, but would it help to have some black surfaces off camera to catch some of the bouncing light you refer above the way music engineers have absorbent material in a sound studio to absorb some of the sound? These could be simple rectangular planes that have a black velvet-like material on them strategically placed off camera so they catch some of the bouncing light without actually being in the rendering.

Re: Rendering basics - some pretty heavy questions.

Posted: Fri Feb 18, 2011 1:57 pm
by Half Life
Very clever idea! something to test for sure...

Best,
Jason.

Re: Rendering basics - some pretty heavy questions.

Posted: Fri Feb 18, 2011 2:34 pm
by Mihai
Just to clarify things more, when I mentioned highly reflective surfaces - these would include also surfaces with a high brightness that can reflect light in a diffuse way - so all light in Maxwell really is reflected light. What we're used to calling reflective surfaces (mirrors, polished marble, metals) are specular reflective surface, vs diffuse reflective surfaces. This behavior is controlled simply by the roughness parameter, which is how it works in the real world. Take a rough marble plate, polish it, it will look totally different just because its surface is now reflecting back the light in a more specular way - more focused way. But it's still the exact same marble material.

You can try adding big dark surfaces on the walls to the back of your camera, but the question is the same - if in reality this lobby had huge black painted walls, wouldn't the lighting change a lot in the rest of the lobby? It would, so you might save a bit on the render time (in practice I don't think that much time actually) but have a false representation.

Re: Rendering basics - some pretty heavy questions.

Posted: Fri Feb 18, 2011 9:48 pm
by zdeno
Cosmasad wrote:... but would it help to have some black surfaces off camera to catch some of the bouncing light you refer above the way music engineers have absorbent material in a sound studio to absorb some of the sound? These could be simple rectangular planes that have a black velvet-like material on them strategically placed off camera so they catch some of the bouncing light without actually being in the rendering.
done that tests on 1.7.1 hidden for camera and for reflection&refraction , just pure GI trap .

but there was no great improvement, only with interior lighted with sun&sky have any impact. see riddle vol.5
http://www.maxwellrender.com/forum/view ... a&start=42

not deep tested on 2.x version

Re: Rendering basics - some pretty heavy questions.

Posted: Sun Feb 20, 2011 5:40 pm
by Cosmasad
Dear Mihai, I am trying to juggle two points that you make:
“You can try adding big dark surfaces on the walls to the back of your camera, but the question is the same – if in reality this lobby had huge black painted walls, wouldn’t the lighting change a lot in the rest of the lobby?” and –
“… an interior render will take longer to render compared to an exterior because Maxwell has a lot more calculations to do, the light keeps bouncing around different surfaces, as opposed to an exterior render where most light rays bounce between surfaces a few times before going out into infinity and Maxwell doesn’t care about them anymore.”
I think that you are right about the first. A black surface positioned behind the camera to absorb some of the light WOULD alter the look of the render because it WOULD be reflected in the polished surfaces of the lobby (marble floor, floor to ceiling glass windows, metal trim etc.)

Your second point , however, is also good and makes me wonder if there is a way to set up an interior so some of the light does escape into infinity and doesn’t keep bouncing around the room. Okay, so maybe you could leave the wall off behind the camera – but you can only do that if the environment is off and there is no sunlight that would leak in… so how about if you built a tent out of black material somewhere off camera that would be far enough away from the lobby so that it wasn’t reflected in the lobby materials but would still allow the light to “escape”. This tent would be a kind of light trap, but because it would be far enough from the lobby it wouldn’t affect the look of the render. It would be connected to the lobby by a “dummy lobby” whose purpose would be to just keep the sunlight from leaking in from a direction where it doesn’t belong.

What do you think?