AgeTexture

From Alcugs

Jump to: navigation, search

Note: Anything extracted from any Plasma Resource Files is property of Cyan Worlds, Inc. You may not use these assets without recieving written permission from Cyan Worlds, Inc.

Please read this Notice from Cyan about Age Creation before continuing.

Previous: Kickable Obejcts Contents Next: Lighting

Contents

Texturing Your Age

UV Mapping

Actually doing the mapping

If you look at the UV/Image Editor window, you will now probably see one square or triangle (maybe two triangles) stretched to 3 or 4 edges of your texture.
This means that each and every face of your object has that part of the texture on it, and it is probably not what you want!

To fix this, we go (still in UV Edit mode) to the 3d window and press [U-Key]
You will now see a list of "Mapping" options come up.
By using these mappings, the location of the faces (and their vertices), will determine what part of the texture they use.
This is just a tool to set up a starting situation. You can change the UV map manually afterwards

Note: The view you have of the object, (in the window in which you pressed [U-key])
will influence the mapping in most cases

Some mappings you will likely use:

  • Sphere Mapping
    Fold out the objects faces, like it was a sphere. Useful for some hollow objects. Your view determines the "Cut"
  • From Window
    Map the faces, jut as you see it now. Very practical if you just want to map a flat surface onto it. Also if you want to map an image of a real-world object onto a model of it, it makes an excellent starting point
  • LSCM
    LSCM stands for for Least Squares Conforming Map. It is very useful because it attempts to preserve the shape of each face.
  • Bounds 1/1
    Like "From Window", but scales the mapping to cover as much of the texture as possible.

Editing the mapping

You edit the UV coordinates of the selected faces in the UV/Image editor. Of all selected faces, there are representations of their vertices in the image editor.

In the image editor, you can select the corners, and subsequently grab [G-key], scale [S-key] etc them like you do in a 3d environment.

Note: To select a single vertex in adjoining faces, you'll probably want to use the selecting
tools under the [B-key]

Using Alpha Textures

For alpha textures, please use PNG files, most other files are not read correctly.

Links

For a detailed UV mapping example, see Editing_UV_Texturing_Tutorial
Also, you should definitely read this article from the Blender Noop to Pro Wikibook: UV Map Basics
Pay specific attention to the Seams!

Texturing the object

For this section of the tutorial, I will assume that you already have a fairly sufficient knowledge of Blender, Blender materials and textures, and blending modes.

If you don't have this experience, please read the Blender Noob to Pro guide.

Multiple Layers

To use multiple layers on your material, you can now add extra blender layers to your Material, like this:
Image:MaterialAndLayers.png
You can change the name of your texture here. It is recommended to change the name into something meaningful.
Also set the nameof your texture to something meaningful!

In the Texture Panel, you can select the type of layer ("Texture Type") the layers are:
Image:TexLayertype.png

Permitted layer types are:

  • Image
    This is used to add an extra image layer. Be sure to actually select an image to load
  • EnvMap
    This is used to read and process a Cubic Environment map. Unfortunately the plugin only has access to the data, if it's loaded from a file. So, you need to render it first, save it, and select that file, before exporting.
  • Blend
    Used to add that mysterious "AlphaBlend" layer/texture. You must have linear blendtype for it to work, and you can use the Rot90 button to switch between horizontal and vertical alphablend layer
  • None
    Not very useful, justs adds an empty blender layer. Can be useful to set certain layer settings to a material that you couldn't set otherwise.
Warning: Once you have material texture layers set, the plugin will ignore your UV Texture.
It will still use the UV coordinates, but it will not link the texture to your material/object.

Texture Options

The texture panel has several options for images.
In the image below, this is on the right:
Image:TexPanel.png

The buttons we can use are these:

  • MipMap - Set this button to make mipmaps. Unset it to not make mipmaps
  • UseAlpha - This is not used by the plugin, but press it if you have an alpha texture, to better see what your combined texture will look like

Mapping Layers

The material panel has three tabs for textures. One of these you have seen above, and is used to add texture layers and change their names.
The other tabs are Map Input and Map To , and have various settings that are read and processed by the plugin:

Map Input

This panel looks like this:
Image:MapInput.png

Of this panel, you an use ofsX and ofsY, as well as sizeX' and sizeY

By using sizeX' and sizeY, you can scale the layer, with respect to the uv mapping.
The larger the size value, the smaller the layer becomes in comparison to the uv map.
Plasma tiles images that are small in comparison to the uvmap, although the blender preview does not!

You can change the offset of the (scaled) layer by using ofsX and ofsY

If, for example, you want to have one large layer depicting a landscape, and want to add detailed ground (with alpha) to that, you can make the sizeX and sizeY values of your detail map quite high, and you will have a fine detail map.
This is what is used in the Cleft Desert for example.

Map To

This panel looks like this:
Image:MapTo.png

Usable settings:

  • Blending Mode
    You can select a blend type here! Only Mix, Multiply and Add are supported!
    If you select Multiply or Add, the alpha values are not taken into account in Plasma, so you should adjust your texture files to compensate.
  • Neg
    Negates the texture if this is selected
  • Col
    This sets the alpha value of the Plasma Layer. You can set this per layer.

Coloring your Material

Note: To make good use of the preview window (and of the shade mode) in blender while coloring your
objects, you have to set the ambient color of the world. This is done by pressing the world button
when you are in Material edit mode.
Then set AmbR,AmbG and AmbB to values of around 0.5 (you might have to tweak it a little to feel comfortable.)

Coloring your material is done in the color section of the material tab:
Image:MaterialColors.png

Usable settings:

  • Col
    Sets the Diffuse color of the material
    The value of this color also has effect on the brightness (and probably color) of your texture layers. Set it to white if you want full texture colors
  • Spe
    Sets the Specular color of the material
    Note that specular does not seem to have effect in Plasm right now
  • A
    Sets the alpha value for both the Diffuse and Specular Color
  • Amb
    The Diffuse Color is multiplied by this value, to provide the Ambient color. The Ambient color is the color of your object when it is not lighted by any light source.
Note: The texture is affected by the ambient color on places where it is not lit.
You can use this slider to determine how much your textured object is affected by light.
Set this to 1.0 if your object is not lit.
  • Emit
    The Emission Color of your uru material is made by multiplying the Diffuse Color by this Slider. Change this sliders value to affect the intensity of the Emission

Making Cubic Environment Maps

Environment maps are used to give the illusion that objects are reflective.
To do this, a set of 6 images is taken into all 6 directions from a specific point, and mapped onto the inner sides of a cube.
The object that has this "Cubic Environment Map" now acts as a kind of "view port" into this environment map, giving the illusion that it's actually a reflection, since the view of the environment map changes with the camera angle.

If you do not yet know how to make blender make a cubic environment map, I refer you to these articles:

General info about Environment maps: Reflection Mapping
Making them in Blender:Environment Maps in Blender

Using Blender Environment maps in Plasma

To have blenders environment data available to the plugin, we must do a dirty trick.
It turns out that blenders environment map data is only available to the Python API, if it has been saved and is loaded from a file.

I will assume that you have correctly set up an blender environment map texture, from the resources above.

Now, go to the texture panel and select your environment map. Click the "Static" button, to show this panel:
Image:EnvMapStatic.png
Use any of the settings in this panel to make your environment map look realistic

Now, before we can save the data, we must have rendered the environment map. Press F12 to have blender render the map.

Now, after we rendered it, press the Save Env Map button. You can now save your environment map as a JPG texture.

Note: In "Static" mode, blender will render the environment only once, until you press Free Data So it you want to update blenders EnvMap data, press that Free data button, and then press F12 again. Save your Envmap again afterwards.
(Of course you need to put your Envmap Texture back to Static to do all this)

Now we will need to make blender Load in the texture we just saved, press Load, and a screen like this will come up: Image:EnvMapLoad.png
Press Load Image, and select your image.

You're done now! PyPRP will happily export your texture as a Cubic Environment Map now.

To reload the image, for example after you re-rendered the envmap, press Reload

Making it look real

If you just put up the environment map with no tweaks, you will get a perfectly mirroring surface. That's probably not what you want, so you need to set the texture layers transparency a little lower, A value of about 0.35 to 0.50 gives often a nice result.

Also play a little with the settings in the Static panel of th EnvMap settings, before rendering it. Maybe you'll need to blur the EnvMap a bit (Filter option), or change the size of the faces. Default face size is 100x100.

Manual Environment Map Creation

If you wish to create the environment map texture manually (e.g. taking in-game pictures), you can do so. First, decide on the resolution per face, e.g. 64x64. Next, make your texture three times the face resolution wide, and two times the resolution high, e.g. 192x128. Then place each of the 6 images in your environment map texture, according to this chart:

+------+------+------+
| Left |Bottom|Right |
+------+------+------+
| Top  | Front| Back |
+------+------+------+

go to the texture panel and select your environment map. Click the "Static" button, to show this panel:
Image:EnvMapStatic.png
In the CubeRes field, specify your resolution per face, e.g. 64. Then click the "Load" button, and click Load Image. Select your manually created environment map texture. Save it, then export!

Detailed Walkthrough

Below are instructions for adding a textured object to your age.

This walkthrough tries not to make any assumptions about the user's abilities by providing as many details as possible, in order to make age creation more accessible to the public.

Adding A New Object To Texture

1. Locate your age's .blend file and double-click it to open it in Blender. Note: if you do not have an age yet, you can download a starter age here.

2. We are going to place the new object at the coordinates (0,0,0), so we will move the cursor to that location. Note: the cursor is the thing that looks like a crosshairs; it is not your mouse pointer.

  • In the 3-D View pane, click on the View menu, then choose "View Properties...". The View Properties dialog will appear:

Image:ViewPropertiesDialog.png

  • In the dialog, look for the words "3-D Cursor:", then click in the center of

the field below it that has an "X:" in it.

  • The field will then change to allow you to type in a value. Type in 0, then press Enter.
  • Click in the center of the field below it that has a "Y:" in it.
  • The field will then change to allow you to type in a value. Type in 0, then press Enter.
  • Click in the center of the field below it that has a "Z:" in it.
  • The field will then change to allow you to type in a value. Type in 0, then press Enter. Now the cursor is at (0,0,0).
  • To dismiss the View Properties dialog, click the little X in the top left corner.

3. To ensure that the new object is oriented correctly, we need to be looking straight down at the cursor from the top.

  • Make sure your keyboard's Num Lock light is on. If not, press the Num Lock key.
  • Make sure your cursor is in the 3-D view pane that shows your age.
  • Press the 7 key on your keypad, near the Num Lock key. This will change your 3-D view to a "top-down" view.
  • To center the view on your cursor, press the C key.

4. At the top of the screen, click on the "Add" menu, then click on "Mesh". This will bring up a submenu; click on "Cube". A cube that is 2 units by 2 units will appear at the cursor.

  • If you cannot see it, move your mouse pointer over the cursor and scroll the middle mouse wheel upwards until you see a grey square.

Adding a Material To Your Object

Now that you have an object, you need to set its material before texturing it.

1. Make sure you are in "Object Mode". Check the combo box that is to the right of the Mesh menu in your 3-D View pane.

  • If it does not say "Object Mode", click on the combo box and choose "Object Mode" (which is at the bottom of the pop-up menu).

2. Bring up the Material Buttons in your Buttons pane:

  • To the right of the Panels menu in the Buttons pane are a set of 6 icons:

Image:PropertyButtons.png

  • Click on the 3rd icon from the left that looks like a planet.
  • To the right of these are five more icons. Click on the 2nd icon from the left (which also looks like a planet).

3. Create a material:

  • In the Buttons pane there is an area with the heading "Links and Pipeline". Click on the button that says "Add New".
  • This area will change, and you should now see this:

Image:MaterialColors2.png

  • Under the Material tab, you'll see a grey rectangle on top of two white rectangles. Click on the grey rectangle - this is your "diffuse" color.
  • A color chooser dialog will appear:

Image:ColorDialog.png

  • Since you will be texturing this object, you'll need to set the material to white in order to see the texture clearly. So, click on the white square and then move your mouse pointer off the dialog. It will then disappear.


Adding A Texture To Your Object

Your object has a white material. Now, let's put your texture on it - but make sure it is in the same directory as your age's .blend file.

1. In your Blender's Buttons pane, locate the two sets of property buttons next to the Mesh menu:

Image:PropertyButtons.png

2. In the rightmost set of these buttons, click on the 3rd one (which looks like a spotted square). This will bring up the texture buttons.

3. In the area with the heading "Texture", click on the "Add New" button. This area will change.

4. Click on the combo box under the words "Texture Type". From the menu, choose Image (near the bottom). You will see two new areas appear.

5. In the area with the heading "Image", click on the "Load" button.

6. One of your panes will become a file browser. This will show you a list of files in the folder that contains your age's .blend file. Scroll through the list of files until you locate your texture - it should have a blue dot next to it, indicating that it is a texture file.

  • If your texture does not appear, it might be because you had placed your texture in this directory after you started Blender. To refresh Blender's list of files, click on the "..", then click on your age's directory.

7. Click on your age's file name, then click the "SELECT IMAGE" button. The Image area will change.

Setting the Texture Coordinates

Your object now has a texture, but it will not appear until you specify the texture coordinates: these indicate how the texture is spread over your object's faces.

1. In the 3-D View pane, click on the mode combo box next to the "Object" menu. Then choose "Edit Mode".

2. Select the faces where you will put the texture:

  • In the 3-D view pane, locate the select mode buttons:

Image:SelectModeButtons.png

  • Click on the triangle icon; this will activate face-selection mode.
  • To select all the faces, press the A key. You should see the outline of the cube turn yellow.
    • If not, press the A key again.

3. Change to the UV Face Select Mode

  • In the 3-D View pane, click on the mode combo box next to the Face menu. Then choose "UV Face Select"
  • Since we had already selected the faces in Edit Mode, the cube's faces should already have a dotted outline.
    • If not, press the A key to select all the faces.

4. Make a UV/Image Editor Pane:

  • If you only have two panes visible (i.e. the 3-D View pane and the Buttons pane):
    • Move the mouse pointer to the boundary between the 3-D View pane and the Buttons pane. The mouse pointer will turn into a vertical double arrow.
    • Right click on the boundary. A popup menu will appear. Click on "Split Area".
    • You will see a vertical line appear in the pane where your mouse pointer is. Move the mouse pointer to the 3-D pane, then move the vertical line to the right third of the screen, then left-click the mouse. A new 3-D pane will appear.
  • In the new 3-D pane, click on the Window Type combo box and choose UV/Image Editor. The pane will change to show a grid.

5. Put your texture in the UV/Image Editor pane:

  • Click on the combo box to the right of the "UVs" menu.
  • Select your texture from the pop-up menu.
  • Your texture will appear in the UV/Image Editor Pane, where the grid used to be.
  • Also, your texture will appear on your object in the 3-D View pane.

6. Save your age:

  • Hit Control-S on the keyboard.
  • In the "Save Over" pop-up menu that appears, click your age's blend file.

Viewing Your Textured Object In Uru

1. Export your age from Blender - click here for instructions.

2. Register your age so that you can explore it in Uru: Complete Chronicles - click here for instructions.

Your textured object should appear right at the center of your age: Image:TexturedObjectSample.png

Previous: Kickable Obejcts Contents Next: Lighting
Personal tools