Summary: This page discusses the settings for light objects in Brazil r/s 2.0 for Rhino
* Let there be light
A rendering needs a source of light or it will become completely black (unless you're using special non-photorealistic materials such as Toon) and there are cheaper ways of making black bitmaps than purchasing Brazil. There are several ways of introducing light into a 3D scene, all of which will be covered in these Wiki pages.
The most obvious way of lighting a scene is to add one or more light objects. Rhino has six different basic light objects:
all of which can be translated into Brazil light types. There is no 1-to-1 correlation unfortunately, partly because Brazil lights are far more flexible and thus less limited to some kind of base light geometry. In fact, a single light object in Brazil can behave as a rectangular light when it comes to emitting photons but it can behave as a pointlight when it comes to casting shadows. There's a lot to learn about lighting in Brazil and it's an important topic, you need to learn the basics if you expect to make well balanced images.
Brazil for Rhino mimics the Brazil-for-3DMax interface for light objects and it also draws feedback in the viewports for some of the settings (such as attenuation, focus and area parameters):
|When we add a regular point light to a model, we get a light with default properties (no shadows, no focus, no target, no decay, no attenuation, no projection, no photon maps, no nothing, except for a colour and a brightness). It looks just like a normal Rhino point light and it behaves in the same way.||All light objects in Brazil can have a target associated with them. In the image above this target has been specified. A target essentially defines a direction for the light. In the context of Rhino it makes no sense to have a direction for a point light which, by definition, shines in all directions, but with the added features of Brazil, we need to be able to specify a target. Also, this screenshot shows the Radius value of this particular light.||Another Brazil light property which has no precedent in Rhino is attenuation. Attenuation controls the influence of a light object as a function of distance, but it is not a physical correct falloff like Decay. Attenuation is defined by four radii values each of which is represented by a partial sphere.|
|Brazil does not distinguish between point and spotlights, which may come as a surprise to old school Rhino users. In Brazil, a point light with a focus automatically becomes a spotlight. This screenshot shows the same light as before (originally a point light), but with a specific focus. Now we see why it is important for pointlights to have a target direction, it defines where the focal cones are pointing. Focus is defined by an inner and outer radius, called Hotspot and Falloff respectively.||An area light has a different geometry than a pointlight, and thus the shape of the focus 'cones' is different. Brazil lights by default use the same shape for the focus and shadow properties as the light geometry, but you can override these to be anything you like.||Another type of area light in Brazil (one which does not exist in Rhino) is the circular area light. Again, it results in a different focus cone.|
|Even directional lights (called 'parallel' in Brazil terminology) can have focus and attenuation associated with them. Here we see a cylindrical focus…||…and here a point focus property.|
As mentioned before, Brazil comes with a number of light types which partially overlap with the Rhino lights. Point lights in Brazil are used to represent Point and Spot lights in Rhino (depending on whether they have a focus or not) and they can be used to simulate nearby light sources such as lamps and incandescent objects (though it is also possible to have actual incandescence). Area lights are typically used to represent large glowing surfaces (such as windows or indirectly lit walls) since the light originates from a finite surface instead from within a singularity. A special case of area lights are light portals which restrict the environment lighting to only pass through certain specified areas. Thus, if you really want to mimic windows then using a portal+sky setup is preferable. Parallel lights in Brazil mean the same as directional lights in Rhino, they are used for remote light sources such as the sun or moon, or just a guy with a flashlight across the street.
Skylight or environmental light can be likened to ambient lighting, except it is much more advanced. For one, skylight actually casts shadows, plus it is usually combined with a texture instead of just a single colour. Another source of light can be indirect lighting, which is what happens when an object is lit by a lightsource and consequently brightens other objects in its vicinity, or when the object is glowing to begin with:
|Point lights are simple entities, they emit light equally in all directions. You can change this behaviour by assigning a focus value to a pointlight, turning it into a spotlight. See the section on Focus for further details. This pointlight has been given a sphere-area radius making the shadows soft.|
|Parallel lights behave slightly different from the ones in Rhino. For one, it is possible to assign a specific shadow type to a parallel light which depends on the actual location of the light object in space. Parallel lights in Rhino can be positioned anywhere since only their direction is taken into account by the native renderer.|
|Area lights, either circular or rectangular are far more computationally expensive that point or parallel lights. Instead of a single coordinate, Brazil has to solve the exposure of a certain part of the 3D scene for a finite surface, the resulting image is also likely to contain more “grain” or “noise”. However, area lights give a far more realistic lighting. A special case of area lights are light portals, which have the same shape as area lights but instead of emitting light, they channel existing light.|
Environmental light (or sky light) is the added effect of a surrounding light source at an infinite distance. Under normal conditions, the ground obscures half of the skydome so we're only really used to seeing the upper half. Sky light provides a good dose of realism in lighting setups without the need to resort to Indirect Illumination. By default the sky light is set to a blueish colour in the Luma server, but you can use the current environment as the sky light emitter:
|This scene is lit by an environment texture (black with a single blue band, as visible in the reflective sphere). Since the brightness is very concentrated (as opposed to a diffuse, monochromatic sky dome) we get a very pronounced environmental shadow.||In this image, the cyan band has been replaced by a spectrum gradient (blue at the zenith and red at the horizon), thus showing more clearly which part of the sky lights which part of the model.|
|When we replace the abstract environment texture with an actual photograph of a sky, the result is far less extreme but also much more realistic.||Since I used a photograph of a clear sky, I should also add a light object which simulates the sun. A blueish sky light + yellowish sun light tends to give very familiar palettes for outdoor scenes.|
|Since Brazil is capable of GI lighting you can theoretically use glowing geometry instead of light sources. Non-biased render engines such as Maxwell Render and Fry Render use this approach which means that A the resulting lighting is very realistic and B the process of solving these images is slow. Also, there is almost nothing you can do to tweak the behaviour of light in GI only scenes, things just happen like they would in the real world. The scene on the left contains a number of very bright, but coloured balls. Since the decay of these light sources is physically correct, we get very intense little islands of brightness which may be undesirable. @@[Newline, “·” ,Newline]@@ The four images below are other examples of GI only lighting. The bright column has a brightness of 1.0, 2.0 and 10.0 respectively and the light is allowed to bounce three times before the sampler terminates. The final image uses a Wax material instead of a Lambert meaning the GI lighting also propagates through the blocks instead of just bouncing off the walls. As you can see some of the light in fact escapes through the top faces of the columns, something which is not possible with completely opaque materials.|
It is possible to specify focal cones for all light objects in Brazil (except sky light). The focus cones control the brightness of the light in a specific direction. For example, if you have a pointlight it emits light equally strong in all directions. But once you assign a point focus, the emission will be limited to a certain cone. This focus cone is defined by two angle values, hotspot and falloff. Everything inside the hotspot is completely lit (as though there is no focus), and everything outside the falloff cone will be completely unlit (as though there is no light). In between these two cones there is a luminance gradient. The change in luminance can either be linear or cubic cubic giving the best visual result:
Points A and D mark the ends of the falloff cone, outside if which the effect of this light is 0%. Points C and B mark the hotspot domain, inside which the effect is 100%. The bar below the graph represents the luminance gradient of a white light illuminating a white Lambert material.
The following four images show a skylight + spotlight setup with different focal angles. Note that a focus cone will diminish the total amount of energy emitted by a light; it will not amplify the brightness inside the hotspot:
|@@[“Hotspot = 5°” ,Newline ,”Falloff = 10°”]@@||@@[“Hotspot = 10°” ,Newline ,”Falloff = 25°”]@@|
|@@[“Hotspot = 20°” ,Newline ,”Falloff = 45°”]@@||@@[“Hotspot = 45°” ,Newline ,”Falloff = 60°”]@@|
Brazil lights can all have shadow shaders associated with them. There are different types of shadows, and different implementations per type. I realize it can all get a bit unwieldy at times, but you should remember that Brazil was made with maximum flexibility in mind. Unlike Maxwell Render, which aims for minimum user interaction and thus usually has very short setup times, Brazil offers its users the possibility to intervene at every stage in the process, giving them complete control over every aspect of the rendering. For some people the minimum-effort-maximum-quality approach works best, others are more comfortable with the maximum-control-i'm-responsible-for-whatever-happens way of things. It is no wonder Brazil is used mostly in professional environments where its users can afford to invest time and effort into mastering the product.
Where were we? Ah right, shadows. So, Brazil lights can all have shadow shaders associated with them. I'll briefly highlight them in the following table. These are all different implementations of the Brazil2 Ray Shadow type. Brazil can also use Shadow maps for example, which are based on a completely different paradigm, but these do not yet work in the current Beta.
|By default, lights do not have shadows at all. Shadow casting needs to be specifically enabled per light. When you check the Shadow box in the light properties, sharp ray shadows are enabled, giving you the result above. (You're looking straight down at a ground plane with a perforated wall just below the image. There is a light source on the other side of the wall, shining through the holes and illuminating patches on the ground plane.) Sharp ray shadows are quick to compute and very accurate, but they tend to be a bit unrealistic since we're used to shadows which have soft edges.||Brazil also has a soft edge shadow shader, which too is very fast. However, the resulting shadows are simply blurred, regardless of how far away they are from their obstruction. As you can see, all the illuminated patches are equally fuzzy around the edges. In some cases (such as large scale urban models) this would be a satisfactory shadow type, but when it comes to detailed scenes, we should probably use something a bit more advanced.|
|Area shadows take into account the size of the light source and compute a shadow according to the amount of obstruction of this source. The shape of the light source is defined by geometry (rectangle, circle or sphere) and size (in model units). (See the section below this table for an explanation of area shadows.) The image above was made with a spherical light source with a radius of 1.0 unit.||This time the radius of the sphere has been increased to 10.0 units. These images show how shadow edges become more fuzzy as the distance from the edge to the obstructing object increases.|
|If we use a rectangular light source shape, the resulting patches get a bit messier. Since the holes in our wall are fairly small, they act as pinhole cameras, projecting an inverse of the lightsource onto the groundplane. They are not small enough for an accurate projection though so we are left with splotches halfway between circles and rectangles.||If we use a very unsquare rectangle though, the difference becomes striking. Here, the light source is a very thin, but very high rectangle, which means the amount of horizontal blurring is minimal (the light is thin enough in this direction to resemble a sharp shadow) while vertical blurring is through the roof.|
The two most useful shadow types in Brazil (officially they are called “shadow shaders”), behave very differently and you should understand the inner workings so you can put them to good use. The easiest one is Sharp Ray shadows, which performs a single shadow cast test for every obstructing object: when a ray-tracing ray hits a certain surface at point P, it needs to know the sum total of all lighting at that location. It will iterate through all the light objects in the model and asks them each in turn what effect they have on P. In the case of Sharp Ray shadows, a line segment from P to the light is constructed and Brazil will intersect it with all geometry to see whether or not the light is “visible” from P. Since only a single coordinate is evaluated, the answer is either yes or no, light or shadow:
The above diagram represents a 2D section through a rendering scene. If we are interested in the shadow on the groundplane, we will find that everything between A and D is completely inside the shadow of the tube object. A~D defines the region where the light source is completely obstructed by the tube. If we replace the point light source with an area, we can suddenly get many answers:
The region B~C still represents complete visual obstruction, but from the adjacent regions A~B and C~D the light is partly visible. The amount of the light area that is visible, determines the brightness of the light. The larger the radius of the sphere, the smaller B~C becomes and the larger A~D becomes.
A source of light in the real world (the sun, say) emits a certain amount of photons per time interval. The added energy of all these photons totals the brightness of the star. Since all light particles travel at the same speed, all the photons that left the surface of the sun at 7 o'clock in the morning will have travelled about 300 million meters in all directions during the first second and they now define a sphere with a total surface area of 3×10^17^ square meters, which is indicated by the orange semi-sphere in the leftmost picture. Three seconds later the total surface area of the photon wavefront is about 4.5×10^18^ square meters (the orange semi-sphere in the rightmost image) which is effectively 15 times larger. Yet the total number of photons hasn't changed, meaning that the larger sphere has a much lower light density than the smaller sphere. Since we are talking about a surface area (square meters), the speed at which light becomes weaker is proportional to the inverse square of the distance travelled. This is called decay and all radiating light in the physical universe obeys this rule (laser for example does not, since all photons are travelling along parallel paths).
It is therefore a curious fact that we are very comfortable working with virtual light sources that do not exhibit this property. Up to Rhino4 all lights in Rhino renderings did not have decay, nor do the lights in the viewport, nor does Flamingo. We have become so used to this other class of light behaviour that its physical impossibility no longer bothers us (just as we have become used to grabbing things with a mouse cursor, I repeatedly attempt to adjust the volume on my stereo set with the mouse, only to be baffled each time by the fact that the little rascal gets stuck at the edge of the screen).
|The default for lights in Brazil is not to have decay enabled. The torus in the above image is lit by a skylight and a single pointlight without decay. The fact that the groundplane near the point light location is brighter than the groundplane near the edges of the image, has got nothing to do with decay, but is a result of the Lambertian shading which states that surfaces which are lit perpendicularly are brighter than surfaces which are lit at an angle.||When we enable decay for the pointlight, the brightness of the overall image decreases significantly. In this case, the decay is not inverse square but inverse linear, which is not physically correct. However, we have this option because inverse square decay tends to be extremely sharp. Note how the far end of the torus is much darker, even though it is lit perpendicularly.||Finally, inverse square decay. I had to pump up the brightness of the light source to 5.0 or nothing at all was visible in this scene, which is a testament to the strength of the brightness decay in inverse square setups.|
Another method of controlling the brightness of a light source at a distance is attenuation. This, too, is a physically incorrect effect, but it can come in handy when a scene is over-exposed and needs to be darkened. Attenuation is fairly similar to focus, except that the brightness gradient is specified by distance rather than angle. With attenuation you can control both the fade-in and fade-out luminance gradients:
|Here, the fade-out attenuation has been set. The distances that define the fade-out domain have been chosen very close together, accentuating the physical incorrectness of the effect.||This time fade-in attenuation only.||And both combined.|
A word in edgeways about blending. Whenever there is a transition (gradient) in a Brazil property, you will often see a Linear vs. Cubic blend option. Although linear is the default in most cases, cubic tends to give better results. The problem is similar to G~0~ / G~1~ geometrical continuity, with which you may be more familiar. In the graphs below you see both blending algorithms. We are blending the values 0.0 and 1.0. Every point left of A is zero and every point right of B is one. In between A and B however, we are free to define the gradient as we please:
|Linear interpolation treats the gradient between A and B as a straight line segment. This line segment is G~0~ continuous with the graph outside the A~B domain.||Cubic interpolation defines a smooth curve, which is actually G~1~ continuous (tangency). This is a far more natural blend.|
Instead of emitting a single colour, lights can also emit a texture. This is called a projection
|Reference image, there is no projection specified.||A bitmap image has been designated as the projection texture. Note that the orientation of the light object defines how the image is projected.|
|Here, we are projecting a procedural texture.||And this is a setup with two point lights, both of which project a different procedural. Note the absence of one stripe pattern in the shadow areas.|