Site Tools


Brazil Light Options

Brazil rendering system lights

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 light source or it becomes completely black (unless you're using special non-photorealistic materials such as Toon). There are several ways of introducing light into a 3D scene. All are covered in these wiki pages.

Light integration

The most obvious way of lighting a scene is to add one or more light objects. Rhino has six different basic light objects:

  1. Point lights
  2. Spot lights
  3. Directional lights
  4. Rectangular lights
  5. Linear lights
  6. Ambient light

All these can be translated into Brazil light types. Unfortunately, there is no 1-to-1 correlation, partly because Brazil lights are far more flexible and not as limited to a 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. 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 color 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 above image this target has been specified. A target essentially defines a direction for the light. In Rhino it doesn't make sense to have a direction for a point light which, by definition, shines in all directions. But with the Brazil's added features, we need 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 physically correct falloff like Decay. Attenuation is defined by four radii values in which each 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 point lights 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 point light, 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) can have focus and attenuation associated with them. Here we see a cylindrical focus… …and here a point focus property.

Light types

As mentioned before, Brazil comes with several light types which partially overlap with the Rhino lights. Point lights in Brazil represent Point and Spot lights in Rhino (depending on whether they have a focus or not). They can 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. So if you want to mimic windows, 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 are similar 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 color. Another source of light can be indirect lighting. This is what happens when an object is lit by a light source and consequently brightens other objects in its vicinity, or when the object is glowing to begin with.

Point lights

brazil_pointlight.jpg Point lights are simple entities. They emit light equally in all directions. You can change this behavior by assigning a focus value to a point light, turning it into a spot light. See the section on Focus for more details. This point light has been given a sphere-area radius, making the shadows soft.

Parallel lights

brazil_parallellight.jpg 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

brazil_arealight.jpg Area lights, either circular or rectangular, are far more computationally expensive than 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.

Environments

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 color in the Luma server, but you can use the current environment as the sky light emitter:

brazil_skylight_cyanband.jpg brazil_skylight_spectrumband.jpg
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), showing more clearly which part of the sky lights which part of the model.
brazil_skylight_texture.jpg brazil_skylight_imageandsun.jpg
When we replace the abstract environment texture with an actual photograph of a sky, the result is less extreme but 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.

Light emitting objects

brazil_indirectballs.jpg

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 can 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. Some of the light escapes through the top faces of the columns, something which is not possible with completely opaque materials.

brazil_indirectgisss_10.jpg

Focus

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 point light it emits light equally strong in all directions. But once you assign a point focus, the emission is 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 is completely unlit (as though there is no light). 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:

brazil_linearfocus.jpg brazil_cubicfocus.jpg
Linear focus gradient Cubic focus gradient

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 sky light + spot light 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:

brazil_spotlight5_10.jpg brazil_spotlight10_25.jpg
Hotspot = 5, Falloff = 10 Hotspot = 10, Falloff = 25
brazil_spotlight20_45.jpg brazil_spotlight45_60.jpg
Hotspot = 20, Falloff = 45 Hotspot = 45, Falloff = 60

Shadows

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 the possibility to intervene at every stage in the process, giving 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.

brazil_pointlight_sharpshadows.jpg brazil_pointlight_softedgeshadows.jpg
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. But the resulting shadows are 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 is a satisfactory shadow type, but when it comes to detailed scenes, we should probably use something a bit more advanced.
brazil_pointlight_spherearea01.jpg brazil_pointlight_spherearea10.jpg
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.
brazil_arealight_areashadows.jpg brazil_arealight_vertical.jpg
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 light source 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 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.

Point vs. area shadows

The two most useful shadow types in Brazil (officially they are called “shadow shaders”), behave very differently. 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 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. With Sharp Ray shadows, a line segment from P to the light is constructed. Brazil will intersect it with all geometry to see whether 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 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.

Decay and attenuation

A light source in the real world (such as the sun) 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. They now define a sphere with a total surface area of 3×10^17^ square meters, indicated by the orange semi-sphere in the left 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 right 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).

Curiously, we are comfortable working with virtual light sources that do not exhibit this property. Up to Rhino 4 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 behavior 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 when the little rascal gets stuck at the edge of the screen).

brazil_nodecay.jpg brazil_inversedecay.jpg brazil_inversesquaredecay.jpg
The default for lights in Brazil is not to have decay enabled. The torus in this image is lit by a sky light and a single point light 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. Lumberton shading states that surfaces which are lit perpendicularly are brighter than surfaces which are lit at an angle. When we enable decay for the point light, 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. But because inverse square decay tends to be extremely sharp, we have this option. 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 was visible in this scene, which is a testament to the strength of the brightness decay in inverse square setups.

Attenuation

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 you need to darken it. Attenuation is like 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:

brazil_attenuationfar.jpg brazil_attenuationnear.jpg brazil_attenuationboth.jpg
Here, the fade-out attenuation has been set. The distances that define the fade-out domain are very close together, accentuating the physical incorrectness of the effect. Fade-in attenuation only. And both combined.

A word about blending: When 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. 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.

Projectors

Instead of emitting a single color, lights can also emit a texture. This is called a projection.

brazil_noprojector.jpg brazil_bitmapprojector.jpg
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.
brazil_proceduralprojector.jpg brazil_doubleprojector.jpg
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.
brazil/lightoptions.txt · Last modified: 2016/03/29 by sandy