Lighting 3d max mental ray. Mental Ray GI: interior lighting. Setting up a scene for rendering gemstones in mental ray

3ds Max 2013 has several light sources designed to work with the visualizer mental ray:

mr Area Omni;

mr Area Spot;

mr Sky Portal (Sky portal by mr).

Note. Sources mr Sky (Sky mr) And mr Sun (Sun mr) mut to be used in the system daylight Daylight.

All specialized sources contain a parameter roll mental ray Indirect Illumination. This scroll is available in the panel Modify(Fig. 23.11).

When checked Automatically Calculate Energy and Photons pro-

gram will use general lighting parameters for calculations.

Rice. 23.11. Scroll mental ray Indirect Illumination

Parameter group Manual Settings is intended for setting lighting settings manually and contains the following parameters:

Energy – sets the initial energy of emitted photons;

Decay – determines the degree of energy dissipation by photons when moving in space;

Caustic Photons – regulates the level of caustic photons;

GI Photons (Global Illumination Photons) – determines the number of photons to calculate global illumination.

Algorithms for calculating visualizer lighting mental ray based on the physical properties of light particles - photons. Each light source emits a stream of photons, which spread in space and are reflected from objects, losing part of the energy. At the end of its path, the photon is absorbed by the surface. This algorithm is called Global Illumination.

Another important property of illumination calculation algorithms mental ray is the creation of caustics. Caustics in optics they call chiaroscuro created by the refraction of light on the surfaces of opaque objects. In the real world, caustics are easy to spot on the walls and ceiling of a swimming pool.

In the dialog box There is a tab mental ray to configure special lighting parameters (Fig. 23.12).

In the parameter group Caustics and Global Illumination contains the following object properties:

Exclude Caustics;

Generate Caustics;

Receive Caustics;

Exclude from GI;

Generate Global Illumination;

Receive Global Illumination.

Rice. 23.12. Tab fragment mental ray dialog box

Object Properties

Note. In complex scenes, you can disable indirect lighting properties for some objects to speed up rendering.

To configure general parameters of global illumination, caustics and visualization filters, use the tab Indirect Illumination dialog box Render Setup. This tab contains a scroll to configure expression filtering (Fig. 23.13) and scroll to set special lighting parameters (Fig. 23.14).

In the parameter group FG Precision Presets (Refinishing Assembly Quality Samples) scroll Final Gather The following sets of filtering settings are available: Custom, Draw, Low, Medium, High

(High), Very High. These sets are changed by moving the slider.

Parameter group Basic contains basic settings for calculating illumination. Field Multiplier is intended for setting the intensity and shade of reflected light.

Rice. 23.13. Options scroll Final Gather

Rice. 23.14. Options scroll Caustics and Global Illumination (GI)

This scroll also contains Extra options depth of tracing and image filtering.

Note. When activating the visualizer mental ray The main rendering quality settings appear at the bottom of the dialog box of the rendered frame.

Scroll Caustics and Global Illumination (GI) contains a group of parameters Caustics to configure the caustics created.

Checkbox Enable includes caustic parameters in visualization aorhythms (Fig. 23.15).

Rice. 23.15. Teapot with caustics

Parameter Maximum Num. Photons per Sample determines the number of photons counted for each sample. As the value of this parameter increases, the visualization time increases significantly, but the image becomes smoother.

Field Maximum Sampling Radius specifies the radius of photon propagation.

Group Global Illumination contains similar options for adjusting global illumination.

Parameter group Geometry Properties contains a checkbox All Objects Generate & Receive GI and Caustics (All objects create and receive global illumination and caustics). When this checkbox is checked, global illumination and caustics parameters will be calculated for all objects in the scene, ignoring the object properties settings of the dialog box Object Properties.

When creating open scenes with global environment parameters and source Daylight It is recommended to use a map as the external environment mr Physical Sky (mental ray). This map allows you to create a realistic background that displays the horizon, the vault of the sky and the movement of the sun (Fig. 23.16).

Rice. 23.16. Scene using a map mr Physical Sky (mental ray)

Create volumetric light in Mental Ray using 3D Max.

First step. Installing Mental Ray Renderer.

First you need to install mental ray to our editor. This is done as follows: open Rendering (in the main menu) > Render Setup... > Common Tab > Assign Renderer Stack > Production > mental ray Renderer. All now the basic Scanline render has been replaced with mental ray.

Second step. Geometry for rendering.

Volumetric light will not look good in an empty scene; you need to create a simple blank. Let this be a model of a house with small windows. Let's start with a basic Box primitive, open Create panel > Geometry > Standard Primitives > and select Box. Now we can give it the following parameters:

Third step. Let's create windows.

In order for volumetric light to enter our home, we need windows! Now let's add modifiers to the Box object. Follow the path Modify panel > Modifier List > Object-Space Modifiers > here activate Edit Poly. In the Right window you can activate editing at the polygon level, do this and delete two polygons on our house, these will be the windows.

It's time to activate the geometry change at the vertex level, let's change our house a little, making the windows lower and wider. You can do it like in our picture or experiment on your own.

In fact, the geometry is ready, all that remains is to flip the normals, this is done as follows:

1) Activate the polygon mode.

2) Select all polygons using the hotkeys CTRL + A.

3) Open the modify panel, look for the Edit Polygons stack there and click on the Flip button.

After flipping the normals, our structure became black externally, but this is normal, because our working area will be the interior.

Fourth step. Let's add a camera.

Now we need to add the main camera to the scene. Open Create panel > Cameras > Target, install the camera. It is best to install the camera in a top view window, but you can use any window for this. You need to rotate the camera so that the windows are visible.

The camera also needs to be configured, set the Lens parameter to 20mm. All that remains is to change the view to the image from the camera, just go to the perspective window and press the C key.

Fifth step. Working with materials.

We need to assign the necessary materials, to do this, open the Material Editor, just press M on the keyboard. We will have a list of materials in front of us, we advise you to immediately learn how to name them accurately, for example, call it warehouse. While you have few materials, this is not very significant, but then, when there are 20-30 materials, you will simply get confused.

  1. First of all, click Get Material or Standard, and in the list that opens, select the Arch & Design (mi) material.
  2. Now let's activate the warehouse by selecting it in the projection window and applying our material to it.
  3. Adjust the Reflectivity parameter by setting it to 0. After all, shine is inappropriate in our house.

You can add bump for a more realistic display.

  1. In the material properties, look for Bump and in the Standard rollout set the Composite parameter.
  2. Let's add a layer, the button is located not far from Total layers. Usually the first layer (Layers 1) is the Smoke base map. However, you need to adjust the parameters:

# Iterations: 20

Color #1 – black

Color #2 – dark gray RGB 50, 50, 50

  1. Let's add a second layer with the Speckle map and also correct the parameters:

Color #1 – light gray RGB 180, 180, 180

Color #2 – black

Now you need to configure the Diffuse map, go to Maps > Standard > Bitmap > concrete-texture-high-resolution.jpg.

In fact, the main volume is done, you can create a render and enjoy the result. It's still intermediate, but you should get it like in the picture.

Sixth step. Setting up the lighting.

It's time to add light to our building. To do this, you need to open mr Area Spot, it is located at Create panel > Lights > Standard > mr Area Spot. Create the light in the Front window, so it is better to position it from that point so that it passes through our windows. Having installed the light, we will achieve better results by editing the following parameters:

In the Spotlight Parameters suite, set Hotspot/Beam: 24 and Falloff/Field: 26.

In the General Parameters rollout, set Shadows: On (Ray Tracted Shadows).

You can do another intermediate render.

Seventh step. Creating an environment.

It's time to start creating the environment. You need to open Rendering > Environment and go to the background section:

  1. Click on "None" and activate the Glow card in the drop-down menu.
  2. Press M to open the material editor and drag our Glow map there. To drag, hold down the left mouse button. We use an empty slot and select Instance in the dialog box that appears. This is how we link the cards.

It remains to adjust the color, for Glow we will select pure white, set the brightness parameter to level 4, but you can adjust the brightness yourself according to the situation.

You can do another intermediate render. If everything is done as it should, the result will be as follows.

As you can see, our scene is gradually becoming more and more interesting. However, much more needs to be done. First, let's apply shaders to the camera, go along the path Renderer > Camera Effects stack > Camera Shaders > Output > Glare. In other words, we applied a Camera Shader to our Glare glow.

If you wish, you can make another render in order to fix the changes.

By the way, if you want to get a more intense glow, then simply link the Glare card to a slot in the material editor (M) and increase the Spread parameter.

Eighth step. Adding side lighting.

Now the only source of light on stage is our windows. It is necessary to add side lighting for better visibility of the scene. You need to follow the path Create panel > Lights > Standard > Skylight, creating a light. We immediately change the parameters in Make a selection > Modify panel, we are interested in Multiplier, it is better to set it to 1.5, however, small deviations from this value are possible, try it!

Now go to Create panel > Lights > Photometric > mr Sky Portal and add a few more lights. There may be some difficulties here; it is necessary to make our lamps exactly to the size of the windows and turn them with light into the room. Oh, and don't forget to make the Multiplier 1.5 or as much as you did to the Skylight.

As you can see, the light will become more natural; it will illuminate the space surrounding the window, namely, part of the ceiling and walls.

And despite everything, the room is still too dark. You need to fix this by adding more light, go to Rendering > Render setup... > Indirect Illumination tab > Final Gather stack. Here you need to set the following parameters: Multiplier to 2, and Diffuse Bounces to 5. You can do another intermediate render to evaluate the results. Let us remind you that if you are not satisfied with the intensity or brightness, you can safely change it, adjusting everything to your vision.

As you can see, it has become even brighter, the entire scene is already visible.

Ninth step. Create volumetric light.

Actually, we finally come to the topic of our lesson today. All preparations are completed, you can work on volumetric lighting! We will use the Volume Light effect, which is included in the render. We activate it along the path Rendering > Environment... > Atmosphere, now we follow this order of actions:

  1. By clicking on Add you need to select Volume light.
  2. Now click on Pick Light and select the mr area spot that we configured earlier. In more complex scenes, in order not to look for the lamp in the list of objects, just press the H key.
  3. Let's play with the light density by setting the Density parameter to 20.

You can render and enjoy volumetric light while in preview.

Tenth step. Final light settings in mental ray render

It is necessary to carry out the final adjustment of all our light. You can do it a little differently, setting other parameters or leaving everything as is, but we did it as follows. In Rendering > Render setup... > Indirect Illumination > Final Gather we lowered the Multiplier slightly from 1.5 to 1.4. However, these are games with light, they are individual, you can set completely different settings.

The render quality also needs to be improved. To do this, go to Rendering > Render setup... > Renderer > Sampling Quality and set it there:

Samples per pixel

Minimum setting to 4

Maximum parameter at 64

Filter select Type: Mitchell

Actually everything! You can carry out the final render and enjoy a great picture!

3ds Max includes special sources that simulate realistic daylight. They help set the daylight of the scene in a few clicks. But at the same time, they have sufficient flexibility, allowing you to customize parameters such as horizon height, sky color, atmospheric conditions, cloudiness, and even the exact geographical location. These light sources in combination are called Daylight system(Daylighting system).


Rice. 2.4.01 Example of an illuminated exterior Daylight system

While creating Daylight system, 3ds Max will prompt you to activate Exposure. A dialog box will appear in which you can activate it by pressing the button Yes(Yes). Or you can manually activate the exposure later. In addition, a request to create mrPhysical Sky as an environment.

Rice. 2.4.02 Exposure Activation Dialog Box

Rice. 2.4.03 Installation dialog mr Physical Sky as an environment

mental ray's daylighting system includes: mrSun Mr Sky and mrPhysicalSky(which will be discussed later in this section). Exposure control must also be taken into account. mrPhotometricExposureControl described earlier in this chapter.

Rice. 2.4.09 Setting time (left), and geographic location (right)

Select the map of the desired continent from the drop-down list Map(Map). The map image will update. Click on the location you need to set the desired map point. When installing a checkbox NearestBigCity(Nearest big city), then the pointer will be installed at the location of the city closest to the specified location from the list City(City) on the left side of the dialog box.

Daylight sources inmentalray.

Light sources and tools for simulating daylight in mental ray are: mr Sun, mr Sky, mr Sky Portal, shader mr Physical Sky.

To achieve the most realistic results, it is best to use all of the above components in the system Daylight, and in conjunction, for example, the parameter Red/ Blue Tint, which is present in the sun and sky light source, as well as in the environment shader mr Physical Sky. Each component is described later in the chapter.

On a note:Projection windows 3ds Max support interactive display of daylighting bundles,mr Sun Andmr Sky.

First, let's look at the parameters of the mr Sky light source separately.

mr Sky Parameters.

Source mrSky is a photometric omnidirectional light source (sky), which serves to simulate the diffuse light of the sky.


Rice. 2.4.10 Parameters mr Sky daylighting systems

On(On) Turns the light source on or off.

Multiplier(Multiplier) Light brightness multiplier. Default value 1.0 .

Ground Color(Earth color) The color of the “surface” of the earth.


Rice. 2.4.11 Examples of influence Ground Color for global illumination

On a note: Figure 2.4.11 shows the influence of the color of the earth on the reflected light on the walls of the house; in addition, the “surface” of the earth does not perceive shadows from objects in the scene.

SkyModel(Sky model) In this drop-down list you can select one of three sky models: HazeDriven,PerezAllWeatherCIE.

We will look at one of these models HazeDriven(Haze controlled).

Haze is a uniform veil of light that increases with distance from the observer and obscures parts of the landscape. It is the result of light scattering by airborne particles and air molecules.

Haze reduces the contrast of the image and also affects the clarity of shadows. see also AerialPerspective(Aerial Perspective) described later in this section.

Haze(Haze) The number of particulate matter in the air. Possible values ​​from 0.0 (absolutely clean atmosphere) to 15.0 (maximum “dusty”). Default value 0.0 .


Rice. 2.4.12 Parameter influence Haze on the atmosphere of the scene: 0.0 (left) ; 5.0 (center); 10.0 (right)

mrSkyAdvancedParameters(Advanced mr Sky options)


Rice. 2.4.13 Additional parameters mr Sky

Horizon(Horizon)

Height(Height) The height of the horizon line, negative values ​​lower the line, positive values ​​raise the horizon line. Default value 0.0


Rice. 2.4.14 Horizon line height: 0.0 (left); -0.6 (right)

On a note:Horizon height only affects the visual appearance in the light sourcemrSky. In addition, the hue of the horizon also depends on the light sourcemrSun.

Blur(Blur) Blurs the horizon line. A higher value makes the horizon blurrier and less obvious. The default value is 0.1.


Rice. 2.4.15 Horizon blur: 0.2 (left); 0.8 (right)

NightColor(Night Color) Minimum sky color "value": meaning the sky will never be darker than the color value set here.

NonphysicalTuning(Not physical settings)

Using the parameter of this group, you can artificially tint the color of the sky with cool or warm shades to give the image a more artistic look, as opposed to a photorealistic image.

Red/BlueTint(Shades of Red/Blue) The default value is 0.0, which is physically correct (has a color temperature of 6500K). By changing the value to -1.0 (rich blue), to 1.0 (rich red) you can adjust the color of the sky to give the sky the color you want.

AerialPerspective(Aerial perspective)

Aerial perspective is a natural phenomenon when, as objects move away from the eyes of the observer or camera, the clarity and clarity of outlines disappear. Objects at a distance are characterized by a decrease in color saturation (the chiaroscuro contrast softens and the color loses its brightness). That. the background appears lighter than the foreground.

The phenomenon of aerial perspective is associated with the presence in the atmosphere of a certain amount of dust, moisture, smoke and other small particles. see also Haze(Haze) described above.

Checkbox AerialPerspective(Aerial perspective) This checkbox enables the display of aerial perspective.

(Visible distance) This counter indicates the distance of influence of aerial perspective and the range of visibility of objects.

I want to start a series of tutorials on lighting in mental ray. This lesson is devoted to Final Gather, settings for the indirect lighting calculation algorithm, light sources, luminous materials and HDRI maps. The purpose of the lesson is not to create a specific scene, but to consider the general provisions and settings of secondary lighting; all scenes used are of a test nature and have the task of emphasizing a certain effect, usually to the detriment of appearance. The lesson is designed for max 2008 and higher and has example scenes for downloading.

Introduction

First, some necessary information

In mental ray, lighting, according to the calculation algorithm, can be divided into 4 parts:
1. direct tracing (scanline + ray trace).
2. Photon-Based Indirect Illumination (GI + Caustics)
3. Simplified indirect lighting (Final Gather)
4. Lighting in volumes (ray marching).

Note: I do not claim the correctness of the Russian-language interpretation of the terms, since there are many variants of translations of help and lessons and I did not intend to take them as a basis. Often GI and caustics are separated, since different photon maps are used for them, and lighting in volumes is included in GI, due to the fact that it also uses photon maps, not taking into account that a completely different engine starts working and not everything is done there with photons (2 levels of calculations are used, while the second, simplified one does not use photons)

About direct lighting:

Direct lighting means illumination from the emitter of the light source to the surface of the object, after meeting the surface of the object, based on the surface shaders (Surface) and shadow shaders (Shadow), the illumination map and shadow map of the object are calculated. Additionally, shaders from the Extended Shaders group (surface displacement, environment) are taken into account. In this case, part of the rays is absorbed, and part (if the object is semi-transparent, reflective) is calculated to the next object in the scene. There is no penetration of rays into the volume of the object; the glow effect (illumination, glow) is taken into account only for the diffuse properties of the object and does not apply to other objects. GI, Caustic and Volume Photon photons are not generated.

Now let's look at the render settings, which affect the quality of the rendering as a whole. These settings are valid regardless of whether GI and FG are enabled

Sampling Quality: The parameters of this group allow you to configure supersampling, designed to eliminate the effect of broken lines, stepped gradients and all artifacts arising from the aliasing effect.

To parameters Samples per Pixel — minimum and maximum set the number of rays per pixel for adaptive supersampling to work, I will not go into the principle of operation of this algorithm (it’s easy to find theoretical information on the Internet if you wish).

In practice, the higher the value, the better, but rendering time increases almost in proportion to the increase in values, so for scene preview it is advisable to set low values ​​(but the maximum value should be at least 2), and increase it for the final calculation.

Parameter group Contrast , regulates the decision-making algorithm used to calculate the minimum or maximum value of Samples per Pixel, values ​​are set from 0.004 (1/256) to 1 and in increments of 0.004 - the smaller the better, but it also affects the rendering speed.

Filter - the simplest and fastest filter is box, and the best and slowest filter is mitchel.

Below parameters Rendering Algorithms — of which the most necessary is the tracing depth Trace Depth

Reflection— the maximum number of reflections of a photon, after which it disappears

Regraction- the same for transparency and the value of the maximum amount of effects - max. depth.

Simply put, if you place two mirrors on the stage, “facing” each other and a camera looking between the mirrors, you will get the depth of “infinity” of reflections according to the established parameters.

The main practical meaning of these settings is that during the creation of the scene, set low parameters for fast rendering, and at the final stage increase them to acceptable sizes.

Sources of light:

In mental ray, light sources are divided into:
- standard the intensity of light from which decreases in direct proportion to distance and is not physically accurate
- improved standard (postscript mr), from which the shadows are calculated, using an improved algorithm and it is softer.
- photometric The intensity of light is specified in physical quantities and the attenuation of light is also considered physically correct. The use of photometrics is relevant when the scene scales comply with metric values.

Part One Final Gather

Final Gather — a simplified algorithm for calculating indirect lighting, consists in the fact that from each point of collision of a photon with a surface, rays are randomly emitted that intersect with neighboring objects in the scene (but only once). As a result, FG gives a simplified view of indirect illumination, due to a single reflection of light, but is much faster than a full-fledged GI, and gives a very real picture. With GI enabled (FG+GI), the calculation algorithm changes and the calculation occurs as completely as possible in mental ray, but of course, time...

So let's look at what can be achieved using FG:

First, let's enable the FG algorithm - Rendering > Render... (F10) > Indirect Illumination > check Enable FG

The main settings for adjusting the FG quality are the step with which reference points are placed to calculate secondary lighting - the Initial FG Point Density parameter - the smaller the step, the better the picture will be, and the Rays per FG Point parameter is the number of rays emitted from one point, than the more the better.

The MR developers have made several ready-made profiles that can be selected from the “Preset” drop-down list; you can choose from Draft (low quality, fast rendering), for viewing scenes during the creation process, and up to high – for final calculations.

Let's start testing FG with an interior scene.

I made a simple scene showing a room with a window and a few lamps. The colors of the walls, ceiling and floor are specially gray - it turned out gloomy, but the lighting effects will be better visible this way

This is what the room looks like without FG turned on, with a temporary light source (after FG is turned on it will be removed)

On the left are two lamps that are not full-fledged light sources, but their material is represented by a mental ray material, the Glow(lume) shader is assigned as the surface:

the glow color (Glow) and diffuse (diffuse) are pale yellow, the surface material is represented by a glass shader (Glass(lume)) whose settings are left at default. The brightness of the glow (Brightness) is also left at default = 3.

These lamps will act as dim, filling lighting for the room.

On the right are two recessed mr Area Spot light sources. - default settings, that is, they have not been changed, they will illuminate glass and metal balls.

All stage materials (except for the described left lamps) are Arch & Design type materials, by selecting which you can quickly get settings for a specific surface from the list of predefined ones:

walls made of rough concrete (Rough Concrete), ceiling made of polished concrete, floor - Glossy Plastic, window - Glass (Thin Geom), with a Checker map applied for transparency.

As a result, we should get a gloomy room, night outside, weak general lighting, and separately illuminated balls.

Click render:

the result is clearly unsatisfactory - the lighting is too dim. You can increase the value of Multiplier, light sources and Glow for the left lamps, but if increasing the intensity of the light sources is still acceptable, then increasing the Glow value will lead to “distorted” lighting - the areas around the lamps will be very bright, and the floor will remain black.

Output in exposure adjustment

Go to the environment settings - Rendering - Environment (button 8) - Exposure Control section and select the exposure type, I left the logarithmic type. But the Mental Ray developers recommend using a photographic exposure controller, especially when working with photometric light sources.

now render again:

It’s already better, but the noise in the illuminated areas from the left lamps has become more visible - this is exactly the effect of setting the FG settings to low (the “Low” profile is set). The question arises - how to calculate the golden mean between rendering speed and quality. Naturally, by installing Very High, we will get a good image, but we will wait a very long time for the result. The render itself can help us with this; let’s ask it to display the FG anchor points for us:

go to the Processing tab (Rendering - Render...)

section “Diagnostics”, check the Enable box and indicate what we want to look at FG:

render again:

distance between green dots in illuminated areas, should be minimal, this is achieved by reducing the step of the reference points, ideally the filling should be continuous, after which further reducing the step will only lead to an increase in rendering time, with a minimal increase in quality. Sometimes noise may occur on surfaces far from the light source; increasing the emitted rays will help here, without reducing the pitch. And don’t forget about the sampling settings, which I wrote about at the very beginning.

Let's continue building the scene:

Very often there is a need to depict some light-emitting objects with complex geometry - shop windows, aquariums, TV screens, which also illuminate the scene, but the task is not to detail the object, but simply to imitate it with textures. At the same time, problems arise with their lighting characteristics - with high brightness, dark objects also begin to glow, and when the brightness is reduced, the light areas do not sufficiently illuminate the surrounding objects. This injustice arises due to the fact that a 24-bit image is not able to store information about the true glow intensity of each pixel. The situation will be corrected by using them as textures HDRI maps.

How to visualize the value of HDRI cards? - imagine that you took a photo of a sea white-sand beach against the sun. Load the photo into Photoshop and use an eyedropper to look at the colors of the pixels on the solar disk and white sand, the colors of the pixels on the solar disk will usually be #FFFFFF and the color of the pixels on the white sand will be either the same or slightly darker. Now let’s lower the brightness of the entire image, for example by 50% - the sand will become darker, which is correct in principle, but the fact that the solar disk will dim is not okay, our Sun is very bright. But if you take a picture with a special camera that can save pictures in HDRI images, this will not happen, the solar disk will remain bright, as if we simply lowered the sensitivity of the camera.

Let's try to use an HDRI map in our scene. I didn’t find a ready-made map that would depict some kind of luminous object, so to test the effect, I simply made an hdr file in Photoshop with a gradient fill - in the middle there is a bright blue line that loses brightness towards the edges. (You can make hdr yourself by selecting 32-bit image mode in Photoshop).

We open the resulting map in Max as a regular Bitmap, an image conversion dialog appears:

The main attention should be paid to the conversion option in the “Internal Storage” section, by default Max suggests discarding the brightness information and simply marking bright and dark places with certain colors - 16 bit/chan mode, this will not suit us, so let’s set the Real Pixels mode and click OK .

I used the selected map for a material similar to the material of the lamps, set to the glow parameter, and applied it to the parallelepiped near the far wall

For comparison, two renderings:

the first one is a card in 16 bit mode:

due to the replacement of bright areas with white, the illumination from bright areas occurs with almost white light

the second one is real:

there is clearly a difference.

Using Photoshop, you can make an approximate analogue of hdr images from ordinary photos; to do this, you need to convert the work to 32-bit color, make a copy of the image, increase the brightness on the copy using a histogram (brightness as such cannot be changed there) and overlay both images with the Multiply parameter (multiplier).

Here is a scene where the TV picture is obtained in exactly this way:

This scene contains three photometric light sources simulating 60-watt incandescent lamps.

Let's look at them in more detail.

Photometric light sources are needed to simulate real light sources in their physical parameters, but certain conditions are required

Use the metric system of measurement when creating a scene

Respect the actual sizes of objects on the stage

The indirect lighting algorithm FG or GI must be enabled, or better yet both

The main characteristics of photometric sources are the emitter temperature, which gives the color of the light stream, and the power of the light source.

Since we are used to measuring power in watts, and we have only a superficial idea of ​​the temperature of the source, I will give a table of the most common household light bulbs

Power

Temperature in K

12 volt - display lighting, less often desk lamp

Household incandescent lamps 220 volts

Fluorescent lamps

As such, they do not have a temperature, and are divided according to the color of the limuniphor:

Cold white 4500k,

Daytime white 6500k,

Warm white 3000k

Arc mercury\sodium

The temperature is 6500 - 11000K, but as a rule, it is necessary to apply a filter, for example, sodium ions color the light red, and the inert gases present add a blue-green spectrum.

Now let's talk about sunlight.

The developers of the mentality divided sunlight into direct light from the solar disk - bright with strongly pronounced shadows - mr Sun and filling from the cloud cover and atmosphere with strongly blurred shadows - mr Sky.

When you add the mr Sky light source to the scene, you will be automatically prompted to add the mr Physical Sky shader to the environment, which is advisable to agree with.

in the settings you need to specify the color of the sky at night “Night Color”, with low brightness values ​​- multiplier the color of the sky will tend to this color.

Adjust the height of the horizon and the color of the earth's surface, add haze (Haze) and the parameters of the ratio of red and blue colors in the sky (evening\day) in the Non - Physical Tuning section:

mr San settings also have options for adjusting the horizon, brightness and color, haze, and also added an option for adjusting shadows - Softness - shadow softness and quality at the boundaries of soft shadows: Softness Samples.

sample test room scenes

with the sun outside the window

and in cloudy weather

I forced the light intensity up so that I could see the light filling the room and the shadows on the floor. In the first case, the rays are straight and almost parallel - a spot on the floor is illuminated and, secondarily, a reflection from the floor, a spot in the window area is illuminated. And in the second case, almost the entire room is illuminated. When rendering both scenes, FG was set to the Low profile, which caused a lot of noise in the illuminated areas.

Often, when depicting rooms where light comes from a window, it is desirable to add a Volume Light effect to the light sources to enhance the effect of bright rays or the dusty atmosphere of the room. On the mr Sun light source, this effect is not applied correctly, probably due to a different principle for calculating shadows; the illuminated volume is simply filled, without taking into account the shadowed areas. Therefore, for this effect you will have to use standard sources:

Let's finish with the premises and move on to simulating external lighting

If we have an hdr map that simulates the sky, then we can easily apply it to our scene. This is done by applying the map to the Skylight light source. The light source itself can be placed anywhere in the scene - this is not important, the main thing is that FG is turned on, otherwise it will not work.

Click on the button that says None (there is no map by default) and select our hdr image (as I described above), or specify a slot from the material editor where such a map is already open.

Here is an example of a scene where a small building is depicted, surrounded by a moonlit night. The environment map is applied not only to the light source but also to the Environment map slot.

we see soft lighting from the sky throughout the scene, as well as pronounced shadows from the moon.

And now here's the fly in the ointment:

For the picture shown above, I specifically used a dark map with a bright spot of the moon, which I further processed in Photoshop to increase the brightness of the moon and darken the sky, otherwise the effect of the map would not be noticeable. In fact, in MR, in my opinion, the algorithm for taking into account the brightness components of the map for the Skylight source does not work quite correctly.

I will give examples of comparing scenes for MR and V-Ray.

in both cases multiplier = 3 I did not change the other parameters of the card, I tried to use materials with similar properties.

As you can see, in the second case the picture is “tastier.” The only thing I want to note about Vi_rey is that you need to remember that you cannot use the same card for lighting and reflection. Look carefully at the picture - where the moon is according to the reflection and where its shadow is directed - the difference is 180 degrees. There is a parameter in the settings for map rotation, but you need to remember this!

True, I took the most complex map- the moon is not bright and small, on good maps the differences are almost invisible, but the fact of different calculations is obvious. Let everyone draw their own conclusions.

I think that's all I wanted to show in this lesson. Finally, I will highlight some small features that, in my opinion, are worthy of attention.

- Glow material. IN previous versions Incorrectly illuminated himself. If not the entire surface of the material is illuminated, but only some individual areas (a map is applied) or the material is part of a Blend material, then the luminous area will illuminate neighboring objects with another material, but objects with the same material will not illuminate itself. There is no such problem in 2008 Max. Here's an example scene:

the entire structure consists of one material based on Blend. As we can see, the material illuminates itself perfectly (there are no light sources on the stage).

- except using hdr cards, you can also use.exr cards, which are less common but also carry information about light intensity. Exr format file conversion window when assigning a card:

- While creating animations where there are bright light sources or textures based on hdri images on the stage, the Motion Blur effect in all versions of Max up to and including 2008 does not work correctly, since the structure of our vision (and camera matrices) is such that the brighter the spot, the more vivid the “smear trail” it will leave. Happy owners of Max 2009 The kit includes an HDR Image Motion Blur(mi) shader, which is placed in the “Output” slot of the camera effects, which are available in the “Renderer” render settings:

This shader allows you to blur the image of not only scene objects, but also the scene background to which the map with the image is applied.

For comparison

Blur on glowing objects in the scene

and for the background on the same card with the moon

This concludes the first part of the lesson. In the next part I will touch on the problems of GI and light in volumes.

In this tutorial we'll look at the basic principles of setting up interior lights and creating a global illumination effect in Mental Ray. We'll also look at some problems that can arise when lighting a textured scene, and how to solve them.

To complete this tutorial, we will first need to create a room.

In the projection window Top create a spline Rectangle. Select it and go to the tab Modify command panel. Select a modifier from the list of modifiers Edit Spline. In a scroll Selection click on the button Spline(the red curve is like this), and then in the scroll Geometry click on the button Outline and in the window Top move the spline outward a little. Now again from the list of modifiers select Extrude and extrude a three-dimensional object of suitable height from the spline. These will be the walls.

Now make a floor and ceiling from a regular plane.

Next we will cut out the window. Create Box. Position it in the wall so that all corners stick out from the wall. Select it and in the category drop-down list Geometry tabs Create command bar select line Compound Objects. Click the button Boolean, then, in the scroll that appears, click on the button Pick Operand B. Select a wall object in any window. Set the type operations B-A. The window is ready, as is the stage itself. Although no! Add a couple more objects to the room for beauty. It will be something like furniture. Apply regular standard gray material to the walls, ceiling and everything else.

Place your camera indoors and focus it properly.

Point a light source out the window mr Area Spot.


Set up the light source. When working with photons, the parameter is of great importance Hotspot in a scroll Spotlights Parameters light source. These parameters must be adjusted as accurately as possible to the size of the window through which light enters the room in order to avoid the loss of photons, the maximum number of which depends on the size of your PC’s RAM. Since the window is rectangular in shape, it means you need to specify the shape Rectangle and adjust the cone to the size of the window. To make it easier to change the direction and cone, switch in one of the windows to the view from the light source. In a scroll Area Light Parameters check the box On and specify the type of ambient light Disc with a dispersion radius of 40. Although, you can set a much larger value. I have never observed a sharp outline of a window opening in the shadow when no sunlight enters the window. From this we can draw conclusions. If you want the sun's rays to fall through the window in your scene, then setting blurry shadows will big mistake. The situation is different when the light is from heaven.

With the creation of the scene everything seems to be done. Send the scene to miscalculation. It's dark isn't it? It's time to figure out global illumination in Mental Ray. Opening the window Render Scene, select as visualizer mental ray. Go to the tab Indirect illumination and in the scroll Caustic and Global illumination in the GI block, check the box Enable. Visualize the scene. Almost nothing has changed. You can't do without fine tuning.

So, let's start setting up the lighting of our test scene. Set value Maximum Sampling Radius equal 4 . The Radius value is the photon search radius. It is the search radius for photons, not the size of the photon! Photons from the point of view computer graphics have no size. The absence of the Radius checkbox means that the photon search radius is approximately 110 parts of the scene. Maximum Num value. Photons is the number of samples to calculate the illumination of a point. Meaning Average GI Photons set equal 10 000 . As you already understand, the GI Photons value determines the number of photons of light sources; it is this number of photons that is stored in the photon map. The Decay value determines the attenuation with distance, a physically correct value of 2 is considered. The Global Energy Multiplier value is a kind of regulator with which you can control the overall illumination of the scene.

The Trace Depth value sets the level of reflection and refraction of surfaces in the scene. Photon Map—installation of a photon map. Please note that some resulting parameter values ​​may differ depending on the coordinate system. This applies to all parameters that specify dimensions, distances, radius, etc. We consider all values ​​in Inches, and not in millimeters or meters, etc.

Visualize the scene again.


Bright spots of light with a radius of 4 indicate that photons are being generated, that the photon search radius is 4 inches, and the presence of large unlit black areas in the scene indicates that there are not enough photons for the given scene. We change the number of photons from 10,000 to 500,000.


It's getting better, but it's still dark and noisy. There are two ways to get rid of noise and make the lighting more intense. To reduce noise, you can further increase the Average GI Photons value, but this will increase rendering time, and you will not achieve excellent results. Average GI Photons values ​​are limited by PC memory capacity and you will not be able to use very large values. The second option is to increase the photon search radius, which will lead to a smoother picture. But then the secondary shadows will be calculated ugly, which will not look natural at all. The best option is to adjust these values ​​so that there is no noise and the shadows are normal. Now that's a good image.


Here I used Average GI Photons = 1,500,000, Maximum Sampling Radius = 13, and Global Energy Multiplier = 6500. In fact, the picture is still terrible. Highlights appeared due to the Multiplier value being too high. This can often be seen in galleries, when interior images highlight window sills, window frames and, sometimes, ceilings. It is not right!

Despite the fact that the photon map method gives the most physically accurate results of scene lighting, the number of photons to obtain high-quality lighting with a minimum photon search radius should be too large. Modern PCs and 32-bit operating system will not allow you to calculate such a number of photons.

The most realistic, competent lighting in interiors is provided by the combined use of photons and Final Gather. What does it represent Final Gather? A hemisphere of unit radius is constructed above the point and rays are emitted through the surface of the hemisphere in random directions. The more such rays, the more accurate the calculation and the less noise. In practice, the number of rays is the number of samples in Final Gather. For each ray, the intersection with the nearest surface is found. The beam is processed. No further ray tracing is performed. Final Gather's ray tracing depth is always one. I recommend using only one Final Gather in scenes using HDRI maps in global environments or exteriors.

And so we turn it on Final Gather and set the values ​​as in the figure. But first return the values Average GI Photons = 10000.

Checkbox Preview serves for quick rendering in low quality. Visualize the scene.


As you can see, there is noise, but not as much as when Final Gather is disabled. It is enough to increase the value Average GI Photons before 200000 And Samples in Final Gather with 50 on 500 , and you get a very acceptable picture.


Apply textures. I used standard materials and Max bitmaps (*. jpg). Visualize the scene again.


Not a very pleasant sight? Here! Now is the time to talk about the problems that can arise when using Mental Ray GI. As you have already noticed, in the scene there is quite a strong transfer of color from the walls and floor to the ceiling, and indeed to each other. This effect is called. You can fight this different ways. For example, controlling color bleeding using photon shaders. But most the best option I think the next one. We calculate the photon map and Final Gather in the scene with gray material, as in Figure 9, and save it to a file. Next, we assign the necessary materials to the scene objects and render by loading photons and Final Gather from the file. To be honest, I don’t understand why the developers didn’t make the color bleeding option as, for example, in the finalRender renderer.

Let's see it through to the end. Here is a picture rendered using this method.


For the sake of example, I threw a couple of models of chairs with a carpet and one wall into the scene. I am not an interior designer and this is not a competition entry, so please do not criticize me for such an incomprehensible attempt at arranging furniture.


A good picture without glare on the window and with uniform lighting and only one light source. Some might argue that the stage is a bit dark. Stop! Where have you seen a well-lit room in reality through such a small window? Don't overdo it with the light intensity. This is where overexposure appears and the scene looks unrealistic. A well-lit scene is when it is not bright and without flare, when all objects and angles in the camera’s field of view are clearly visible. To properly illuminate the scene, use the SkyLight light source.

Finally, I want to give some tips that will help you avoid mistakes in your work with Mental Ray.

1. Never make walls, floors and ceilings with zero thickness! Mental Ray will simply ignore rotated wall normals and let light into the room as if it were an open space. This is also true for other visualizers.

2. Use SkyLight for illumination. To add illumination, realism and highlight window openings located in the shadow area, SkyLight is best suited. In large interiors with many windows, instead of a skylight in window openings, you can use a photometric light source - TargetArea.

3. I recommend using only “native” materials in all external visualizers. This applies to Mental Ray to a lesser extent because both standard and tracer and architectural materials work quite well in Mental Ray. But, despite this, only the use of “native” materials, which include DGS material, mental ray, Glass (physics_phen) and Lume shaders, gives the most physically accurate and correct results. When using (in interior scenes using photon maps) mental ray material in the Photon slot, you must use a photon shader. When used in the Surface slot - DGS materiala, in the Photon slot it is better to use DGS material Photon. When using Lume shaders in the Surface slot, for example, Metal(lume) in the Photon slot, it is better to use Photon Basic.

4. Photon rendering, Final Gather and rendering progress can be monitored visually by turning on the Mental Ray Message Window.

5. Adjust the lighting in the scene by assigning a gray material to all objects. Remember that textures and materials tend to hide GI imperfections. And only after you find the optimal GI settings in the scene, assign materials to objects, adjusting the materials to the lighting, and not vice versa. Remember also that in Mental Ray, photon shaders have a direct effect on the lighting in the scene and if you want them not to affect the overall lighting set up in a scene with a gray material, set the photon shaders to the same parameters as they were when setting up lighting in a scene. Now let's talk about radii in Final Gather. Max Radius is the distance between points for which GI (global illumination) is calculated. The smaller the distance between the points, the more accurate the calculation and the more time it will take. Min Radius is the distance used in illuminance interpolations and extrapolations of intermediate points. In practice, to obtain normal quality, GI Min Radius should be 10 times less than Max Radius. Increasing the radius values ​​leads to a decrease in the quality of secondary shadows, while decreasing them leads to more accurate rendering of GI and, as a result, an increase in rendering time. The smaller the radii, the greater the number of samples you have to set in Final Gather. The number of samples required for anti-aliasing with the above radius values ​​ranges from 500 to 3000 depending on the scene. The bigger, the better. But you shouldn’t get too carried away with increasing this value, since the rendering time will increase significantly.




Top