GIG reference manual

TextureEditor tutorial / Maps tutorial

____________________________________________________________________________________

Section contents

See also the Intercol program maps tutorial for advanced intercol map creations.

Introduction

This tutorial explains how to use the TextureEditor to make and apply custom made textures.

The TextureEditor is used to generate and work with procedural textures. Textures are never converted to an image map. They remain mathematically defined, with very high precision. Scaling of the object has no influence on the resolution of the texture at the surface of the object. It also means that at any point in the design process, changing some of the parameter values is possible without needing to regenerate the texture map.

Another benefit to procedural textures lies in the fact that any number of parameters can be animated independently.

Materials

By default, pre-defined materials can be selected from the TextureEditor. They consist of a series of linked basic textures with maps plugged in their parameters.

Textures

All the materials in the TextureEditor materials menu are created from six basic texture types: Each of these six texture types have parameters to control various aspects of their use. Each parameter can take a map to set its value. A map cannot be applied to an object by itself. It must be used as a parameter in one of the basic textures.

Parameters

Textures can accept only a few different types of parameters. Note
Due to some internal evaluation limitations of the application, the user interface can not always detect whether the correct type of map will be plugged into the correct type of parameter. Plugging a value map into a color parameter, for instance, will create an error. However pressing the confirm button of the error message box will perform an undo command to restore the previous value of the parameter. The different maps can be identified as follows: the value of a value map will be just a number or a single slider. A color map will have three values (0.0000, 1.0000, 0.8), [0.00, 1.00, 0.8] or three sliders. A bump map will have the name of the bump function in it.

Map Types

In addition to the division into maps that return values, colors and bumps, maps can be either two dimensional or three dimensional.

Two dimensional maps use what is called the uv coordinate system of the individual objects to perform their mapping. This coordinate system will produce seams where surfaces meet, because each surface has its own uv system. (ie: a uv map on a cube will not wrap around the edges and continue onto the next face.)

Three dimensional maps use the object's local XYZ coordinate system for their mapping. This means that the maps can be considered solid and pass through the objects regardless of where the edges lie. They will continue around edges.

Map Classes

There are two classes of maps in the TextureEditor.

The first type is the basic, or pattern map. These maps will only create a basic pattern to begin working with.

The other type is the modifier map. Modifier maps can be used to modify basic maps, or other modifier maps. They may be stacked as many layers deep as needed to achieve the desired effect.

Conversion Between Types

There is also a full set of modifier maps to convert one map type into another type.

____________________________________________________________________________________

Tutorial 1: selecting, saving and applying materials, textures and maps

First, reset everything from the main interface general menu. Then, create a cube and size it up so that you can see it. Give it a tag, 'cube_tag.' This will be your current active solid that will get a texture applied to it.

Now, in the GIG general menu, select 'tools,' and from there choose TextureEditor.

After the TextureEditor interface appears, select 'files' from under the texture preview window.

Choose 'cube' from the 'sample objects' list and press confirm. A cube will appear in the texture preview and replace the default preview object of a plane with a ball.

Note: This 'cube' in the 'sample objects' list is not the same as the cube in your still. It is only an object to simulate the texture on a cube, to give an impression what it will look like on your final model. If you want to have a sample object that represents exactly the object in your model then go back to GIG. Select 'render' in the main menu. Select 'render texted'. A file name will be asked. Type: 'my_cube' and confirm. Now the cube will be rendered in a special file format. This file will be used in the TextureEditor to simulate. After the rendering is finished, go back to the TextureEditor (the TextureEditor button is already visible beneath the Tools menu button). In the TextureEditor, when you select 'files' from under the texture preview window again, 'my_cube' will also be in the list of sample objects. Choose 'my_cube' and press confirm. Your cube will appear in the texture preview and replace the previous sample object.

Select the materials button in the main menu on the left-hand side, to select the predefined materials in the TextureEditor.

After you select one of the eight possible materials, a submenu will replace the materials menu. The button at the top will bring you back to the main materials menu. Selecting one of the sub-menu buttons will load a sheet of icons with materials.

If you select the icon with a left mouse button click, the material will be shown in the preview window and an explanation of the material will be given in a box beneath the preview window.

When a material is selected and shown in the preview window, there are two ways of putting the material in the working area. First, move the mouse cursor in the working area and click somewhere in this area with a left mouse click. The texture frame box will appear at that position. The material will also appear on a predefined position by clicking on the selected icon a second time with the left mouse button (or by double clicking with the left mouse button right away.)

The chosen material has several variable parameters that can be adjusted. The result is interactively visualized in the preview window.

To select a basic texture select the textures button in the main menu on the left-hand side.

The most basic texture is the diffuse texture. Double click it, and it will appear in the working area. You can type any color value in the diffuse_color parameter, or slide any of the color sliders after the switch buttons are pressed.

To browse the maps that are available, click the maps button in the main menu on the left-hand side.

When clicking with the left mouse button once on one of the map names, the preview window will show the map. If the map is a basic pattern map it will be displayed. If it is not, a description of how it is used is shown beneath the preview window. For a complete description of all available maps refer to the maps manual.

Browse to and select '2d_value_u.' This map shows a fade along the u axis of the surface of a 2d basic value map.

When you click again (or if you double clicked in the first place), the map will appear in your working area, and the visualization of the map disappears from the preview window.

To visualize this map, and later apply it to an object, it needs to be inserted into the value parameter of a texture.

Click on the map plug in the 2d_value_u map, and plug it into the diffuse_value parameter socket. In other words, first click on the plug symbol of the 2d_value_u map, then on the map socket symbol of the diffuse_value parameter in the diffuse texture. The active texture is displayed in the preview window. This is the diffuse texture with the 2d_value_u map as the diffuse_value parameter.

To apply any material to the cube in the model in GIG, first select 'general' from the main menu. The first listbox shows the tag names of the objects in the current model. Select 'cube_tag.' Select 'put texture on tag.' The active texture is applied to your cube now.

Note: Even when there is more than one texture in the working area, there is only one texture active at any moment in the TextureEditor. This active texture is visualized in the preview window and has a red "socket".
Now, to render the model, either select 'render window' on the right hand side of the interface or return back to GIG and render.

When you have created your own texture (or own adjusted material) and you want to save it for later use, select the menu button at the top of that texture. Select 'save as texture'. A dialogue box pops up. You can give your texture a new name, the file name that it will be saved under and a description of the texture. After pressing confirm the texture is saved in the current project an can be retrieved after selecting 'textures' and selecting the file name from the 'saved texture' listbox.

Note: Saving a map works in a similar way. Select the menu button at the top of a map. Select 'save as'. A similar dialogue box as with saving a texture pops up. You can give your map a new name, the file name that it will be saved under and a description of the map. After pressing confirm the map is saved in the current project and can be retrieved after selecting 'maps' and selecting the file name from the 'saved maps' listbox.

____________________________________________________________________________________

Tutorial 2: using a modifier map to change a basic pattern

In this tutorial, you'll load a basic pattern map and modify it.

First, delete the texture that you made in Tutorial #1. Select the 'menu' button from the texture control bar and choose 'remove' or select 'reset' on the right hand side menu.

Select 'maps' and double click on the 2d_value_checker map. This will be our new pattern map.

Now, double click on 2d_value_transform_map. This will be the modifier.

Plug the checker map into the value_map parameter of the transform_map.

Select a diffuse texture and plug the 2d_value_transform_map into the value parameter of this texture (see Tutorial #1).

Slide the sliders and see how the texture is transformed in the Preview window.

Now, let us say that you want the squares to remain square instead of stretching into rectangles. Click the arrow on the right hand side of the scale_v parameter. It will turn into a simple value parameter. You can now click in the box with the scale_v value, and type 'scale_u' By typing that, you are telling it to read the value from scale_u and insert it into scale_v. When those two are the same, the map will remain square when you slide the scale_u slider. The ability to define relationships between different parameters is very powerful.

Note: Another, consistant way of using parameters in the TextureEditor is by adding a new parameter to the texture and using this parameter to change default ones. Choose 'add parameter' from the menu button of the texture. Type 'square_size' in the entry box and confirm. Now a new parameter appears on the bottom of the texture frame. Use this new parameter name in the parameters scale_u and scale_v after you switch these to entry widgets. Type 'square_size' in both parameters. Switch the square_size parameter itself to a scale widget. When you slide the square_size parameter, the values for scale_u and scale_v will both get the same values from square_size.
At this point, we can still change the basic way this map looks. Find '2d_value_brick' in the list. Click on it once to see a preview of it. Now, while you can see the preview of the bricks, click the socket symbol of the value_map parameter. This is a shortcut to select a map and plug it into a parameter. You don't need it to be in your working area to plug it in.

When it is plugged in, you see that this map has some parameters to control it. To make sure that you can see the results clearly, set scale_u to 1 and slide the brick_width and brick_blur parameters to see their effects.

____________________________________________________________________________________

Tutorial 3: map type conversion

A brick value map is very nice, but most bricks are colored. These can be, too.

Rebuild the combination of 2d_value_brick and 2d_value_transform_map as described in Tutorial #2, but do not plug it into a diffuse texture yet.

Double-click color_from_value in the maps list. As the name implies, it is used to create a color map from a value map.

Now, select the plug from the corner of the 2d_value_transform_map and plug it into the value_map parameter of the color_from_value map.

Then, plug it into the 'diffuse_color' parameter of a diffuse texture. At this point, it still looks like a value map. If, however, you slide the RGB sliders from color_A and color_B, you will see the difference. Now, it is in color. Notice also, that you can still slide the sliders from 2d_value_transform_map, and from 2d_value_brick itself. You have many parameters to edit now to customize this brick texture.

Apply the brick texture to the tag of an object from the general menu and render it.

____________________________________________________________________________________

Tutorial 4: using a map as a parameter in another map

We're going to make a pattern that looks like woven fabric.

The steps for this are very simple: we start with a checker map. We then take the squares that are white, and make them into horizontal stripes. We make the black squares vertical stripes, and the result looks like fabric.

Reset the TextureEditor, and select 'plane' from the files menu underneath the Preview window to preview the new map on.

Select the 2d_value_checker map.

Now we need to create the horizontal stripes. We do this with the value_stripe_map. Select it by double-clicking it and plug 2d_value_v into the stripe_map parameter.

Change the stripe number for example to 6.

Bring in another value_stripe_map and plug 2d_value_u into it to make vertical stripes.

To combine all of these parts together you need a function that computes "if the checker value is less than 0.5, make the stripes vertical; otherwise, make them horizontal". We do that with a value_condition. Select it from the maps menu and put it in the working area.

Now, you see four parameters: value_map is for the map to be evaluated. threshold is the separating value. value_map1 and value_map2 are the lower and upper maps to substitute. By default, these maps are just the values zero and one.

Plug 2d_value_checker into the value_map parameter of value_condition. Plug the stripe map from 2d_value_u into value_map1, and plug the stripe map from 2d_value_v into value_map2. Now plug the entire map into a diffuse texture and slide the two strip_num sliders.

You can tie the two strip_num sliders together, so that the number of stripes in each direction remains the same when you change one slider. We already did this before, with the transform_map in Tutorial #2. Click on the arrow next to stripe_num1 and turn it into a value. Type 'stripe_num' into that number field, and you will have linked them together. When you slide the stripe_num slider, both values will change.

Now, you probably want the ability to scale this texture down. You learned this in Tutorial #2 as well, but let us just do it one more time. Select 2d_value_transform_map from the list and put it in the working area. Now, plug the value_condition map into the value_map parameter of this 2d_value_transform_map. Link scale_v to scale_u so that it remains square; this also reduces the number of parameters that you need to adjust.

Before you save this texture, you will probably want to make it look a little nicer. You can get rid of the parameters that are not adjustable by collapsing them. To the far left of each parameter, you'll see an empty box. If you click in the box, you select that parameter to collapse. Go ahead and set the following parameters to collapse: scale_v, value_map, value_map3, threshold, value_map1, value_map2, stripe_map, stripe_num1, stripe_map1. None of these parameters have any values that you really need to change.

There are two symbols in the upper right hand corner of the texture. The square one on the left is used to expand a collapsed texture, and the other one is used to collapse a texture. Select the collapse symbol, and watch your new texture collapse.

You will notice that the scale_u parameter name doesn't make much sense without a corresponding scale_v visible. You can rename it to 'scale' by selecting rename from the scale_u parameter menu. You find this menu by clicking in the parameter name.

Now, you've got a map that you can actually use for future projects and adjust when you need. You can save it by selecting 'save as' from the menu for this map. Give it whatever name you like, and look at the list of saved maps when you are finished. It should be right there for you.

____________________________________________________________________________________

Tutorial 5: using the same map more than once in a texture

In this tutorial, we'll use start with a value map. We'll then convert that one map into a bump map and a color map simultaneously, and use these together in a final texture.

Start by setting your preview object to a 'plane'.

Since we need to link two unrelated map types together, we will need to lay a groundwork for a combined texture. We will make a texture that contains both a bump texture and a diffuse texture.

Select the 'textures' menu, and double-click the bump texture. Now, click once in diffuse, and connect it to the bump map using the triangular socket in the upper left corner of the bump texture.

Now, we need to make a parameter that will hold the value map to convert. Select 'add parameter' from the menu of the texture. Name it 'map'.

For the value_map that 'map' will represent, select 2d_value_brick, and plug it into the map parameter.

To convert a 2d value map into a bump map, you need 2d_bump_from_height. Select it, and plug into the bump_map parameter. It has a height_map parameter, which you want to be your brick value map. Click in the height_map parameter and type 'map' You will then see a 3d representation of your bricks.

Now, you need to add color to them. Select color_from_value from the maps list and plug it into diffuse_color. For the new value_map parameter, type 'map' At this point, your map still looks black and white until you slide the RGB sliders in color_A and color_B. Make the bricks red, and the mortar white with the sliders. (For red, R=1, G=0, B=0. For white, all three equal one.)

To take a look at the effect that this gives, select 'light' from under the preview window, and move the light around. You'll see the texture responding as if this surface was actually 3d.

This map still doesn't look quite right - it is too even. Like this it is useful only when it is scaled down very small. To correct the evenness, we can add chaos. Select 2d_value_add_chaos from the list, and bring it onto your working area. Select 2d_value_brick from the list, and plug it into the value_map parameter of add_chaos. Make this map active. (Shift-click in the bar.) You will see a value map that is not very regular.

Slide the chaos slider and take a look at the effect that it gives you. (0.02 is a good value.)

To replace the original brick map, just plug this map into the map parameter using the round plug in its corner. This actually replaces the old 'brick map' with the new 'brick and chaos' map.

At this point you probably want to scale down your map. In the previous tutorials we used 2d_value_transform_map to do that. This time, it is not necessary to call up another 2d_value_transform_map, because there is already one in the 2d_value_add_chaos map. Click on the expand button of your texure: a whole new layer of hidden parameters is revealed, including scale parameters.

You might notice that the preview and interface updates get rather slow. You have a certain amount of control over this using the 'loop size' slider in the options menu. A lower value will increase the performance of the interface, but slow down the preview, while a high value will make the interface slower. If you apply many textures this complex to the objects in your GIG model, you should realize that this will affect the rendering times considerably. On the other hand, the texture you just made is probably one of the most complex maps that you will ever need to make.

____________________________________________________________________________________

Tutorial 6: complex transformations

So far, we've used value maps only to create images with color and bump map effects. Value maps can also be applied to other parameters to create custom effects. In this example, you'll make your own spiral transformation that you can apply to any map you like. Click once on 2d_value_concentric to see a preview.

What you see is a circular value running from zero in the center to one at the corners. In previous tutorials, we used the rotation parameter in 2d_value_transform. We are now looking for a function that will "multiply the rotation value by 2d_value_concentric to make the texture rotate more as it moves away from the center."

To make this function, first bring in 2d_value_transform_map. Plug value_multiply into the rotation parameter. (We do this so that we have control over the amount of spiral that we get.) Now, plug 2d_value_concentric into the value_A parameter. Click on the arrow on the right hand side of the value_B parameter to turn it into a slider.

Plug a 2d_value_checker map into the value_map parameter so we have something to look at. Turn the map active (e.g. by plugging it into a diffuse texture) and slide the value_B slider.

Let us clean it up, and save it so that it is ready to use later. If you plugged your map into a diffuse texture, press the undo button until you have the texture and the map as seperate frames again. Collapse the rotation and value_A parameters. Change the name value_B to spiral_amount. Save it, and remember that you can replace the checker board pattern by plugging any 2d value map you like into the value_map parameter. This makes it a very useful general map to add to your library of tools.

____________________________________________________________________________________

Tutorial 7: using images as maps

To use images (bitmaps) in your textures, you must first use the GIG Converter to create a GIG map from the original image. This map can then be used as any other map in the TextureEditor.

Exit the TextureEditor and go to the GIG Converter. Select an appropriate file format in the left hand column (e.g. tiff) and select your favorite image file. In the destination file options, select the GIG map button. Press the convert button; this will create a GIG map file in the correct directory. Return to the TextureEditor tool.

Select 'images' in the leftmost menu of the TextureEditor. Your image should appear in the 'saved maps' list, where is value, color, bump, or matte. That is all there is to it. You use it in the same way as any other basic map.

For example, to apply your image to all sides of a cube, select 'cube' from the files menu. Put a diffuse texture in the working area. Select your image from the images menu. Be sure that, in this case, you select 'image as color map'. Plug the color map into the diffuse_color parameter of the diffuse texture.

____________________________________________________________________________________

Tutorial 8: cylindrical projection of 2d images

One of the major complexities of 3d graphics is the handling of a 2d map projection onto 3d objects. The TextureEditor interface will make it easy for you. This tutorial consists of four separate procedures in increasing complexity.

First, let us make a bottle, and make a preview object from it. (If you are not yet familiar enough with GIG to quickly go through the next paragraph, then you can cheat by selecting a cylinder from the files menu underneath the Preview window.)

Go into the main GIG interface and select 'ff rotation' in the 'solid construct' menu to create the shape of a bottle. Select 'ff edit' in the main menu and select 'insert'. The freeform controlpoints will be shown. Add 4 more control points. Select 'ff trans' in the main menu and select 'move' to move the controlpoints. Shape the model into a bottle. In order to know how it will appear in the preview, change the page size to a square shape (The same number of pixels horizontally and vertically.) Go to 'transform' in the main menu and select 'size' to size the model until it basically fills the camera 2 window. When you can see the surface from the angle that you like, select render texted from the render options menu. Give it the name 'bottle.' Go back into the TextureEditor when you are done.

Now, select 'bottle' from the files menu underneath the Preview window. Your bottle will show up in the Preview window. You might want to change the position of the light source, to illuminate the side of the bottle.

If you pull up a color image, and shift-click on its label to set it active, you can see why you need to do a projection: the image is stretched out in some places, and shrunken in others. This is caused by the way that the uv parameters run across the surface of your bottle. Because of this effect, we need to project the image in a more constant fashion. For that we use a projection map.

Load in 3d_color_project_cylinder, and plug your image into the color_map parameter.

In most cases, you'll want to transform your map when you bring it in. Put a 2d_color_transform_map in your working area, load your color image from the 'images' menu, and plug it into the color_map parameter of 2d_color_transform_map. Replace the image in the 3d_color_project_cylinder with the transformed image.

One other thing that is common to do, is to bring in an image with a mask. A mask prevents multiple copies from appearing when you scale the image down. Load 2d_color_transform_map. Plug color_multiply_by_value into the color_map parameter. Plug your image into the color_map1 parameter, and plug 2d_value_mask into the value_map parameter. (If you do not move any of the mask sliders, this will mask out the area outside of your primary image, preventing repetition.) Now, plug the entire transformed and masked map into 3d_color_project_cylinder. Slide the place, rotation and scale sliders to get your image in the desired position. The area outside of the first copy of your image map will be black.

You can change the background color with just a little more work. First, you need to understand the output from the 2d_value_mask map. It creates a value square where the inside of the square is 1, and the outside of the square is 0. The square is, by default, from zero to one in both the u and v axes. In this example, we will use the mask parameter to define the edge between our image and the background.

Load in 2d_color_transform_map. Plug color_add into the color_map parameter. You do this because you need to add two maps together: the image map and the background map. Plug color_multiply_by_value into color_A, and another one in color_B. You should now have two pairs of color and value maps. Plug 2d_value_mask into the first value map. Type '1-value_map' into the second value map. Now, when the first value map is zero, the second will be one, and vice versa. This means that what is outside the mask is background, while the image is inside the mask. Plug your image map into the first color map (the color_map2 parameter). Click the arrow to the right of the second color map to turn it to sliders. (You could also plug in another map.) Now you have a separate image map and a background parameter for your cylindrical projection.

____________________________________________________________________________________

Tutorial 9: labels on bottles

The previous tutorial described how you can project an image on a cylindric object by combining several maps. For your convenience, default materials are provided that have the same effect but require less knowledge of the TextureEditor. In this tutorial we will stick a label onto a bottle.

Use the bottle that was made in tutorial 8 (or use a default cylinder, but that does not illustrate the subtleties of uv mappings as well as a more irregular shape like a bottle).

First, choose the 'labels' sheet from the materials menus. The 'labels' sheet consists of different rows and colums. The eight rows each represent a different type of projection. (Actually there are seven different types because the cylinder and the bottle are both cylindrical projections).

The projection types, from left to right are: For each of these projection types there are six different rows of materials.

The upper three rows have no alpha matte options; the lower three are for alpha matte calculated images.

The labels with alpha matte options have a threshold slider that controls the lowest value that will be turned to transparent. You need a black background to use the alpha options.
The matte_blur option is used to create a "feathered edge" if the image has antialiasing artifacts, and if a crisp edge is not desired. In order to work with the matte_blur option, you need to scale up the map so far that you can see the antialiasing that you wish to fix. (Usually, go all the way to scale_u = 10, scale_v = 10, and move the place_u and place_v to find an edge.) Then slide the threshold slider to position a hard edge at the middle value of the antialiased edge in the image. (Grey if it goes from black to white...) Then, expand the texture by one level to find the matte_blur slider, and move it until you can see the antialiased edge blur into the background.

For both the materials with and without alpha matte, there are three different rows:

Click on the bottle icon on the bottom row. A glass texture is selected which has several parameters. The first three of the glass attributes can be altered. Type (0.9, 0.95, 0.9) in the 'glass_color' parameter to give the glass a greenish color. Plug any color map from the 'images' menu in the 'label_map' parameter. You can slide the transform parameters to position and size the label itself and you can slide the threshold parameter to increase or decrease the amount of background of the label itself.

When you select from the 'textures' menu the bump texture and add that to the glass with label texture the glass will get a bumpy look. Take into account that the render complexity will increase.

____________________________________________________________________________________

Tutorial 10: labels on bottles with other materials

The previous tutorial described how to put a label on a glass object. This is a predefined material. When you select labels from the first and fourth row, the background of the object is a diffuse. You can change the color_parameter of the object, or plug any color map into that parameter.

Because the labels from the material sheets are textures and not maps you can not plug them into existing materials like wood.

You can however combine these two textures. You need to 'mask out' the place where the map is for the wood texture, and to 'mask out' the background for the label texture.

Use the bottle that is made in tutorial 8.

Select a wood, metal or whatever material from the 'materials' menu. Select labels and select the top row bottle label icon. Expand each texture so that the diffuse_value parameters of both textures are visible. Expand the label texture a second or third time until the 'mask ' parameter of the label texture becomes visible. Connect both materials, by selecting the connect plug symbol of the first texture and the connect socket symbol of the second texture. Now both materials are together visible in the Preview Window. The image looks over-exposed.

Because the bottle is a 3d_cylindrical projection, we need to put the mask onto the diffuse of the label texture. Select 3d_value_projection from the 'maps' menu. type 'mask' in the 'cyl_value_map' parameter. Now the mask is also put on the diffuse of the label, at the same place as the image of the label.

Type the name of this parameter (possibly diffuse_value1) and type the inverse in the diffuse of the material texture, that is, '1-diffuse_value1' in diffuse_value parameter.

Collapse the texture until there are no collapsable parameters anymore. Now you have your material bottle with a label put onto it, with your parameters to change both the material and the label.

Related topics