This shows you the differences between two versions of the page.
brazil:lightoptions [2016/03/22] |
brazil:lightoptions [2020/08/14] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Brazil Light Options ====== | ||
+ | |{{: | ||
+ | |||
+ | =====Brazil rendering system lights===== | ||
+ | |||
+ | > **Summary: | ||
+ | |||
+ | ====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: | ||
+ | |||
+ | |||
+ | |||
+ | - Point lights | ||
+ | - Spot lights | ||
+ | - Directional lights | ||
+ | - Rectangular lights | ||
+ | - Linear lights | ||
+ | - Ambient light | ||
+ | |||
+ | |||
+ | All these can be translated into Brazil light types. Unfortunately, | ||
+ | |||
+ | |||
+ | |||
+ | 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, | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | | 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, | ||
+ | | {{: | ||
+ | | 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 ' | ||
+ | |||
+ | |||
+ | |||
+ | ====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==== | ||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | |||
+ | ====Parallel lights==== | ||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | |||
+ | ====Area lights==== | ||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | |||
+ | ====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: | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | | 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. | | ||
+ | | {{: | ||
+ | | 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==== | ||
+ | |||
+ | | {{: | ||
+ | |||
+ | 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 [[http:// | ||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | |||
+ | ====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: | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | | Linear 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: | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | | Hotspot = 5, Falloff = 10 | Hotspot = 10, Falloff = 25 | | ||
+ | |||
+ | | {{: | ||
+ | | 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/ | ||
+ | |||
+ | |||
+ | |||
+ | 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 [[http:// | ||
+ | |||
+ | |||
+ | | {{: | ||
+ | | 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' | ||
+ | | {{: | ||
+ | | 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 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 " | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | |||
+ | The above diagram represents a 2D section through a rendering scene. If we are interested in the shadow on the groundplane, | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | The region **B**~**C** still represents complete visual obstruction, | ||
+ | |||
+ | |||
+ | |||
+ | ====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' | ||
+ | |||
+ | |||
+ | | {{: | ||
+ | |||
+ | |||
+ | 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). | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | | 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: | ||
+ | |||
+ | |||
+ | |||
+ | | {{: | ||
+ | | 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: | ||
+ | |||
+ | |||
+ | | {{: | ||
+ | | [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | ====Projectors==== | ||
+ | |||
+ | Instead of emitting a single color, lights can also emit a texture. This is called a [[http:// | ||
+ | |||
+ | |||
+ | | {{: | ||
+ | | 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. | |