Traditional Culture Encyclopedia - Photography major - How to create a light and adjust its position and color?

How to create a light and adjust its position and color?

6. 1 Case 22: Lighting effect of desk lamp-using spotlight

In the previous chapter 4 10, we once made a table lamp shape. In this case, the corresponding lighting effect will be added to this desk lamp, that is, the spotlight that can generate a cone beam is used as the main light source of the desk lamp, and the floodlight that generates scattered light is used as the auxiliary light. Rendering renderings are shown in Figure 6- 1.

Through the implementation of this case, you will master the creation method of spotlight and floodlight, as well as the basic setting method of common lighting parameters.

Figure 6- 1 Lighting Effect of Table Lamp

6. 1. 1 production process

1. Create and set spotlight.

Here, what we want is the indoor scene effect provided by the desk lamp at night. Because the desk lamp has a lampshade, the light comes from the lampshade as a cone beam. Therefore, in order to simulate the lighting effect of a desk lamp, a spotlight should be placed in the lampshade of the desk lamp.

(1) After starting 3DS MAX 5, open the file ex6- 1.max in the "Scenes" folder on the CD supporting this book. The scenario provided by this file is shown in Figure 6-2.

Figure 6-2 Lighting Effect before Scene Setting

Please note that since the default light source is provided by the system, the scene can still be illuminated by the default light source of the system even though no light is created at this time.

(2) Create a target spotlight. Click the button in the Create Command panel to open the Create/Light command panel.

(3) In the "Object Type" rollout of the command panel, click the target point button to make it yellow.

(4) Move the cursor to the lampshade in the front view. At this point, the cursor becomes a cross. After pressing the left mouse button, drag the mouse to the desktop to determine the target point of the spotlight. Finally, release the left mouse button at a suitable position to make the position and direction of the created spotlight in the front view, as shown in Figure 6-3.

After the spotlight is created, the scene in the perspective will be dimmed, because once you create the light yourself, the default light source of the system will automatically.

Figure 6-3 Location and direction of spotlight

(5) As can be seen from the top view, the light source of the spotlight (the end with the cone icon) deviates from the lampshade, and the position of the spotlight in the top view needs to be further adjusted. Click the button in the toolbar to move the light source of the spotlight to the lamp shade in the top view.

(6) Enlarge the irradiation range of condensing cone beam. Confirm that the light source of the spotlight is selected, open the Modify command panel, and set the value of Spotlight/Beam to 90 in the Spotlight Parameters rollout. As can be seen from the front, the cone-shaped illumination area of the spotlight has become larger. When rendering a perspective view, you can see that the spotlight projects a circular illumination area with clear edges on the desktop. In the Spotlight Parameters rollout, set the Attenuation/Field value to 130. At this point, as can be seen from the front view, the dark blue wireframe and the light blue wireframe in the spotlight symbol are separated, as shown in Figure 6-4, in which the light blue wireframe represents the highlight area of the spotlight and the dark blue wireframe represents the attenuation area of the spotlight. Rendering the perspective again, you can see that the boundary of the spotlight illumination area becomes very soft and natural.

Figure 6-4 Highlights and Attenuation Areas of Spotlights

(7) Turn on the shadow option of spotlight. In the General Parameters rollout of the command panel, select the Enable check box in the Shadow column. Render a perspective view when the teacup casts a shadow in the spotlight. However, because the shadow option of the spotlight is turned on, part of the light generated by the spotlight is blocked by the lampshade, and the shadow cast by the lampshade on the desktop makes the lighting effect of the spotlight unnatural. Next, we exclude the lampshade from the spotlight.

(8) Confirm that the light source of spotlight is selected. In the General Parameters rollout, click the Exclude button to open the Exclude/Include dialog box, as shown in Figure 6-5. Click and select "lampshade" in the object name list on the left, and then click the button to make the name of "lampshade" appear on the right.

Figure 6-5 Excluding Objects from Lights

(9) Render the perspective view, and the lighting effect of the final spotlight is as shown in Figure 6-6. As you can see, because the lampshade is excluded from the spotlight, the whole lampshade is black. Next, we create a floodlight in the lampshade to illuminate the interior of the lampshade.

Figure 6-6 Lighting effect under spotlight

2. Create and set floodlights

The whole scene needs to create two floodlights, one is used to illuminate the inside of the lampshade, and the other is located outside the lampshade to simulate the reflected light of the desk lamp and illuminate the whole scene with low brightness.

(1) Open the Create/Lights command panel, click the Floodlight button, move the cursor into the view, and then click the left mouse button to create a floodlight. Then, click the button in the toolbar to move the floodlight position in the view so that the floodlight is located in the lampshade.

(2) Rendering perspective, the whole scene becomes very bright. Because we want the floodlight just created to illuminate only the inside of the lampshade, all objects outside the lampshade should be excluded from the floodlight.

(3) Confirm that the floodlight in the lampshade is selected, open the modify command panel, click the Exclude button in the General Parameters rollout, then click the Include option at the upper right of the pop-up dialog box, click and select "lampshade" in the object name list on the left, then click the button to make the name of "lampshade" appear in the list box on the right, and finally click the OK button to confirm. Such floodlights are only effective for lampshades, but not for walls, desktops, teacups and other objects.

Render the perspective view, and the result is shown in Figure 6-7.

Figure 6-7 Illuminating the interior of the lampshade with floodlights

(4) Create floodlights as auxiliary lights. Open the Create/Lights command panel, click the Omni button, and create a floodlight in the view, the location of which is shown in Figure 6-8.

Rendered perspective shows that the whole scene is very bright. Next, we will reduce the brightness of the floodlight as an auxiliary light to highlight the lighting effect of the table lamp.

Figure 6-8 Location of floodlights in the left view

(5) Set the brightness of the floodlight. Confirm that the floodlight is selected as the auxiliary light, open the Modify command panel, and set the value of the Multiplication parameter from the original 1 to 0.5 in the Intensity/Color/Attenuation rollout.

Rendering the perspective again, we can see that the brightness of floodlight decreases, which better sets off the effect of spotlight (desk lamp) as the main light source. The result is shown in Figure 6- 1 above.

(1) In the whole scene of this case, * * uses three kinds of lights, namely: a simulated desk lamp and a spotlight as the main light source; As a special lighting floodlight (only illuminating the inside of the lampshade); Floodlights as auxiliary lighting.

(2) When adjusting the illumination angle of the spotlight, you can move the light source and target point of the spotlight respectively. If you want to move the light source and target point of the spotlight at the same time while keeping the lighting angle unchanged, you should click the button in the toolbar, and then click the light blue straight line connecting the light source and target point of the spotlight, so that you can select the whole spotlight, and then drag the mouse to move the light source and target point of the spotlight at the same time.

(3) In this example, the Exclude button was used twice and "Lampshade" was selected twice in the dialog box, but the results of these two operations were just the opposite. Please note that the Exclude/Include dialog box opened after clicking the Exclude button has two separate options in the upper right corner, where Exclude means to exclude objects and Include means to include objects. The default option is to exclude DDE

The first time I used the exclude button of the spotlight, the result was that the lampshade was excluded from the spotlight. The second time is to use the exclusion button of the floodlight located in the lampshade. Because the inclusion option is selected in the open Exclude/Include dialog box, the result of the operation is that only the lampshade is included in the floodlight, and all other objects are excluded.

(4) All lights have a multiplication parameter. When creating more than two lights in the scene, the multiplication parameter should be set to different values according to the function of each light, so that the lighting effect in the scene can present a rich sense of hierarchy.

(5) You can Delete the created light by clicking and selecting the light to be deleted, and then pressing the delete key.

6.1.2 Lighting types of 3ds max 5

3DS MAX 5 provides six types of lights, which are:

(1) Target spot;

(2) Free spot;

(3) the goal is direct;

(4) Free direct light (free parallel light);

(5) floodlight (floodlight);

(6) skylight.

In the command panel for creating lights, click the "Lights" button to open the command panel for creating lights, as shown in Figure 6-9. In the Object Type rollout, there are six lighting creation commands.

Figure 6-9 Create/Light Command Panel

1. spotlight

Spot is a directional light source, which emits light in the form of a light cone, similar to a searchlight or flashlight in daily life. 3DS MAX provides two types of spotlights, namely target spotlight and free spotlight. Among them, the most commonly used is the target spotlight, and a target spotlight contains two objects: the light source and the target point. You can move and rotate the light source and the target point separately, but no matter how the light source and the target point move, the light source in the same target spotlight always shines on the target point. Target spotlight is usually used as the main light source to provide basic lighting.

The free spot is similar to the target spot, and its light still comes from a point and extends along a cone. Unlike target spotlights, free spotlights have no target points. In practical application, free spotlight can be used to simulate car lights.

2. Parallel light

Direct light is also a directional light source. Different from spotlight, parallel light is not a cone of light, but a beam of parallel light, so the shadow generated by parallel light will not be deformed, which is very different from the cone of light emitted by spotlight from a point. As shown in fig. 6- 10, the shadows produced by mutually parallel columns under spotlight irradiation are tapered, while in fig. 6- 1 1, the mutually parallel shadows are produced by mutually parallel columns under parallel light irradiation.

Figure 6- 10 Cone Shadow Produced by Spotlight

Figure 6- 1 1 Parallel shadows produced by parallel light

In practical application, parallel light can be used to simulate sunlight to produce parallel shadows.

3DS MAX provides two types of parallel light, namely target direct light and free direct light. Among them, the target parallel light includes a light source and a target point, which can be moved and rotated respectively to adjust the irradiation direction of light. Free parallel light has no target, so it can only change the irradiation direction of light by rotating the light source.

3. floodlight

A floodlight is a point light source that scatters light around. It is like a light bulb without a lampshade that we usually see, emitting diffuse light.

In practical application, floodlights are usually used as auxiliary lights to provide uniform illumination.

6. 1.3 system default light source

In 3DS MAX 5, you can illuminate the scene even if you don't create a light source. This is because 3DS MAX 5 provides the default lighting, and its purpose is to let us see the objects in the scene clearly during the process of creating the scene. Once the user creates a light in the scene, the default light of the system will be automatically turned off. When all the lights created in the scene are deleted, the default lights will be automatically restored.

In 3DS MAX 5, you can set the system default light to one or two, and the operation method is as follows:

(1) Select the custom/viewport configuration menu, open the viewport configuration dialog box, and then open the rendering method tab in the dialog box, as shown in Figure 6- 12.

Figure 6- 12 Viewport Configuration Dialog Box

(2) In the rendering options bar of the dialog box, if you select the 1 lighting option under the default lighting, it means that the system uses the default lighting; Selecting the two lights option means that the system uses two default lights.

6. 1.4 Common lighting parameters

The lighting parameters are set flexibly. Through parameter setting, you can adjust the color, brightness, shadow effect and so on of the light. Target spotlight, free spotlight, target directional light, free directional light and floodlight all have some same parameter rollouts. The following focuses on some commonly used parameters.

Figure 6- 13 The rollout of general parameters has nothing to do with distance. If you want to produce a real lighting effect with a sense of distance, you can set the attenuation parameters of the light to achieve it.

3. Advanced effects rollout

The "Advanced Effects" rollout is used to set the contrast between light and shade when light shines on the surface of an object, and some special effects on the irradiated surface, as shown in Figure 6- 16.

Figure 6- 16 advanced effect rollout

The main parameters of the Advanced Effects rollout are as follows:

Influence surface: When the light illuminates the surface of the object, set relevant parameters. Among them, the contrast parameter indicates the contrast intensity between the light receiving surface and the dark surface when the light source irradiates the surface of the object, and this parameter can be used to make dazzling lighting effects. Parameter softening difference. Edge is used to set the softness of light when the light source shines on the surface of the object.

Figure 6- 17 shows the spotlight lighting effect when the contrast values are 0 and 80 respectively.

Contrast =0 Contrast =80

Fig. 6- 17 Influence of Contrast Parameters on Lighting Effect

Projector map: You can set the specified image to project along the illumination direction of the light, and click the "None" button to select the bitmap to be projected. The effect of projecting bitmap is shown in Figure 6- 18.

Figure 6- 18 Projection Bitmap Produced by Spotlight

4. Shadow parameters rollout

The shadow parameter rollout is used to set the shadow effect of light projection, as shown in Figure 6- 19.

Figure 6- 19 Shadow Parameters Rollout Bar

The main parameters of the Shadow Parameters rollout are as follows:

Color: This option is used to set the color of the shadow. The default color is black. Click the color block to the right of the color to open the color picker dialog box, where you can set the shadow to any color.

Density: This value box is used to adjust the density of the shadow color. When Dens is 0, no shadow is generated; When Dens takes a positive value, the larger the value, the stronger the color; When Dens takes a negative value, the generated shadow color is opposite to the set shadow color.

Map: This option is used to set the shadow of the graphic effect. Click the "None" button to the right of the map and specify the bitmap in the pop-up "Material/Map Browser". As shown in Figure 6-20, the bitmap shadow makes the transparent effect of the glass teapot more realistic.

Figure 6-20 Bitmap Shadow

Light affects shadow color: When this check box is selected, the shadow color will be displayed as a mixed effect of light color and shadow color.

5. Shadow Map Parameters Rollout Bar

The Shadow Map Parameters rollout sets parameters, such as the positional relationship between shadows and objects, to produce realistic shadow effects, such as

6. Optical domain

Spotlight and parallel light also have a rollout with the same parameters, namely "Spotlight Parameters" rollout of spotlight and "Direction Parameters" rollout of parallel light. The "Spotlight Parameters" rollout is shown in Figure 6-24, in which parameters such as the size of illumination area, the size of attenuation area and the shape of light source area can be set.

Volume light is a wonderful lighting effect provided by 3DS MAX. It can make spotlights, floodlights and directional lights not only illuminate the scene, but also display the light itself in the form of fog halo. Usually, volume light can be used to simulate various effects when light passes through dust or fog, such as the light column produced by flashlight or searchlight at night.

(2) Render the perspective view, and the result is shown in Figure 6-29, which is the effect before the spotlight applies volume light.

Figure 6-29 Effect before volume light is applied

(3) Select the light source of spotlight in the view to open the modify command panel.

(4) In "Atmosphere &; In the Effect rollout, click Add to open the Add Atmosphere or Effect dialog box, as shown in Figure 6-30.

Figure 6-30 "Add Atmosphere or Effect" Dialog Box

(5) Select the volume light in the dialog box, and finally click OK to confirm.

(6) Render the perspective view, and the result is shown in Figure 6-3 1. You can see the white cone of light from the spotlight.

Figure 6-3 1 shows the effect of adding volume light to a spotlight.

2. Adjust the parameters of volume light

(1) Adjust the density of volume light. In "Atmosphere &; Effects rollout, select Volume Light, and then click the Settings button to open the Environment dialog box. The "Volume Light Parameters" rollout in the dialog box is shown in Figure 6-32, where you can set the relevant parameters of volume light.

Figure 6-32 "environment" dialog box

(2) In the "Volume Light Parameter" rollout, reduce the value of the density parameter to 2. Rendering the perspective, we can see that the cone of light emitted by the spotlight becomes more transparent, as shown in Figure 6-33.

Figure 6-33 Effect of Reducing Density Value of Volume Optical Density

(3) Adding clutter effect to body light. Set the value of Density to 5, select the Noise On check box in the Noise column, and then set the value of Quantity to 0.6. Rendering the perspective, we can see that there are clouds of fog points in the white light cone, as shown in Figure 6-34.

Figure 6-34 Effect after setting the volume light noise option.

(4) In the noise train, reduce the value of Size from 20 to 10, and render the perspective again. As shown in Figure 6-35, the fog point in the light cone becomes smaller.

Figure 6-35 Changing the Size of Fog Point

3. Animation of fog floating.

(1) Click the Auto Key button in the animation control bar to turn it red, drag the time slider to frame 100, and then set the value of the Phase parameter in the Noise column to 8 in the Volume Light Parameters rollout of the Environment dialog box.

(2) Click the Auto Key button in the animation control bar again to restore it to gray and end the animation recording.

(3) Close the Environment dialog box.

(4) Rendering animation. Activate the perspective view, click the button in the toolbar, select the activity time option in the pop-up dialog box for rendering scenes, click the file button, set the output animation file to 23.avi, and finally click the render button at the bottom of the dialog box to render scenes frame by frame.

(5) After the animation rendering, select the File/View Image File menu to open the 23.avi file, and you can watch the wonderful effect of the misty spots fluttering in the beam projected by the spotlight.

(1) This case introduces the operation method of adding volume light to spotlight, and the setting of parameters such as volume light density and clutter noise. Volume light can be applied not only to spotlight, but also to parallel light and floodlight.

(2) After setting the volume light, only the perspective view or camera view (such as Camera0 1 view) can see the effect of the volume light, but the front view (such as top view, front view and left view) and user view cannot produce the volume light effect.

(3) After setting volume light, the rendering speed will be obviously reduced.

6.2.2 Another Method of Setting Volume Light

In case 23, we set the volume light to "atmosphere &; Effects "(atmosphere and special effects) rollout. In addition, volume light can be set through the Rendering/Environment menu. The specific operation steps are as follows:

(1) After creating lights (spotlights, floodlights or directional lights) in the view, select the Rendering/Environment menu to pop up the Environment dialog box, in which the Atmosphere rollout is shown in Figure 6-36.

Figure 6-36 "environment" dialog box "atmosphere" rollout

(2) Click the "Add" button in the "Atmosphere" rollout to open the "Add Atmosphere Effect" dialog box, as shown in Figure 6-37. After selecting "Volume Light" in the list bar, click "OK" to confirm. At this point, the added Volume Light will be displayed in the effect list of the Atmosphere rollout, and a Volume Light Parameter will be added below the Atmosphere rollout.

Figure 6-37 Adding Volume Light Special Effects

(3) In the Volume Light Parameters rollout, click the Pick Light button in the Light column, then move the cursor to the view and click the light to which you want to apply the volume light.

(1) After starting 3DS MAX 5, open the file ex6-3.max in the "Scenes" folder on the CD supporting this book. The scenario provided by this file is shown in Figure 6-39.

Figure 6-39 Lighting Effect before Scene Setting

(2) Open the Create/Lights command panel, click the target spotlight button, create the target spotlight in the view and adjust its position to the floor lamp, as shown in Figure 6-40.

Figure 6-40 Location of Spotlight

(3) Confirm that the light source of the spotlight is selected, open the modify command panel, and in the "Spotlight Parameters" rollout, select the Show Cone checkbox to display the cone wireframe representing the highlight area and attenuation area of the spotlight. Then in the Spotlight Parameters rollout, set the value of the spotlight area to 90 and the value of the attenuation area to 130.

(4) Open the Create/Lights command panel, click the Omni button, and create a floodlight as auxiliary lighting in the view, as shown in Figure 6-4 1.

Figure 6-4 1 location of floodlights

(5) Confirm that the floodlight is selected, open the modify command panel, and set the value of the multiplication parameter to 0.5 in the "Intensity/Color/Attenuation" rollout.

(6) Create a floodlight in the lampshade of the floor lamp, and use the "Exclude" button in the "General Parameters" rollout to make the floodlight only illuminate the floor lamp, which has the effect of illuminating the interior of the lampshade.

Render Camera0 1 view, and the lighting effect produced by spotlight and floodlight * * * is shown in Figure 6-42.

Figure 6-42 Lighting Effect

Usually, the lampshade of a floor lamp has a certain light transmittance, so when the floor lamp is turned on, the lampshade will appear very bright. This effect can be achieved by providing the lampshade with self-luminous materials.

(7) Click the button in the toolbar to open the material editor. The third example shows that the material in the window is the thermal material assigned to the lampshade. After activating the third sample display window, in the Blinn Basic Parameters rollout, set the value of the self-luminous parameter to 60.

(8) Render the Camera0 1 view again, and the effect is as shown in Figure 6-38 above.

6.3.2 Mysterious oil lamp

An oil lamp model is provided in the ex6-4.max file in the Scenes folder. Here you need to add a halo flame effect to the oil lamp, and its rendering is shown in Figure 6-43.

Figure 6-43 Oil lamp

(1) After starting 3DS MAX 5, open the file ex6-4.max in the "Scenes" folder on the supporting CD of this book, and its content is that an oil lamp is placed on a wooden desktop.

(2) Let the flame of the oil lamp burn. Click the button in the Create command panel, and then select Atmospheric Equipment from the drop-down list below the button. At this point, three command buttons will appear in the Object Type rollout, namely: BoxGizmo (square wireframe), SphereGizmo (spherical wireframe) and CylGizmo (cylindrical wireframe), representing three different wireframe shapes respectively.

(3) In the Object Type rollout, click the SphereGizmo button, then move the cursor to the top view and drag the mouse to generate a spherical wireframe. In the Sphere Gizmo Parameters rollout of the command panel, set the value of Radius to 6 and select the Hemisphere check box.