Contacts

Texture mapping with the UVW Map modifier using the roof example. Texturing a complex model with Unwrap UVW Why doesn't uvw map work

Overlaying the techstury with the UVW Map modifier using the roof exampleI propose to consider a method of texture mapping that is convenient in the case of architectural forms: when you can separately texture the various surfaces object. In this lesson I will try to do this using the example with the roof.


In this house, I now have to apply the texture to the roof. The roof is made up of two forms: the main - in the form of a pyramid and additional superstructures with attic windows. Let's try it first on the pyramid, it's simpler. Let's look at the texture of the material itself (you can see it in the slot) and assign the material immediately to the main roof, we see that the texture does not fit properly right away:

Let's try to just apply the entire modifier to the form UVW Map : To do this, go to the main menu Modifiers ? UV Coordinates ? UVW Map :



It turned out only on one polygon, the texture did not fit the rest as we need. Now let's try to iterate different kinds overlays in the modifier: from planar (planar overlay) put in box (overlay on a rectangular container):

Then we'll try other overlays. We also rearrange in Alignment axes. We see that no matter how you choose, we did not get the desired result in this way. Is there a way out? In cases like this, yes. To do this, you need to apply the modifier UVW Map not to the whole object, but to each polygon (or group of polygons) separately. Remove modifier for now UVW Map from the object. Let's go to the polygon level and select the front polygon.
T Now the modifier is applied to the selected polygon UVW Map : Modifiers ? UV Coordinates ? UVW Map :



Now we need to do something similar with the rest of the polygons, the form of which we are interested in. In order to select the next polygon or group of polygons without canceling the previous step in the modifier stack, go to the main menu: Modifiers ? Selection ? Poly Select : where you also need to get to the level of polygons. Select the desired polygon (or group of polygons):


Assign a modifier to it (to them) UVW Map : we go in the same way as before: M odifiers- ? UV Coordinates--- ? UV Map:

Let's try to adjust with planar overlay ( planar): To do this, first of all, we need to determine on which axis we align: in option Alignment it suits us to rearrange the circle oppositeX . Now let's choose the dimensions:Length and Width (you can do this by eye or rely on size ratio in polygons). Here you can also customize the report U / V / W tiles .
Let's do the same with the third side of the roof: To do this, we again selected the required polygon (polygons) through Poly Select .

And also apply a modifier to it (to them) UVW Map :


And again we adjust the rapport:


And we will do the same on the last side of the roof, I will not write in detail again, I will just show the final picture with the fourth side of the roof:



On the top view, you can easily check yourself:

I note now that you will not always be able to fit the pattern in the polygons exactly with this method of texture mapping, this is perhaps the main disadvantage of this method. Let's say, here I don't have such a task - to precisely fit the pattern on the sides of the roof, because the seams will be hidden by the plates.
Now we will try to impose a texture on the add-on with windows. There are several components in this part of the roof, so the polygons are divided into three groups ID : the 1st ID :
Let's prepare a multi-component material, where for the first component you can take an independent copy of the material that was assigned to the main part of the roof. And you can afford to dream up with the design and take some other texture. In this case, it is logical to lay out the superstructure with flexible tiles, so I make a new material with the image of a different coating: with a pattern of scales.
Let's assign the prepared material to the add-on (left from all sublevels). It turned out like this:

After assigning the material, we see that the scales on some sides also look in the wrong direction, in the polygons we also need to adjust the texture rapport. Well, let's start with some polygon - select it:

Apply a modifier to it UVW Map :


Now we need to set the parameters correctly: we will rearrange the overlay type to box :


Already better. Now let's put inAlignment circle on axle X :


Now it's just a matter of sizing. To be honest, I rarely calculate exact values, more often I do it by eye:


Here, it finally happened. Now through Poly Select select another required polygon:


Apply again UVW Map , on this polygon, only the dimensions need to be corrected, I adjust again by eye:

Under this polygon, select the following:


We rule on it:


If possible, I try to adjust the size in such a way that the pattern on adjacent polygons can match, if it is then combined along the lines. At the same time, I do not yet shift the rapport itself, but in order to finally exactly match the drawing, here you can use the button Normal Align (normal alignment), but this will only work if we did not change the direction of the normals, otherwise this button will reverse the direction of the drawing. Press it and now if you hold down the left mouse button, you can move the picture - combine it more precisely:


Of course, it is not always possible to fit the dimensions right away, but it is good to use this moment when it is possible to calculate the rapport accurately. Basically it worked. I adjust the next polygon as well, as a result:


I do the same with all other polygons in this form. Here is a test rendering of the roof:
Note: of course, there are other ways to apply texture to complex objects, for example, using a modifier Unwrap UVW . And, perhaps, the method described here seemed too tedious and inaccurate to you. However, it is often more convenient to use it, especially when the texture is applied only to polygons visible for visualization, and not to all, that is, when the view angle is fixed (often this has to be done in order to save time and effort). Another plus: in this way, you can sometimes quickly correct something in certain areas. The disadvantages include the fact that it is impossible to expand the pattern at angles that are not multiples of 90 degrees, as well as the already indicated complexity of joining the pattern in adjacent planes. But you may still use the method described now more than once. Authors: website Prepared by: site

Since the basics are also the basics in Africa, the principles of working with UV-unwrapping, gleaned from this article, you can apply while working in other 3D editors. The only difference will be in the names of the buttons and tools.

The author of this article is a respected 3D modeler of vehicles in 3ds Max - Alexander Barsukov, also known under the nickname DesertBull. So I'm posting the article as is.

It is very important for a modeler to know the mapping. Without this knowledge, he will not be able to work seriously with textures. Will not be able to make models ergonomic and make full use of resources efficiently. Without this knowledge, the modeler will never make a well, seriously textured model, for which the correct layout of texture coordinates will be very important.

Mapping is a simple nesting of a model. All our models are made up of a mesh of polygons. In fact, doing mapping, we conditionally divide our model into separate parts, which will help us to “stretch” the texture as accurately and without tightness as possible.

Working with the mapping modifier is very simple. If you don’t know how to work with it yet, then put it as the number one priority in the queue for learning, otherwise you are not a full-fledged specialist.

Many people work with the UVW Map modifier. I'm working with the UVW Unwrap modifier. Why? Because it is absolutely the same modifier, only with a bunch of additional features. I strongly recommend working through Unwrap.

Well, let's get started.

We have a simple model.

The first thing we do is assign a checker. This is the default texture, by default it is used to check the correctness of the mapping. If the model does not display squares, then the model needs to be adjusted in the mapping.

When assigning a material, the texture may not be displayed. This button is everything

Result after clicking the Show Shaded Material in Viewport button:

I personally do not feel comfortable working with a checker if it displays 1-2 squares per side. Therefore, I always put more tiling.

As we can see, on some sides the squares are not displayed properly - there are stretches - a sure sign of incorrect mapping.

Here is the main window for working with mapping. Now there is confusion - and this is not surprising. The program does mapping automatically when creating simple primitives, but over time, after you work on them, complicating the mesh, the basic mapping is violated.

The texture display area is circled in red. As a rule, in 3D it is customary to work with textures with equal sides or according to the rule: if one side is A and the second is B, then the texture size can be A=B or 2A=B or 4A=B and so on or vice versa. The main dimensions of the sides are multiples of 2: 512.1024, 2048, 4096, etc. Why is that? As far as I know, at least in the gaming industry, these are the most efficient and digestible sizes. [more precisely, the size of the side of the texture must be a multiple of a power of two (2, 4, 8, 16, 32, 64, 128, 256, 512, etc.) - this is due to the fact that game engines and compression algorithms /imaging works best at these sizes. Those. then a minimum of memory is used: disk, operational and video. This means that calculations performed with such images will be faster. Yes, you can use a 513x512 texture, but its size will be twice as large as 512x512 because of this one pixel - blog author's note]

No one will beat you with a stick if you have a texture of 314 by 745, but for me, as a person brewed in the subject, this will be an indicator of a lack of knowledge. Cases with the use of non-square textures are not so frequent. I am now talking about the example of a square texture.

Over time, you will understand that for a certain model structure, you can select a certain type of mapping. Now, on a simple form, I show an example of the simplest and most common method.

Select the whole model (uncheck "Ignore back part" in the modifier properties) and click Flatten mapping in the mapping window.

We see that the program has automatically decomposed our model into separate logical (for the program) pieces.

No need to rejoice and immediately proceed to the texture - we still have a lot of work to do.

So - we look. In the main viewport, a bunch of green lines are displayed on the model. These are the seams showing where the individual pieces of the mapping end. Green lines are duplicated in the same way in the mapping window. Often, experts strive to keep these seams as small as possible. Ideally, their presence is not desirable at all. This means that we need to sew the resulting pieces together.

In the mapping window, I selected one edge:

Click on it with the right mouse button (RMB) and select stitch (stick). [for me it is more convenient to do this through a hot key, which I assign myself to each command that I use quite often. - blog author's note]

The part that is in contact with this edge on the model will automatically stick to the selected edge:

As a result, through this operation, we get such a cutting. As you can see on the model, the green lines have become much smaller)

If we look closely at the junctions, we will see that the green lines have disappeared in the place where we "stitched", but did not disappear on neighboring hedgehogs that were in contact with the initially selected edge.

Things like this need to be fixed right away. There are two ways:

  1. Stitch and walk on them.
  2. Switch to points mode, select the necessary vertices and start (via the RMB menu)

So, we have a more or less comfortable layout of the model.

But... we have a texture square, and such a layout is not effective for a square (in this case, most of the texture will be wasted, eating the system resources we need so much). Therefore, for the sake of compactness, we will shred the model a little and redo our mapping.

The first thing you do is identify the identical parts. For example, here the top and bottom of the model are absolutely identical. If so, then it makes no sense for us to use a different texture on both elements. So, we will simply separate one of the repeating elements and impose it on our twin brother.

This often requires the function of mirroring and / or rotating the part.

Mirror and rotate the cut off UV piece:

Our mapping is still not efficient. The texture is very narrow and long. Of course, we can make a rectangular texture, but in our case - this goes against the original task - to make a square texture.

I selected the polygons of the cylinder in the main viewport and separated them on the mapping from the part. We received two halves of the sidewall of the cylinder.

I select one extreme edge on one of the halves and we see that the other edge is highlighted in blue on the second. The program shows which ej in which part we will now connect.

Here is now something similar to high-quality mapping. Drag our mapping from the gray background to the checker box in the mapping window. [this box represents the boundaries of the texture. In fact, there is a texture outside of this square, but it repeats the texture inside the square there. This is a rather interesting feature and I wrote a separate one about it - a note from the blog author]

Our mapping should not go beyond its boundaries. If necessary, scale (via CTRL) ALL(!!!) mapping at the same time. It is highly undesirable to scale the details separately, since now we have a mapping of all the details on the same scale. Which means that the texture will be displayed with the same quality throughout our model.

If necessary, you can safely swap parts, twist them, etc. for tighter packing.

Here's what happened to me

The final touch will be the action that I call "texporter" (based on the program of the same name))) This action is necessary to remove the mapping map, for further work with it in Photoshop (Photoshop FS) directly above the texture.

The following shows what settings should be and where to click OK) For the convenience of working with the texporter, I usually set the resolution to a higher one - then the mapping lines are thin, neat and accurate, which is very comfortable when working with them in Photoshop.

After pressing the "Render UV Template" button (render UV unwrapping), we see the mapping map, save it in a convenient graphical format and then open it in Photoshop with the "Screen" layer property (it will not be visible if the main background of the flash file is white ).

Everything. Successful mapping))

Subscribe to blog updates(here ).

P.S. The title image was made by 3D artist Giovanni Dossena using MARI, Maya and VRay. Full version.

creating texture coordinates by assigning a modifier to an object UVW Map(UVW-map) is used very often in practice. It is indispensable when different sub-objects require various methods projection. This modifier is selected from the general list of panel modifiers Modify(Fig. 14) and can be applied both to the entire object as a whole, and to its individual sub-objects (for example, to different faces) and allows not only using various types of projection for selected areas, but also manually adjusting the features of the selected type for a specific model .

Rice. 14. Adding a modifier UVW Map to the selected object

In total, there are seven types of texture map projection (Fig. 15):

  • planar(Planar) - produced along the normal to the surface and applied to any planes and similar objects, often serves as the basis for constructing more complex projections;
  • Cylindrical(Cylindrical) - designed for objects that have cylindrical shape(vases, bottles, table legs, etc.), and when the checkbox is on Sar(Slice) can additionally project the map onto the upper and lower ends of the surface. This type of projection wraps the texture around a cylindrical surface, forming a seam at the junction of opposite sides of the texture. Different variants cylindrical projection (with and without taking into account the ends of the cylinder), as well as the appearance of a seam characteristic of this type of projection is shown in Fig. 16, where the projection of the ends is turned on for the left cylinder, it is turned off for the right one, and the presence of a seam is demonstrated on the middle one;
  • Spherical(Spherical) - applicable to objects whose shape is close to the shape of a ball, and is implemented by wrapping the texture around the sphere with the formation of a seam from one pole to another and deformation of the texture at the poles. Pay attention to fig. 17, where both balls are assigned the same material with a spherical projection type, while the seam is not visible on the left ball, and the seam is clearly visible on the right ball, which is a complete copy of the left one, but turned to the opposite side;
  • Shrink-Wrap(Wrapped) - designed for objects that have a close to spherical shape, and provides wrapping the texture around the sphere like a scarf, which results (in comparison with the type Spherical) to a lesser degree of texture deformation near the poles, but to a greater degree - in the equator region;
  • box(Cubic) - used for objects that have a shape close to a box, and provides texture assignment for each of the six sides of the cube separately;
  • face(Face) - implemented by applying a texture for each face separately and is most often used in relation to patterned textures;
  • XYZ to UVW(Object coordinates to world coordinates) - designed to project infinite texture maps.

When looking for the optimal projection type for a particular object, you should generally favor one with a gizmo shape that is close to the object's shape, as this will usually minimize or even completely avoid texture distortion. However, it is far from always possible to say with accuracy which type of projection will be better, because in practice the form individual objects models only with a big stretch can be approximated to a strictly geometric one. Therefore, before making a decision, it is worth experimenting with different types projection and evaluate at which of them the degree of texture deformation is the least noticeable. Moreover, if there are several objects of the same type in the scene, then it is not at all necessary that the same type of projection will be optimal for them - there are situations when one object looks better, for example, with a cylindrical projection type, and the other - with a planar one. The most common types are planar, Cylindrical, Spherical and box the others are used much less frequently.

Let's try to install the modifier sequentially UVW Map to each of the objects of the working scene. First restore all the original texture map overlay settings in the rollout coordinates. Select the first object of the scene and to assign a modifier to it, select from the list of panel modifiers Modify string UVW Map, perform the same operation sequentially for the other two objects. After these steps appearance textures in objects will change (Fig. 18), and new modifiers will appear in the stack for each of the objects. Unfortunately, it can be stated that if initially (that is, with parametric projection) the texture was applied correctly to objects, now it is far from being correct. The fact is that by default when adding a modifier UVW Map projection type is set planar(Planar), unacceptable for ball, cylinder and cube. To correct the situation, select the ball and change for it in the section Mapping scroll Parameters option planar on the Spherical(Fig. 19). In the same way, change the projection type of the cylinder to cylindrical, remembering to enable the checkbox Sar(Slice) to texturize the ends, and the cube - to the cubic.

Rice. 18. The result of assigning a modifier to objects UVW Map

After changing the projection types, all three objects will look exactly the same as in parametric projection, so at first glance it seems that there is no advantage to using UVW maps. In fact, this is not at all the case. First, we were dealing with primitives for which the required texture map projection coordinates are set by default. Secondly, even in the case of primitives, the use of UVW maps opens up more possibilities for controlling texture mapping. So, by setting the values ​​of the counters Length(Length), Width(width) and Height(Height) you can define the size of the applied texture, parameters U-V-W Tile(U-V-W Mosaic) will allow you to set the number of repetitions of the texture along each of the axes, and turning on / off the checkboxes Flip(Flip) will provide a mirror image.

In addition, a modifier appears on the stack of objects UVW Mapping, having gizmo (Gizmo), - fig. 20. The gizmo shows how the texture is projected onto the object and determines the extent to which the texture map of the material extends, while the appearance of the gizmo depends on the type of projection (Fig. 21). Therefore, you can control the features of the map projection through the gizmo. For example, by moving it, you can shift the texture map along the axes (Fig. 22) with approximately the same result, which provides a correction of the material parameters U offset and V offset in a scroll coordinates. Gizmo scaling causes the texture to scale up/down (Fig. 23), while rotation allows you to change the projection type and reveal cylindrical and spherical swirls.

Rice. 20. The presence of a gizmo in the modifier UVW Mapping

To deal with the nuances of texture control through a gizmo, let's first try to turn the cube into a thin box (Fig. 24), and then ensure that the photo used in texturing is placed in the center of its upper plane to create the illusion of a picture in a frame. First, switch to the material editor and in the rollout coordinates disable texture repeatability by unchecking the options Tile(Fig. 25). Select an object, go to the panel Modify and in the modifier stack, click on the plus next to the modifier name UVW Mapping, which will switch to gizmo control mode. Activate the tool Select and Non-uniform Scale and manually resize the image so that it takes up O most of the plane of the parallelepiped. If necessary, adjust the position of the texture in the center of the plane with the tool Select and move(Fig. 26). To display a texture along an axis U, turn on the checkbox Flip, located to the right of the field U Tile, and further rotate the gizmo parallel to the axis X by clicking on the radio button X. When done, move the gizmo up the axis X(Fig. 27) so that the image is displayed only on the upper face of the box and is not visible on all the others. If during scaling you had to increase the size of the gizmo (which automatically led to significant texture distortions), as was the case in our case, then at the end of the experiments it is better to replace in the scroll bitmap Parameters the file used as a texture to a larger image. A possible result is shown in fig. 28.

You can control the orientation and exact dimensions of the gizmo not only with the tools from the toolbar Mail toolbar, but also through the section Alignment(Alignment) scroll Parameters(Fig. 29). Switches X, Y and Z ensure that the gizmo rotates parallel to the specified axis, the command fit

Some illustrations on this page animated. To see the animation, your Internet Explorer must have the option at the menu address enabled: Tools / Internet Options / Advanced(search in the "Multimedia" settings item).

In the last chapter, we mainly looked at applying textures to an object. As we have seen, there are different overlay methods: binding a texture to world space, binding a texture to object space. When a texture was placed in world space, it would slide over the transforming object. When the texture was placed in the space of the object itself, when the object was transformed, the texture behaved as if it were drawn on its surface. But if the object was deformed, the texture would still start to slide. The 2D texture applied using the Planar From Object method behaved especially amusingly.

But there was one example where the texture was mapped using the Explicit Map Channel method. The object was deformed, but the texture did not float or slide, it was as if drawn on the surface itself. This overlay method is most in demand. Most real-life objects are limited to the surface on which the texture is actually drawn, and not on which the texture is bizarrely sliding. Of course, sliding can come in handy when our texture is used to simulate shadows and lighting, or to draw some tricky chameleon, but now we know that this can be done without too much trouble.

Now we will figure out how to make the texture not slip on the surface. And so that the texture does not slip on the surface, a special UVW space is created. The space is created not for the texture, but for the object. For the texture, you can choose which space to put it in, either in world XYZ, or in object XYZ space, or you can put it in UVW space. There is no such option in the texture parameters - put in UVW space, instead there are Explicit Map Channel and Vertex Color Channel options. Explicit Map Channel - the given map channel. For him, you need to select the channel number. The channel number is, as it were, the number of the UVW space. The same object of these spaces can have up to 100 pieces. In fact, there are even more of them - after all, Vertex Color is also a UVW space, only it is called differently and has a slightly different purpose. But in essence it is similar to regular UVW. And there are also two spaces Vertex Illumination and Vertex Alpha.

How is an object placed in UWV space? Actually, UVW is some kind of parallel space. The same object can exist both in XYZ space and in space UVW. It's just that while we haven't created a UVW space for it, it exists only in XYZ.

In order to create a UVW space, the UVW Map modifier must be applied to an object. It not only creates the space itself, but also creates texture mapping coordinates in it, that is, this modifier determines what shape the object will have in the space where our texture will be filled.

So let's start applying the UVW Map modifier.

UVW map modifier

If we don't want our texture to float, then the modifier UVW map should be placed on the stack in such a way that it is under the modifier responsible for the deformation of the object. In our case with the dinosaur, which was used in the previous chapter to illustrate how the texture floats, the modifier for binding the skin to the animation skeleton was used. There are various modifiers that allow this operation to be carried out, so while we have not considered them in detail, we will call them common word- skinning.

If modifier UVW map apply for skinning, that is, located lower in the stack, then the texture is first applied to the faces, and only then the surface is deformed. And the texture is attached to the edges rigidly, as if drawn on the surface. If the modifier UVW map applied on top of the skinning modifier, then the surface will be deformed first, and only then the texture will be superimposed on the faces, that is, it will be superimposed on the deformed shape, and it will still float.

If other modifiers are applied to our object, such as Symmetry and MeshSmooth (TorboSmooth), then they also interact with UVW map. Symmetry, if applied on top of a UVW map, then the created half is completely symmetrical to the first, and the textures on it lie accordingly. If the UVW map is applied on top of the Symmetry, then it is possible to make the texture not symmetrical on the symmetrical halves. MeshSmooth (TorboSmooth) anti-aliasing modifiers, if they are applied on top of texturing, they usually slightly distort the applied texture, but often these distortions are either not visible at all, or even play a positive role - that is, when the object is rounded and the texture is located so that it lies on him well.

MeshSmooth or TorboSmooth modifiers are best applied over skinning. The fact is that skinning is better for a low-poly model - fewer vertices, less fuss. In addition, in such a sequence of applying modifiers, MeshSmooth or TorboSmooth smoothing can be safely turned off or the number of iterations can be changed. If skinning is done on top of anti-aliasing, then we will have to work out a larger number of vertices, and it will not be possible to turn off our anti-aliasing.

Let's start by trying to apply a two-dimensional texture like bricks (aka tiles) on the object, shown in Fig. 22.1.

How to make such a card, we will later find out when we consider the cards in more detail. You are not required to repeat everything that is written in this chapter, so you do not need to create this texture right now. Your task is to read and understand. But when you understand, then you will try to do something.

To immediately see what happens, we must click in the material editor, when we are working with this map, click the button Show Map In Viewport . Be careful, the same button is also available when working with the material itself. It is better to press it in the mode of working with a specific map, because one material can have many maps, and if you press the button for a material, it is not known which map will break into the projection window. Everyone won’t break through at once, that’s why this viewing is preliminary, in order to save time. Therefore, it will not show everything as it will be in the end.

So let's look at the modifier. To do this, select our object and apply a modifier (Fig. 22.2).


Rice. 22.2. Application UVW modifier map

This modifier, like many others, has a Parameters menu group. At the very top, there is a group of Mapping options and there is a large list of these same options in it. On fig. Figure 22.2 shows the situation when the Planar option is selected. This means that the texture is projected onto the object with rays that are perpendicular to the plane indicated by the orange rectangle. That is, the drawing is located in this plane, and the plane is, as it were, illuminated by rays that are perpendicular to it, and these rays project the drawing onto our object.

A lot of interesting and colorful pictures on this topic can be seen in the 3ds MAX help, if you type the word UVW in the "pointer" tab of the help and then select map modifier under it. Everything is so clear that it is understandable without translation.

This plane is a sub-object of the modifier, this sub-object is called Gizmo. If you switch to the mode of working with it, then you can rotate, move and scale this plane in every possible way and see what happens to the pattern that falls on our object. If anyone wants to try, click on this file. Transformations (moving, rotating, scaling) of the Gizmo sub-object can also be animated, for which you need to press the Auto Key (Animate) button and perform the appropriate actions on the desired frames. This animation is made in the file, don't let it bother you if you want to rotate and move the Gizmo. In the Curve Editor (Track View) menu, if you find the name of the object to which our modifier is applied, and expand the Modifier Object branch of it, then you can find our UVW Map modifier there, and if you expand it, you can find the Gizmo subobject in it, for which you can also expand the plus sign and access the rotation, translation and scaling and their animation controllers.

Note that the gizmo has a ponytail, as it were. It marks the top of the texture. That is, the top of the picture shown in Fig. 22.1 will be on the side of this ponytail. Also, if the Gizmo is selected, its right side will be displayed in green (that is, the side that corresponds to the right side of the texture shown in Figure 22.1).

Now let's immediately go down to the very bottom of the Parameters menu. There is a group of Alignment options. And right below the label there are three radio buttons: x, y and z. They allow you to choose the axis along which our texture will be projected (along which the projector rays will shine). The plane of the Gizmo will be perpendicular to the selected axis. Just keep in mind, if you have already rotated the Gizmo with the "rotate" tool, then when you switch the axes, the Gizmo will already be rotated relative to the selected direction by the angles by which we rotated it.

There are buttons below:

  • fit- enter. By default, immediately after applying the modifier UVW map, this operation has already been carried out. But if we rotated the Gizmo, or switched the axes along which the projection should be carried out, then our Gizmo can be positioned so that the object in some directions either does not fit into it, or takes too much space. small area. By pressing the Fit button, the dimensions of the Gizmo are set in such a way that the projection of the object on this plane fits completely into it, touching the boundaries of the plane. At the same time, the texture is projected onto the object in such a way as to stretch over it completely, but the excess would be left to a minimum.
  • Bitmap Fit- sets the proportions of the Gizmo so that they correspond to the proportions of some picture or video from the file (which 3ds MAX understands). The file will need to be specified after clicking the button.
  • View Align- aligns the Gizmo parallel to the active view plane.
  • reset- useful button. If we screwed up God knows what, we can return everything to its original state.
  • Center- Centers the Gizmo at the center of the object.
  • normal alignment- makes the Gizmo perpendicular to the selected normal. If the button is pressed, it will turn yellow and the cursor will turn into a cross. If you then point it at our object, press the mouse button and move the cursor, then the cross travels along the edges, and the Gizmo rotates so as to be perpendicular to the normal of the face (that is, parallel to this face itself).
  • Region Fit- enter the area. If you press the button, you can simply drag the rectangle with the mouse right size.
  • Accure- copies UVW Gizmo settings from another object. For this option to work, the other object being copied from must have the UVW Map modifier applied and not collapsed. Copying can be done using two methods: relative Releative - when the copied Gizmo is placed relative to the anchor point of our object in the same way as the source, and absolute Absolute, when the Gizmo is placed exactly in the same place as the source. You can select these modes after pressing the Accure button and selecting the object from which you want to copy the Gizmo settings. After that, a menu will appear.

Here. The buttons most needed at the moment are fit and reset.

Let's return to the Mapping group of parameters. At the very top is a list of switches:

  • planar- Flat - the texture is projected from a plane. We have already considered this mode.
  • Cylindrical- Cylindrical - the texture is projected from the walls of the cylinder into which the object is placed. The texture, as it were, wraps the object along a cylindrical surface. If you enable the option Cap, then flat covers are created at the top and bottom, from which the texture is projected onto the top and bottom of the object.
  • Spherical- Spherical - the texture wraps around our object, like a globe sticker around the globe itself.
  • Shrink Wrap- Wrap - the texture wraps around the object, as if we put the object in the middle of the scarf, and the edges of the scarf were pulled together so that the object was inside.
  • box- Box - the object is placed inside a parallelepiped, from each of the walls of which the same picture is projected. The image on each side of the parallelepiped is projected onto faces that are at an angle of no more than 45 degrees to the corresponding side of the parallelepiped. If this angle is larger, then the image is projected onto the corresponding face from the other side of the same parallelepiped.
  • face- edge - The texture is stretched on each triangle individually.
  • XYZ To UVW- overlays the texture as if it were not projected onto the object, but poured into space, as we considered it in the previous chapter. This option is very good for 3D textures. On fig. 22.3 b) you can see an example of how the surface is deformed, to which this texture mapping mode is applied (applied for skinning).

So, in fig. In Figure 22.3 we see how the texture behaves when applied with the UVW Map modifier. Figure a) we already saw in the last chapter, and figure b) shows that a 3D texture can also be attached to faces. In fact, a 3D texture can be applied not only by XYZ To UVW but also for all others. But the result obtained by other blending methods will be difficult to understand until we take a closer look at what UVW space is.

On fig. In Figure 22.4, you can see how different the coloring of models is, to which the same material with the same texture was applied, but the UVW Map was applied using different methods.

Why did it happen? Because when the Planar modifier is applied, it sort of compresses our object in UVW space so that it fits into a 1x1 square (this happens with an object in UVW space, but in ordinary space it remains unchanged). The fact is that flat (two-dimensional) textures in UVW space are filled in such a way that they occupy 1x1 squares there, so if we want the texture to stretch over the object completely and not repeat on it, then we need to fit our entire object entirely into such square.

As for the XYZ To UVW method, it does not compress the object in UVW space, but creates an exact copy of it, that is, the coordinates for each vertex in UVW space are exactly equal to the coordinates of the corresponding vertex in XYZ space. (In UVW space, the faces of the object are the same, but the vertices for them are different).

The 3D Planet texture shown in Fig. 22.4 has a size of color spots much larger than 1x1 (you can, of course, turn the settings and make the spots smaller, but we did not do this). Therefore, the dinosaur, to which the Planar texturing method was applied in UVW space, was reduced to 1x1 and completely fell into a spot of the same color. Scales are also not visible on it, because when texturing with scales (for the Bump property), the same thing happened - the dinosaur completely fit into the size of one scale. In this case, the Celluar scale texture used for the Bump and the texture for the Planet coloration were filled in the same UVW space.

It would be possible to fill them into two different UVW spaces, then for each one would have to apply the UVW Map modifier separately.

To do this, the UVW Map modifier has a group of Channel parameters. By choosing the Map Channel number, we choose the number of the UVW space that is created and into which our object is placed using the UVW Map modifier. You can switch from Map Channel to Vertex Color Channel. In general, the Vertex Color Channel has the number "0" and is intended to store the colors of the object's vertices. But if desired, the colors R (red) G (green) B (blue) - can be converted into x, y, z coordinates using the formula:

If we then collapse this modifier, then we will lose the vertex coloring we did earlier. If we did not color the vertices, then after collapsing they will acquire colors, which are calculated by formulas (22.2). It's better to apply textures in the Map Channel rather than in the Vertex Color Channel.

So far, probably, this is not very clear to us, we will then deal with these things separately. In the meantime, we have not figured it out, we will fill our textures in UVW-spaces like Map Channel with different numbers.

So, all texture mapping methods, except for XYZ To UVW, are mainly intended for mapping 2D maps.

Texture mapping with Gizmo using Bitmap as an example.

Of particular note is the two-dimensional Bitmap, which allows you to use any bitmap that 3ds MAX supports as a texture. This means that we can draw almost anything and overlay it on our object.

Consider a simple (not yet very correct) example of how you can draw and apply a texture in the form of a picture.

Until we have enough knowledge to create a complex texture that will wrap our object in the right way, we will do it simply: draw a texture that can be projected from the side. To do this, let's go to the side view (Fig. 22.5):


Rice. 22.5. Object side view

Let's take a picture of this view: to do this, press Prt on the keyboard. Sc - Print Screen button, it copies what is displayed on the monitor to the clipboard. True, it does not copy mouse cursors and video, but we do not need this. Next, let's launch some kind of graphic editor, such as Photoshop. Who doesn't have a special graphic editor(very bad, by the way), he will have to run Ms Paint - which is included with Windows. Next, you need to paste the picture from the clipboard (Ctrl + v buttons on the keyboard or the Paste tool / Paste in the Edit menu of your graphics editor).

The entire monitor screen is pasted. We need to cut off the extra edges. In Photoshop, this can be done by selecting the desired area with the Select tool, and then choosing Crop from the Image menu. Then everything that does not fit into the frame will be cut off. In Paint, you will have to reduce the attributes of the picture (in the Picture menu), while not what you need may be cut off. Do not try to cut exactly along the edges of our silhouette! Leave small margins around.

Then, who works in Photoshop, may create a new layer (so that the source is preserved), or may not create. Next, draw with the help of brushes and pencils our texture (Fig. 22.6).

Again: do not try to draw exactly along the contours, let it crawl out a little, it's okay!

Now we save our file, whoever works in Photoshop can save directly to PSD.

Attention: it is better to save image files that store textures for our model in the same folder where our model is located. You can create a separate folder for textures in the same folder, sometimes it is convenient. The textures themselves are not embedded in the file with the model, they are always stored separately. If the textures are in the same folder as the model file, then when the entire folder is moved, 3ds MAX then quickly finds the texture. He also finds it when the texture is in the Maps folder, which is located in the 3ds MAX working folder. But it's better not to store your textures there. Firstly, because you can’t store many files with the same names in one folder, secondly, there are already a lot of all sorts of textures, it will be difficult for you to find the right one, thirdly, if you reinstall programs, you can accidentally erase your textures , and fourthly, if you want to transfer files to another computer, it will be much more convenient for you to do this when everything is in one folder.

In the material editor, for the Diffuse property, select the Bitmap. In the Bitmap Parameters menu group, right at the very top there is a long button, to the left of which it says Bitmap. You must click on this button and specify the location of the file with the picture.

Leave all parameters as default for now. Note that Map Channel = 1 by default. Now we need to apply the UVW Map modifier to the model. And you need to apply it for the same Map Channel that is specified for our texture (that is, for the first one) (Fig. 22.8).

First, since we have a side view, we need to specify the X direction in the Alignment group of parameters. With this arrangement of the image, as shown in fig. 22.6, it is necessary that the tail showing the top is located on top of the model. To do this, the Gizmo will need to be rotated around the X axis by angles that are multiples of 90°. Be aware that there are several auxiliary coordinate systems whose orientation may depend on the view. To avoid confusion, it's best to choose the World Auxiliary Coordinate System (Chapter 3, Coordinate Systems in 3ds MAX). After doing all the rotations, it's better to press the Fit button so that the Gizmo's borders are set to the extreme points of the object.

Then our Gizmo will need to be moved a little more in the XZ plane and scaled in it, so that the texture is completely "put on" the object. On fig. Figure 22-8 shows that the Gizmo is somewhat larger than the object itself.

Here is the result (Fig. 22.9):

Here we have edited the Gizmo to fit our object into the texture. And you can do something else: apply a texture so that it does not fit on our entire object, but only on part of it. Let's take a picture depicting an inscription (Fig. 22.10).

By default, the overlay coordinates are applied to the Box object using the same Box. Let's now apply the UVW Map in Planar mode.

Here you can use the Bitmap Fit option in order to correct the proportions of the picture (Fig.22.12).

Now let's scale the Gizmo evenly until the label is the right size (Figure 22-13).

Rice. 22.13. When the Gizmo is scaled down, we see that the pattern repeats periodically.

The effect that can be seen in Fig. 22.13 is due to the fact that when the texture is poured into UVW space, it periodically repeats there. One period of a 2D texture occupies a 1x1 square. The Gizmo helper object tells us what dimensions the texture will have relative to our object, but in fact, when we operate on the Gizmo, the object in the UVW space changes its size. Now our object has become larger than a 1x1 square and has covered several periods of the texture with its area.

And we need the inscription to be repeated only once! To do this, go to the material editor in the parameters of our map and in the Coordinates menu group turn off the Tile checkboxes (repeat). Now the order (Fig. 22.14):

By turning off the repeat for the texture, we made it so that it fills only one square in UVW space, but does not repeat in all the others.

By the way, if we now turn our Box over and look at it from below, then there we will also see this inscription, only mirrored. To avoid this, in the Coordinates menu group, turn off the Show Map on Back checkbox - show the map from the back side. At the same time, it can still be displayed in projection windows, but it will definitely not be displayed when rendering. About the backside: In UVW space, when it comes to 2D textures, there is a direction in which the texture is projected. If the projection vector (or, to whom it is more convenient, the projector beam) stumbles upon the front side of the face, then the texture is projected, but if it is on the wrong side, then with the Show Map on Back flag turned off, the texture is not projected onto the face turned to it from the wrong side.

Using Multiple UVW Spaces

We got acquainted with the Diffuse and Bump material properties. Let's say we now want our dinosaur, colored using the Bitmap map, to be covered with convex scales of the Celluar map, while not floating when Celluar is deformed. We will use the Celluar map for the Bump property.

In order for the Celluar map not to float, you need to select the Explicit Map Channel mode for it. If we do this, and leave the first channel as the Map Channel, then the situation shown in Fig. 22.4 for the dinosaur pictured on the left. The fact is that we applied the UVW Map with the Planar method for the first channel, and it has already been said what happens with three-dimensional textures. It is possible to make a UVW Map using the XYZ To UVW method, but not for the first channel, otherwise we will lose the settings already made for the Bitmap.

Recall that the UVW Map modifier is not applied to the map, but to the object. And if we applied a UVW Map for the first channel, then we have created a UVW space in which our object is located in a special way. We can pour into this space different textures, but they will be superimposed on such an object as it became in the first UVW-space after the action of the UVW Map modifier.

For the Celluar 3D map it is better to apply the UVW Map modifier in XYZ To UVW mode. And in order not to spoil the space for the Bitmap overlay, we will apply this method for the second channel (for the second UVW space). To do this, once again apply the UVW Map modifier to the object, only specify the number 2 for the Map Channel. And for the Celluar map applied in the Bump property, also specify Map Channel = 2, then it will be filled into the second UVW space.

If, for example, we specify for Map Channel = 2, and the UVW Map modifier for the second channel is not applicable, then when rendering we will get a message that we did not do this. It will indicate for which channel and for which object no UVW space has been created. Don't forget that the Celluar 3D map must be overlaid using the XYZ To UVW method!

Combining cards

Then we need a Composite map - this is a composer map that allows you to mix several other maps.

In our material, we will replace the Bitmap for the Diffuse property with a Composite map. To do this, in the mode of working with the map, you need to click on the button on which we now have Bitmap written (see Fig. 22.7). We will get to the map navigator, select Composite there. We will have a window in which a choice will be offered:

  • Discard Old Map? - delete the old card?
  • Keep old map as sub-map? - save the old map as a sub-map?

We will choose the second option so that our map is saved and click "OK"

Now we have Composite instead of the Bitmap inscription on the button, and instead of the Bitmap map parameters, the Composite map parameters.

There are not many of them: the Set Number button (select the number of cards for linking), and on the right in the gray box the number of cards that we will link is displayed.

Even lower - in the column of the inscription Map # (map number) and opposite them are buttons with the names of the maps. In one such button, our Bitmap should have been saved (since we chose the second option - with saving the original map). Behind the buttons are squares with flags, if the flag is on, the map is turned on. You can turn it off, then it will not affect.

Since things are getting serious here, it's time to start naming the cards. We will name the Composite map Dino Diffuse (the name is printed in the line before the button that says Composite).

Now, if you click on the button with the Bitmap map, we will get into its parameters, and you can immediately change its name in the line opposite the button labeled Bitmap (which will appear instead of Composite). Let's call this card Dino Skin Color. Why should this card be placed in the first slot (first button) of the Composite card? Because sub-maps in the Composite overlap each other, sub-maps with low numbers are placed in the lowest layer, and with large ones - in the top. We need to place the inscription on top of the main coloring, so we will place it in button number 2. To do this, we will exit the Bitmap to the top level, into the Composite () map, click on the button opposite the Map 2 inscription, select for it again the Bitmap map, for which upload the image shown in Fig. 22.10, and let's call the Bitmap itself Dino tattoo.

Reminder: The Go To Parent button allows you to exit the map mode to work with a material or parent map that includes the original map. Roughly speaking, this button takes us one level up. If we leave Map Channel 1 for the Dino tattoo map, then when we click the Show Map In Viewport button for it, we will see this (Fig. 22.16):

Rice. 22.16

As we can see, in the first channel the inscription is superimposed badly. Please note! You can't use the UVW Map for the first channel, otherwise we'll break the Dino Skin Color map overlay. The second channel we have is occupied by the Celluar-map, which is also superimposed not in the way that the inscription should be superimposed. It remains only to fill this map into the third, still free channel and once again apply the UVW Map for the third channel.

So let's do it. Let's make all the settings for the Dino tattoo card in the same way as we did them when we put this inscription on the Box object, and scale the inscription itself as necessary. Let's not forget to set Map Channel 3 for our map (Fig. 22.17).

Now, to make our inscription transparent, we can enable the Alpha From RGB Intensity checkbox in the Output group of the Dino tattoo map - take opacity from the brightness of the image. In our case, this is quite acceptable.

Now, in order to understand everything to the end, we will put the same inscription in another place. Let's say we twist it around the neck. In order to place it in a different place, you need to use the UVW Map modifier again. And as you can guess, in order not to damage the overlay of the previous label, you will again have to apply a new Map Channel (4).

Unfortunately, it is not possible to pour the same texture into two UVW spaces, so we will have to create a copy of our Dino tattoo map, which will differ from the original only in that it will have Map Channel = 4.

In the Composite map mode, press the Set Nember button and type 3. Attention! If you decrease the number and press Ok, the last cards will disappear! If you later increase the number again, the buttons that appear will be empty.

Increasing the number is painless.

Now let's click on the button in which the Dino tattoo map is placed and drag it into a free button (Map 3). In the menu that appears, select Copy (copy). Do not select Instance, otherwise we will have dependent copies, exactly the same!!! And we need the Map Channel to be different!

The copy of the map will be named Map #, we will rename it to Dino Tattoo2. Let's not forget to specify Map Channel = 4 for it.

Now apply the UVW Map and set its Map Channel = 4 as well. This time we will overlay using the Cylindrical method. Here you can also make a Bitmap Fit. To work with a cylindrical Gizmo, it is convenient to use the local coordinate system.

And here is what we ended up with.

Texture map overlay coordinates. UVW Map modifier (UVW texture projection)

It often happens that after applying a material, when trying to render an object, the program displays an error message (Fig. 7.18).

Rice. 7.18. Missing Map Coordinates window


The fact is that in the process of building an object, its projection coordinates can be violated. This window explains which error is preventing rendering, the name of the object that had this error, and the error number.

Mapping Coordinates contribute to the correct mapping of the texture on the surface of the object. When assigning a material containing textures, both the object and the texture must have overlay coordinates. Only in this case the correct rendering of the texture is ensured. When creating standard primitives and compound objects, texture overlay coordinates are assigned automatically. For other objects, coordinates must be assigned.

There are two ways to assign texture mapping coordinates to an object:

Set the Generate Mapping Coords checkbox in the object's parameters. (Generate texture overlay coordinates);

Apply a UVW Map modifier (UVW texture projection).

The Generate Mapping Coords parameter. (Generate texture overlay coordinates) is available in the scrolls of settings for primitives, splines, objects of rotation and extrusion. Generating overlay coordinates using this checkbox is an easier way, but applying the UVW Map modifier (UWV texture projection) provides additional features. First, its use allows you to create texture mapping coordinates for objects that cannot generate them, such as editable meshes and polymesh. Secondly, it makes it possible to adjust the overlay coordinates, which, in turn, allows you to influence the location of the texture. Thirdly, it makes it possible to change texture overlay channels and the type of material overlay coordinates. And finally, fourthly, it allows you to select the texture projection system using the modifier container (Gizmo), which is usually called the texture mapping container. The shape of the texture mapping container determines the projection method: in planar, cylindrical, spherical, 3D, rectangular, and so on (Figure 7.19).


Rice. 7.19. The result of applying various shapes of the overall container of the UVW Map modifier (UVW texture projection)


In addition, the texture overlay is determined by the placement, orientation, and scale of the container. For example, a flat container projects a texture in one direction. If the surfaces of the object to which the texture map is applied are not parallel to the plane of the container's surface, the texture is extruded based on its orientation. If you want to avoid texture distortion, choose a container whose shape is close to the shape of the object.

Planar projection coordinates are set by default.

The UVW Map modifier settings (UVW texture projection) are located in several areas (Fig. 7.20), among which are the following:

Rice. 7.20. UVW Map modifier parameters (UVW texture projection)


Mapping (Texture overlay) - sets the type and size of the container, sets the parameters of the texture map and its multiplicity (the number of repetitions in the material (Tile)), and also allows you to change the orientation of the map (Flip);

Channel - allows you to set up to 99 various options assigning overlay coordinates to an object. To display a particular overlay, the object's overlay UVW channel must match the overlay texture's UVW channel;

Alignment - Sets the alignment of the location, orientation, and scale of the overlay container with respect to the texture map, object, or global coordinate system.

The following container alignment commands are available in the Alignment area:

X, Y, Z – switch positions for aligning the overlay container along the corresponding axes of the global coordinate system;

Fit (Fitting) - resizes the overlay container so that it matches the size of the object. In this case, the proportions of the texture may be distorted;

Center (Center) - aligns the overlay container to the center of the object (or to the center of the selection in the case of several objects);

Bitmap Fit - Resizes the overlay container to fit the size of the bitmap. This eliminates the distortion of the proportions of images associated with the material used;

Normal Align - allows you to align the overlay container to the normals of the object's faces by dragging the pointer over the surface of the object;

View Align - aligns the map overlay container with the current viewport;

Region Fit (Alignment by area) - allows you to change the size of the overlay container by dragging the mouse pointer;

Reset - resets container resizing and sets default sizes;

Acquire - Fits the overlay container to the coordinates of another object.

You can also change the position, orientation, and scale of the overlay container by selecting it in the modifier stack and performing transformations.

To practice the theoretical material, do the exercises "Exercise 3. Texturing the sofa and armchairs", "Exercise 4. Texturing the TV" and "Exercise 5. Texturing the ceiling" from the "Practice" section of this chapter.


| |
Liked the article? Share it