Blender mini how-to collection

Belgabor

Revision History
Revision 122.11.2006

Initial version, Creating icons for RCT3 custom scenery

Revision 223.01.2007

Unwelding in Blender

Revision 319.06.2007

Fixing typos

Revision 404.09.2007

Copyright


Table of Contents

1. Creating icons for RCT3 custom scenery
1.1. Setting up the camera
1.2. Configure render settings
1.3. Putting your object in scene
1.4. Let there be light
1.5. Let there be shadow
1.6. Final render
2. Unwelding in Blender, the easy way
2.1. Preparation
2.2. The EdgeSplit modifier
2.3. Customization per edge
2.4. Exporting
3. Credits

Coypright (C) 2007 Belgabor, some rights reserved (see below).

This is a unsorted collection of several short Blender tutorials that show you how to achieve certain goals. They are targeted at users with some Blender experience, so this is neither a general basic Blender tutorial, nor a Blender tutorial for creating RCT3 custom scenery. For those you can find links on my software page.

1. Creating icons for RCT3 custom scenery

Required Blender version: 2.42a

This tutorial will explain an easy way to create icons for RCT3 custom scenery objects in Blender. I assume that you know how to work in Blender and have your finished object ready.

Before we start, make sure to have at least two 3D views. Figure 1, “My preferred Blender UI setup” shows my favourite UI setup. You don't have to copy it, the only important part are the two 3D views.

Figure 1. My preferred Blender UI setup

My preferred Blender UI setup

Important

If not mentioned otherwise, all following steps are to be done in object mode and all key combinations have to be pressed in the 3D view you work in.

1.1. Setting up the camera

As we will use the internal render function of Blender, we first need to setup a camera in a convenient way. To achieve this convenience, we will make use of a so-called track-to constraint that will keep the camera pointed at an other object. In this case we will use an Empty.

  1. I assume you still have the default camera. If not, create a Camera and move it away from the origin. If you don't have the default light, add a Lamp and move it somewhere a bit away from the camera.

  2. Switch your secondary 3D view to camera view. To do this, focus the view and press 0 (Zero) on your numpad.

  3. Back in the main 3D view, create an Empty.

  4. Now select the camera and then add the empty you just created to the selection (Shift-Right Click).

    Important

    The order matters here! Make sure to first select the camera and then add the empty. Otherwise you'll get an empty that points at the camera, which is not really useful.

  5. Press Ctrl-T and select TrackTo Constraint. You should now see that the camera points at the empty.

Tip

Have a look at the Blender Tricks - Episode 1 and Super Time-Saving Tricks video tutorials. The first one shows you a few nice things about controlling the camera. More Blender tricks can be found on this page of the Noob to Pro Tutorial.

If you did everything correctly, your scene should look similar to Figure 1, “My preferred Blender UI setup”.

1.2. Configure render settings

Now you need to configure the render settings.

  1. Hit F10 to go to the render panel.

  2. Go to the Output pane and set the render output display to Image Editor. That's the selection list below the Save Buffers button. This will cause Blender to render to the image editor instead of the default separate window. The image editor will replace your current 3D view, just hit Esc to get back. The advantage of this approach is that it's easier to save the final render.

  3. Go to the Render pane. Make sure the renderer is set to Blender Internal (below the big Render button). A lot of the things described below will not work in YafRay.

  4. Make sure the Shadow, Ray and Radi buttons are activated and EnvMap and Pano are deactivated.

  5. If it isn't already, activate the OSA button.

  6. Select the Sky button. Make sure none of the buttons in the lower right corner (Fields...) is activated.

  7. Go to the Format pane. Set SizeX and SizeY to the same value. I recommend using 200 at this time as it is a good compromise between a useful preview and an acceptable rendering time.

    Note

    Remember this point. We will need to change these values to 64 for the final render.

    You can use any size, just make sure SizeX and SizeY are the same, otherwise your camera viewport will most likely turn out to be not what you wanted.

  8. Set the output image format to PNG (left of the Crop button) and activate the RGBA button. Blender will now save our finished rendered icon in png format with alpha channel.

  9. We now need to change the horizon color. Press F5 to get to the material panel and select the World buttons subpanel (last button in the second group, the one with the small earth on it).

  10. On the World pane, click on the horizon colour selector (above the three Ho* sliders). Set Hex to EFE8EF and close the selector by moving the mouse pointer away. This sets the background color for the render to the dark RCT3 menu background so anti-aliasing doesn't cause ugly halos.

1.3. Putting your object in scene

Now it's time to add your object to the scene.

  1. Fetch your object. Either via FileAppend/Link (Blender object) or FileImport (other object).

    Note

    I thought the Append/Link function was explained in the basic Blender tutorials, but I was told differently, so here is a brief explanation:

    The Append/Link function treats a blend file like a directory structure where the “files” are the objects, materials and so on contained within, so you in fact you don't append the whole file, you only import the object/material/whatever you choose. If you experiment a bit, I'm sure you'll get the concept soon and realize how cool and easy it is =)

    Obviously you can append from different blend files. In fact the name may be a bit misleading, rather think “import out of” or “load out of”.

    If you want to append several objects from the same file, select them with the right mouse button.

  2. Now move around the camera and the empty in your work 3D view until the camera view shows a satisfactory result. There are three things you should keep in mind at this point.

    • You shouldn't change the position of the camera and empty for the other objects in your set. I recommend setting them up for an object that is approximately one RCT3 square big (4u x 4u). Larger objects should be resized to fit the camera view. If you have objects positioned for different size flags you should rather reposition them for the icon shoot that changing the camera/empty setup.

      It may be a good idea to import a few other objects from your set to verify the camera setup is also appropriate for them. You can hide them by moving them to a different layer with the M-key.

    • The part of the camera view that is actually rendered is formed by the middle one of the three frames you see (the outer slashed one).

  3. Now press F12 for a first preview render. If you haven't done this before it is very likely that your texture seems to be missing. If that is the case, follow these steps:

    • Select your object.

    • Make sure your object has a material assigned. Press F5 to get to the material panel. If the only panes you see are Preview and Link and Materials your object doesn't have a material, so add one by pressing Add New in the Link and Materials pane.

    How to proceed depends on whether your object will have an alpha texture or not. But before you continue, focus the camera 3D view and press Shift-P to get a small render preview overlay window.

    If your object doesn't use alpha transparency, it is very easy to enable the mapped texture for rendering:

    • If you haven't in the last step, press F5 to get to the material panel. Go to the Material pane and activate the TexFace button.

    • Now press F12 again. The render preview should now show your texture.

    If your object does use alpha transparency, a few steps more are necessary.

    Tip

    Before continuing you might want to go through (at least) the first two sections of the Materials and Textures chapter of the Noob to Pro Tutorial to understand what you will be doing.

    • Press F6 to go to the texture panel.

    • Go to the Texture pane. The texture channel list should be empty, if not, delete all channels. Select the first, empty channel and press Add New.

    • Select Image from the Texture Type list. This should open two new panes.

    • Switch to the Image pane and select your texture bitmap. If you uv-mapped the one you want to use, you can press the button with the up and down arrows above the Load Image button to select it. If you used a different bitmap to uv-map (e.g. the alpha texture or a texture with different colours), press the Load Image button and select the one you want to use for rendering the icon.

    • Go back to the Texture pane, select the next free texture channel and press the Add New button again. Like before, select Image from the Texture Type list.

    • Switch to the Image pane and select your alpha texture bitmap. This works like before, only select the bitmap you will use/have used as alpha texture in the Importer. Before going on, select the CalcAlph button.

    • Now we need to switch back to the material panel, so press F5.

    • In the Link and Materials pane turn on the ZTransp button. This makes Blender use the alpha transparency to make the object actually transparent in the 3D world. If you don't activate this, you will be able to see completely through to the background, similar to the infamous x-ray effect in RCT3.

    • The material panel has a Texture pane an well. Switch to it and select the first channel (the one you assigned the texture bitmap to).

    • Switch to the Map Input pane and select UV.

    • Go back to the Texture pane and select the second channel (the one you assigned the alpha texture bitmap to).

    • As above, switch to the Map Input pane and select UV.

    • Now switch to the Map To pane and turn the Alpha button on and all other buttons in that group off.

      Important

      Some of those buttons are tri-state buttons, so make sure they are in the off state. The Alpha button is also a tri-state button, make sure it is in the first activated state (white label), otherwise the alpha will be applied inversely.

    • Set the Texture blending mode to Darken. This is the selection box right of the No RGB button.

    • Finally press F12 again. The render preview should now show your texture with alpha transparency.

When you're finished you probably noticed that your object is quite dark.

1.4. Let there be light

I cannot give you a definite procedure on how to set up lighting, it's mostly a trial-and-error procedure, but I will give you a couple of tips to help you.

  • One lamp is not enough to give you a satisfactory result. You should have at least two or three.

  • A good getting started setup is one lamp next to your camera and one in the same distance to the object but rotated ±90° around the z-axis. Plus or minus depends on your setup. The light should still shine on the side of the object facing the camera.

  • If you need to adjust the brightness of the lamps either move them closer of farer or play with the Energy value on the Lamp pane of the lamp panel (hit F5 when you've selected a lamp).

  • Normal Lamps should be enough, but feel free to experiment with the other lamp types Blender provides.

  • If you think your object looks like plastic, this is usually caused by speculars (bright spots where the lamp hits the object). To get rid of them select the object, hit F5 and select the Shaders pane. Set the Spec slider to 0.

1.5. Let there be shadow

If you do not want to have your object cast a shadow on the “floor”, you can skip this section.

  1. First we need a floor to receive the shadow. Hit 7 on the numpad to get to the top view. Now add a MeshPlane and resize it make it large enough for the shadow. Tab out of edit mode.

  2. Having the plane selected, hit F5 to get the material panel and add a new material.

  3. Go to the Shaders pane and activate the OnlySha button. This will cause Blender to render only the shadow cast on the plane, but not the plane itself. If your object uses alpha transparency you also need to activate the TraShad button, otherwise Blender will not use the alpha information for casting shadows.

  4. Now press F12 to preview the result.

  5. You now probably should review your lamp setup. Here are a few hints to help you. All changes have to be made in the lamp settings (press F5 with a lamp selected).

    • You can change the lamp type with the buttons in the Preview pane.

    • The Ray Shado button on the Shadow and Spot pane allows you to select whether the lamp casts a shadow (activated) or not (deactivated).

    • If you activate the OnlyShado button on this pane, the light will only cast a shadow and not light objects. You might get the best result using non-shadow-casting lamps to light your object and a non-lighting lamp to create the shadow.

    • In most cases you may want to get a more fuzzy shadow than a normal Lamp casts. In this case you have to use an Area Lamp (remember you can change the lamp type on the Preview panel).

      Note

      Area lamps are directional, so you have to point them at your object. Fortunately you can set up a track-to constraint for it like for a camera (see Section 1.1, “Setting up the camera”), you can even use the same empty for it.

      Area lamps tend to be too bright for lighting, so the best option is to use them without lighting, only to cast shadows (see previous point).

      To make the area light cast fuzzy shadows we need to increase the Samples on the Shadow and Spot pane. Four is a good number. Also activate the Umbra, Dither and Noise button. For the amount of fuzziness play with the distance of the light from the object and the Size setting on the Lamp pane.

1.6. Final render

Time to finish it.

  1. Set the render size to 64x64 (see Section 1.2, “Configure render settings”).

  2. Press F12 to render the icon.

  3. Save your icon with ImageSave As...

  4. Repeat for all objects of your set.

  5. Assemble your icon texture with the bitmap editor of your choice.

2. Unwelding in Blender, the easy way

Required Blender version: 2.43rc1

I've noticed a lot of people have problems to create CS objects with a proper welding state. Some simple objects look fine either fully welded or unwelded, but in most cases you'll need to mix welded and unwelded vertices.

The default state for vertices when you create objects in Blender is welded. This maks a lot of sense as otherwise your object wil fall apart when you start to edit it. Objects should always be edited in a fully welded state. The beauty of the method that will be detaild here is that it always keeps your object welded for editing. Don't worry if that confuses you right now, you'll know by the end of this tutorial.

At his stage, please read the section on welding/unwelding of my facts & figures page if you haven't already done so. The most important paragraph is the first one, so make sure you understand it.

Now you should have learned that the only thing that can be unwelded are vertices. As a manner of speech I will often use the term “unwelding/welding an edge”. This term, while technically inexact, much better describes the visual effect of unwelding. It also forms the basis of the method described in this tutorial which is edge based.

To be sure you understand this essential term, I'll explain it in detail. An edge is defined by the two vertices at its ends. The edge itself usually defines the border of at least one face. This tutorial will only deal with the usual case, an edge defines the common border of two faces. One face is trivial, it's always unwelded. If an edge borders three or more faces, things get tricky and always involve manual welding/unwelding (not covered by the easy method).

Now back to the common case that the edge makes up the border of two faces. If such an edge is called unwelded, it means that the faces it borders get their own copy of the vertices that define it. Technically that means the edge, like the vertices, is split into two, one for each face.

Keep in mind that it may be impossible to unweld an isolated edge in a mesh of connected faces. To understand why, let's create a simple example. Imagine one of the vertices of the edge belongs to three faces. If you now try to unweld th edge, which of the two copies of the vertex should the third face share? By the definition I gave you above, it should share both which is impossible, therefore only unwelding this edge is impossible, an additional edge of the vertex needs to be unwelded. Therefore always keep in mind that it is vertices you actually unweld, not edges.

To show you the process, I'll try to properly weld/unweld an example object which finally should look like this:

The model was created by merging a cube with half of a cylinder with 8 sections (so 4 remain). All invisible faces have been removed and all vertices welded (w, Remove Doubles). Here is a wireframe view:

2.1. Preparation

Before continuing we need to prepare the object and the view so we can achive the desired looks within Blender. I assume that you have created or imported the object at this stage.

  1. Switch the display mode of your 3D view to Solid ().

    My freshly created example object looks like this:

  2. Make sure your object is completely welded. Go into Edit Mode, select all, press w and select Remove Doubles.

  3. Make sure you can discern shades on your object like in the screenshot above. If it seems too dark, check if it has a dark material assigned (this can happen when you import it). Go to Object Mode, select your object, press F9 to get the Editing Panels () and have a look at the Link and Materials panel:

    If the material button indicates materials on the object (eg. 1 Mat 1), delete them by pressing Delete until it says 0 Mat 0 as in the image. The object now should have the default gray colour as in the screenshot above.

  4. Finally we need to make the object look as welded as it currently is. Go to Object Mode, select your object, press F9 to get the Editing Panels () and press the Set Smooth button on the Link and Materials panel. Your object should now look fully welded like my example object:

Now you'll see how lighting will be applied to your object's faces in game.

2.2. The EdgeSplit modifier

Now to the core of the magic :-)

Before explaining how to add it, let me explain first what a modifier in Blender is. A modifier modifies an object for rendering, but does not change the actual data. That means you can still edit your object unmodified, very handy for our topic. Modifiers can also be applied, which means the object's data will be changed according to the modifier and the modifier itself removed. Usually this is not necessary for the EdgeSplit modifier.

So let's get to work and add an EdgeSplit modifier. Go to Object Mode, select your object, press F9 to get the Editing Panels () and go to the Modifiers panel. Press the Add Modifier button and select EdgeSplit.

Now orbit around your object and have a look. If you are lucky it is already properly welded/unwelded. As the default settings for the EdgeSplit modifier are pretty sensible, it's not unlikely that you're lucky ;-)

As you can see in the following screenshot, surprise surprise, I was not lucky for the example object:

I've changed the view angle a bit so you can see it better. The edge between the cube and round part is welded as intended, but the rest is completely unwelded. To improve that, we need to understand the settings of the EdgeSplit modifier.

Taking a look at the Modifiers panel you'll see that the EdgeSplit modifier has two toggle buttons, From Edge Angle and From Marked As Sharp, and one value, Split Angle. The two toggle buttons activate/deactivate the two decision modes of the EdgeSplit modifier, by default both are activated and in almost all cases you can leave that as it is.

The EdgeSplit modifier acts like Blender, it starts by keeping everything welded. If the From Edge Angle mode is selected, it will unweld all edges where the faces form a more acute angle than given by the Split Angle value. If you didn't get your desired result, changing the Split Angle is your first step to get to the correct apperance.

Here is how the example object looks like after increasing the Split Angle:

Better, but not perfect as the frontal edge is also welded. I cannot find a Split Angle value that will give me the desired result as the angle at the frontal edge is the same as those of the next vertical edges, which I want welded.

2.3. Customization per edge

That is where the From Marked As Sharp mode comes into play. As the name implies, Blender allows you to mark edges as sharp. Those will be always unwelded by the EdgeSplit modifier if the From Marked As Sharp mode is active. You cannot mark edges as smooth, therefore you need to set the Split Angle to “overweld” your object (or deactivate the From Edge Angle mode alltogether) as I did for the example object.

First, select your object and go to Edit Mode.

Before we start to mark edges, we need to make sure Blender will draw these marks. Press F9 to get the Editing Panels () and go to the Mesh Tools 1 panel:

Make sure the Draw Sharp toggle button is activated as shown in the screenshot.

Now select the edge(s) you want to mark as sharp. Then press Ctrl-e and select Mark Sharp. I've done this for the example object:

And finally it looks like indended:

2.4. Exporting

There is one very last thing to keep in mind. When using the ASE export script from my software page you need to activate the Apply Modifiers button in the export settings. As it says, it will apply all modifiers during the export process which is necessary to get the desired result. If exporting to other formats, activating a similar option may be necessary.

3. Credits