Tutorial 3

How to do Decals

Adverts, Badges, Banners, Brushes, Images, Labels, Logos & Stickers
How you want 'em, where you want 'em.


What Are You on About?

Well, let's say you have a nice curvy body. No, you know what I mean! Like on a rally car or a Formula One racer, OK? And it needs some nice logos, adverts, etc., every one paid for by those nice sponsors. You've seen 'em on the telly. Marlboro, West, Bridgestone, all the big deals. And these logos and adverts have to be properly antialiased and they have to fit exactly on the spot the sponsor says they should be. So, you have to make 'em look good, right? 'Course you do, otherwise the moneymen won't be very impressed and you won't get the dosh! That's what I'm on about. But it doesn't have to be cars. You may want to apply a small image onto the wall of a building, or a flag onto the tail fin of a jumbo jet. Decals are everywhere and doing 'em right is what this Tutorial's all about.

So how do you do it?

Use image maps, right? You paint the outline of the body, left side, right side, top view, rear view, etc., in a paint package and you colour 'em in. Then you pop the logos in the places they're supposed to go and that's it. Then you project or wrap the maps onto the body, right? Wrong! That's how amateurs do it! The chances of the logo landing in exactly the correct spot when the map is applied to the body, is slim. If the map is not pixel perfect, the same length, width, height or whatever of the LightWave mesh (or a multiple of these sizes), then the logo will be mislocated. Make the body map slightly out and the logo will end up in the wrong place. This method is also a chore, but it's the way the NewTek manual tells you to do it!

So how do you do it?

The method I'll describe in this Tutorial is one I figured out when trying to put umpteen decals of different shapes and sizes onto the paintwork of an F1 Lotus. You may have seen a frame ('Black Lotus') taken from an animation on the Gallery page. This shows only one or two decals, but you'll see more as we go through the tute. Each decal had to be positioned exactly on the bodywork to satisfy the guy I was working with. 'Too high', he'd say. 'Too far left' or 'A couple of millimetres to the right'. Imagine getting that right using an image map of the whole vehicle! So, I struck upon the idea of creating a place for each decal within the mesh itself, rather than just using Layout's surfacing tools.

A Bit of Background

Let's first load the body mesh, or a part of the body which is to receive the decal, into Modeler. Now, let's assume that you want to place an approximately square decal somewhere on the mesh. This may be a vertical surface, a horizontal surface, or one which curves in all sorts of ways, it doesn't really matter. The important thing to remember is that LightWave 'projects' any image map/colour brush either horizontally or vertically. In fact they may be projected from the positive side of any of the three LightWave axes (X, Y, Z). So, a square decal projected onto a surface would appear square only when viewed along its projection axis. It would be seen as a thin line or a distorted square when viewed in the other two orthogonal windows offered by Modeler. In the 3D Preview window of Modeler, it will also appear as a square, a line, or a distorted square, depending on your viewpoint. Got the picture? OK, let's take a further step.

Creating a Canvas

For any of the above stuff to actually be seen in Modeler, we must create a square 'canvas' or 'screen' within the surface mesh onto which the image of the decal will be projected in Layout. Still with me? OK, let's keep going. To create the 'canvas', which should be the size of the decal itself, we must stencil or slice through the mesh, using a 'drill' exactly matching the outline of the decal. This is done by first creating a 3D tool with a square cross section. This 'drill' is then used along with the body mesh in a simple Solid Drill routine. What? You've never tackled Drilling before? Don't worry, it's a breeze! Here's a few graphics to illustrate what's been said so far.

The Body Mesh

The following screen grab shows part of the body mesh of the Formula One. It's not too complex and appears quite primitive at this stage. The Preview window gives a good impression of what it looks like as a render. You'll notice the areas around the air intakes look fuzzy. That's 'cos some further work's needed on the Polygons

If you'd like to follow this Tutorial using your own LightWave software, you can download the body mesh here:

Download Car Body Mesh (14K)

OK, the idea is to create a square outline on either side of the body just below the cockpit, each of which will receive an image. We'll use a couple of different images to illustrate some important points.

Creating an Image 'Drill'

The next graphic shows the body mesh in a Background Layer. It's needed to create a 'drill' in the Front Layer. This 'drill' is effectively a Box object, with a square section and of sufficient length to pass completely through the body mesh just below the cockpit. Here, the 'Box' creation tool is being sized to fit the mesh. When it's OK, you click the 'Make' button.

The 'Drill' Object

Next is a grab showing the square sectioned 'Drill' object. It's just a long Box really. It should be kept at the grid location where it was created.

Solid Drill/Stencil the Body Mesh

Using the 'S Drill' (Solid Drill) tool, we need the 'Stencil' operation. This simply creates new points and polygons wherever the Drill object 'touches' the 'Target' object. No part of the Target mesh is removed. For things to work as intended, the Drill object MUST be in a Back layer and the Target object (the body) MUST be in a Front layer. If you get this the wrong way around, the Body mesh will become the Drill and you'll get the square box stencilled with a few lines.

Here's the setup just before clicking the 'Create' button. Notice that the new Surface to be created by the Stencil process has been called 'Decal', but you can type in any suitable name.

The Exact Position

OK, by carefully adjusting the position of the Drill, we've stencilled in a square outline on both sides of the body in the exact position we wish to place the logo, sticker, etc. The areas created by the Drill have been labelled 'Decal', so when the new mesh is loaded into Layout, we'll have everything ready to project the image we wish to use. Notice that any 'internal' structures touched by the Drill will be similarly stencilled and labelled. This may or may not be important. It should certainly be bourne in mind if any of those internal surfaces will be visible in the final render. You may wish to relabel these areas with their original name.


Important Notes

Solid Drilling requires exactly that, a solid drill. This means that the drill MUST be an enclosed Object. And that means you should not be able to 'see inside' the Object from any external viewpoint.

If you don't want a symetrical arrangement of decals on both sides of the body, reduce the 'penetration' of the Drill through the Target mesh. It will only stencil onto the Polygons it touches.

The stencilled areas 'inherit' the Surface attributes of the Drill.


The following grab shows the stencilled areas ('Decal') selected. The two internal surfaces created here will not be visible. Notice that the Projection Axis for this particular decal is the X axis. It will be applied from the +X direction, that is from the Left as defined by Modeler.

Here's what the Preview looks like, complete with those fuzzy intake polygons.

Save it! Save it! Save it!

Having got this far, I'd be a bit miffed if the wife pulled the wrong plug and I lost all this effort! So, you know the drill. Save it now! Give the stencilled body mesh a new revision number. That way, you can go back to square one if needs be.

A Trial Render

With the stencilled body mesh safely on the hard drive, load it into Layout so you can run a simple render and check everything's as you expect. The mesh should be placed in a suitable position on the Layout stage. Facing left, with the 'Decal' outline centered in the Camera is best. The body may already have a surface attribute, but if not, give it and the 'Decal' surface a different colour. Here's one I made earlier. Notice that the decal area has LightWave's default (200,200,200) colour, that was 'inherited' from the Drill.

The Decals

Before getting into the projection process, let's take a look at a couple of images that might be applied as decals to an F1 racing machine.

The first is an image bearing the logo of Lidl, the supermarket chain. No, I don't have shares in Lidl, they just have a nice square logo! The second one is a square image bearing the number '24' in black with a white outline and dark green background. The dark green was originally intended to match that of the Lotus paintwork, so the background blended in with the bodywork. Again, this is the amateur's method that doesn't work very well. I'll show you the proper way!

Now applying the Lidl image is pretty easy. It's got its own colour scheme over the entire area and a white outline, so it will sit nicely within the 'Decal' outline. We won't have to worry about matching up anything with the surface of the body mesh.

The '24' sticker is different. It's got the square shape OK, but we don't want to see that in the render. We only want to see the number '24' and nothing else. The 'background' in this image should have the same attributes as the body mesh. Problem is, you can't control the surface attributes of an Image that well. OK, you could make the background colour the same and you may get away with it. But what if the body attributes have to be morphed or animated....? Read on.

A Lidl bit here, a Lidl bit there!

Let's look at the Lidl case first, 'cos it looks easy.

In Layout, load the Lidl image into memory using the Images menu.

Now, click the Surfaces button and on the pop up Surfaces Panel, select the body surface. It's called 'Body' in the download which accompanies this Tutorial. Give it a suitable colour and any other attributes you fancy. The lighting should come from somewhere above and to one side of the Camera. Keyframe (0)/All Items to fix everything in place.

Go back to the Surfaces Panel and select 'Decal'. This is the square area onto which the Lidl image will be projected. Leave its colour at default. It won't be seen anyway, because the image will cover it up. Click on the 'T' button alongside the colour selector. This will pop up the Color Texture panel for the 'Decal' surface. Here, you control how the Image will be projected (mapped) onto the 'Decal' surface.

Under Texture Type, select 'Planar Image Map', since we want the Lidl image to be applied as a flat map.

Under Texture Image, select the Lidl image you loaded earlier.

Next, select 'X Axis' as the Texture Axis. This will project the Lidl image onto the body from the 'Left' as described earlier.

Now click 'Automatic Sizing'. A warning will pop up telling you that any existing settings will be replaced. OK this and get back to the panel. By setting up Automatic Sizing, LightWave will adjust the dimensions of the image to fit exactly onto the 'Decal' surface. If you didn't set up Auto Sizing and the original image was larger than the surface, only part of it would be applied. If the original image were to be smaller than the surface, LightWave would tile the image, providing the 'Height Repeat and 'Width repeat' buttons were active. So, always select Automatic Sizing when applying decals.

You can see the dimensions that LightWave has assigned to the image by clicking on the 'Texture Size' button. This pops up a small panel showing the X,Y, Z dimensions (in the system's Unit of measure). In the case of a planar image, one of the dimensions (Y in this instance) is redundant and may show 1.0 or another size. It's redundant because this particular projection is horizontal. With vertical projections, the Y axis becomes paramount. All image dimensions, redundant or not, must be greater than Zero.

OK, click on 'Use Texture' to close the Texture panel and get back to the Surfaces Panel. Ensure that the 'Smoothing' button is active, it gives a better result. Now click 'Continue' to get back to the Layout screen and run a quick render to see how things are going. It should produce something like this....

Great! If you're intending to produce a single picture of the left side of the car, the job's done. But what about the other side? Remember the stencil was applied completely though the body mesh, giving us an identical 'Decal' outline on the right side too. Let's take a look.

Go back into Layout and rotate the body so its right side faces the Camera. What have we got?

Jeepers! The image is reversed!

Just take a Minute

Let's just take a minute to understand what's happening here. Remember I said that all texture mapped images are projected from the positive side of the X, Y or Z axis? Well that's what you should expect to see on the right side of the body, isn't it? We projected the Lidl image from +X (left) and get what we want on the left side of the body. Now follow the projection through the body to the other side and the image is 'seen from the back' as it were, reversed. All perfectly logical Dr Watson!

Now you may be thinking that all this hassle is no better than having to paint two different sides, a top, a front and a back view image of the body with the decals the right way round and doing it the old way! You're wrong! This is better, believe me! And the solution to Dr Watson's dilemma is but a few mouse clicks and a minus sign! OK, plus a little more logic!

The reason the right side is wrong is 'cos it shares the same Surface name as the left side...'Decal'. LightWave treats all Surfaces with the same name as the same thing. But our two decal squares must be treated as different if they are to get their projected image correctly orientated. So how do we do that? Here's how...

Import the body mesh back into Modeler.
Use the Polygon/Stats tool to select all the areas called 'Decal'.
In the Top view, home in on these areas using the zoom In button.
Using the Polygon/Surface menu, rename all these surfaces 'DecalLeft'.
Use the Lasso selection method (RMB) to deselect the decal which is actually on the left side of the body (as seen by the driver). What remains highlighted is the decal on the right side.
Rename this area 'DecalRight'.
Save the revised body mesh under a suitable name.
Export the mesh back into Layout.

Cigol becomes Logic

Here's where the extra logic comes in. Go back into the Surfaces Panel and redo the Texture routines for 'DecalLeft' and 'DecalRight'. Apply the Lidl image in each case using the X Axis. Be sure to click Automatic Sizing each time.

For the 'DecalRight' surface, the projected image has to be 'reversed' as it's projected. Now it's coming in from the +X direction and that's fixed. So, we can only modify the Y or Z component of the projection. As noted earlier, the Y component is redundant because the projection is horizontal. So, the only the Z component is available and that's what will do the trick.

Go into the Texture Size panel and type in a minus sign in front of the Z dimension. Be sure to make it stick by pressing the Return key. Exit the Size panel.

Exit the Surfaces Panel and run a render of the right side of the body. It should look like this...

Now that's a relief, but once you get the trick into your head, it's all so easy-peesy!

And the Answer is...24

You'll appreciate that the '24' decal is slightly different from Lidl. It has a background which needs to blend in with the car's paintwork. As noted earlier, I originally gave this image a dark green background hoping it would match the dark green of the Lotus bodywork. Well it did, but under certain lighting conditions you could actually see the square outline where the mesh had been stencilled. However much I tried, I couldn't get the decal to look as if someone had simply painted the number 24 directly onto the bodywork.

Anyway, let's repeat the surfacing routine we used for Lidl with this new sticker. It's pretty obvious we'll get this....

Now I just don't feel like loading the '24' decal back into a paint package and repainting the background red. In fact doing so could turn out to be a real pain in the butt. Why? because the image is antialiased and changing the background colour is not the only problem. It's all those hundreds of tweeny pixels that need tweeking as well. Forget it! We need the Alpha Channel for this one!

Alpha, Beta, Gamma, Delta.....it's all Greek to Me!

Now the Alpha Channel is pretty clever stuff. If you've really gotten into a paint package like Photogenics, you'll know what I'm talking about.
The Alpha Channel allows you to keep some parts of the image and lose other parts, like the background. We can lose the background, geddit...?

Now I know you're well ahead of me already, but slow down. We'll have to get out Photogenics anyway, 'cos we now need an Alpha version of the '24' image. Even DPaint4 or 5 will probably do, but you'll have to check (I've forgotten so much!). The basic idea is to make all the bits of the image we do want to see white and all the bits we don't want to see black. I reckon the easiest way to do this (antialiasing remember) is to change the image's palette to just the two colours, black and white. Everything else, size and shape, should remain as in the parent image.

However you do it, the Alpha image should look something like this.....

I've placed the original close by, so you can see how everything corresponds. Remember, the Alpha image is a filter and we'll see right through the black areas but not the white. In the black areas, we'll see the attributes of the surface underneath the image.
Now remember to Save this new image with a suitable name like '24alpha.jpg'.

Good, we're getting into the home straight! But there's another important thing to remember right here.

Another Important Thing to Remember

Black areas of the Alpha image filter out matching areas of the parent image and allow any surface details 'behind' it to come through. So, if the DecalLeft and DecalRight surfaces have been assigned any inherent colour or texture, you'll see 'em. This feature had me scratching my head for a while, till I realised that LightWave had assigned its 'Default' colour (200,200,200) to the stencilled areas. It's picked up from the Drill remember?

So, before you start rendering with the Alpha Channel active, make sure the surface that will receive the image projection is given the same attributes as the rest of the body mesh. In the current case, make 'em red.

Load the Images

Go into the Layout / Images panel and load up the '24' image and the '24alpha' version.

Go into the Surfaces/Color Texture panel for the DecalLeft surface and select the '24' image as the Planar/Texture Image and select the '24alpha' image as the Planar/Texture Alpha Image.
Set the Image Axis to X as before and don't forget to Auto Size.

If you wish to render the DecalRight area, repeat all this for the other surface, but remember to reverse the projeced image by making the Z size negative.

The rendered body should now look like this....

And the other side like this....

But Mine's an Odd Shape!

OK, we've seen how to stencil in nice square decals, what about those with other shapes? Some might be circular or oval or even worse, random splodges and squiggles. The answer is it doesn't matter what shape the graphic is, providing you stencil in a suitable outline to encompass it. Let's look at another example.

Here's one of the 'WaveGuide' banners that we decided to stick on the top surface of the body, either side of the cockpit. This one is for the 'left' pod.

Again, only the red/yellow parts of the image were required. This decal was given a black background, but it could be any colour because the Alpha version will filter it out.

Here's the Alpha image to do the trick.

Now you could use a large rectangular Drill shape to stamp the outline if this image onto the body mesh. However, that's a pretty cumbersome size and it may impinge on other areas of the mesh that have attributes different from the image's intended background. The neatest thing to do is make a specially shaped drill to create a nicely shaped outline for the graphic. Here's how.

Making a Wavey Drill

Go into Modeler and using the Display/BG Image panel, Load up the WaveGuide image.
Now select it as a Background Image for the Y axis, which is the Top view.
LightWave initially displays all loaded images as squares, so make sure the relative length and width of the WaveGuide banner are correct by inserting suitable figures into the X, Z Size fields.
Zoom in if you can't see it properly. You can also adjust the relative contrast of the Background Image using the slider on the panel.
Using the Polygon/Create Points tool, place the cursor exactly on the upper left corner of the image and click it down. Got to the Make button and create the Point.
Repeat this routine in a clockwise direction until there are eight Points forming a nice 'ringfence' for the lettering (check out the screen grab below).
Click the Tools button to free up the cursor.
Click on the Polygon button, then the Make button. This will create a single Polygon in the shape you want for the Drill. If you didn't make each Point in the correct order, the Polygon will be 'twisted'. To correct this, Undo the Make and reselect each point in circular fashion around the 'ringfence'. Now click Make.
It's important that the outermost Points on the X and Z axes are exactly on the outline of the Background Image. Remember that LightWave scales its projected images to the exact dimensions of the 'screen' you will stencil onto the body mesh.

The Modeler screen should now look something like this....

You'll remember that the Drill used to stencil the outline of the decal must be an enclosed solid, so the next step is to extrude the polygon along the Y axis to make a sort of kinky box. This gives us the required Drill as shown here....

OK, all we need to do now is repeat the stencilling routine into the top of the body mesh.
Remember that the projection axis in this case will be Y.
Remember to give the stencilled surface a suitable name (eg: waveguidedecalLHS) but give it the same surface attributes as the bodywork.
A separate image is required for the right hand side, because this isn't a case of through projection. You will have to save it upside down so the Top view is correctly orientated.

Here's how the decal looks when rendered onto the bodywork.

Nice one!

What about Inclined or Curved Surfaces?

Now it's all well and good projecting images along LightWave's horizontal and vertical axes, but what happens when the 'canvas' is inclined or curved? OK, let's look at that situation in the next bit of this marathon tute.

How you go about stencilling the outline for the decal really depends on what the viewing angle for the render will be. Remember, you can't alter the projection axes, those are fixed. So, what you can do is alter the shape of the canvas according to your desired viewpoint.

Any decal applied to an inclined or curved surface can only be seen without distortion from one specific viewpoint (along the projection axis). From any other viewpoint, the image will be stretched in one dimension or another. It's a bit like road markings. From your car they look OK, but to a pedestrian on the roadside they are all stretched out.

So, let's say you want to place a circular decal onto a surface inclined at 45 degrees. Clearly, a circular decal is only circular when viewed at right angles to the surface. From any other angle, it will appear elliptical. People designing images for inclined or curved surfaces know about this phenomenon and compensate for any foreshortening by distorting the image. And you can too.

To keep things simple, in Modeler I created a flat target surface of triangular polygons and set it up at 45 degrees to the horizontal. Here's the picture....

Now I'd like the circular decal to appear truly circular when viewed at right angles to the surface. Here's the image, together with the appropriate Alpha version.

So, the first thing to do is create a Drill. Since we'll be using the Alpha Channel, the drill can be any shape, providing the circular image will fit inside its cross-section. Another square-sectioned box will do. Just make the square the same size as the decal's intended diameter. Remember LightWave will stretch the image to fit the stencil. Here's the Drill being adjusted to the target.

The next step is to repeat the now familiar 'S Drill/Stencil' operation. This will stencil a distorted square when viewed from the projection axis, but a true square as seen from the Drill's axis. Here's the setup...

OK, let's render the inclined Surface using the Lotus image and its Alpha version. They were projected horizontally on the Z axis. The first is the view from the projection axis. The second is the view at right angles to the target surface.

That's WaveGuide's Insight

So there you have it. WaveGuide's insight into placing stickers on lamp posts, adverts on buses and go faster stripes on Formula One racing cars. The results are truly satisfying and the method can be adapted to all shapes and sizes of decals.

You follow exactly the same procedures for image projections in the Y and Z axes. These will place decals respectively on the Top/Bottom and Front/Back of LightWave objects.

Remember to use the logical minus switch in the Size panel when you've stencilled into the 'negative face' of an object. That's a face which looks towards the negative side of a projection axis.

Oh yes, a final comment. Having thought about it a bit more, I guess you could use this method for putting some tattoos onto a nice curvy body! But for that, you'd better write your own Tutorial! Thanks for sticking with it.

And Thanks Also To...

My thanks go out to NiNjA_A for his brilliant Imaga Power and other logos. And for the LightWave car mesh, converted from a 3DStudio Max model. Thanks also to Jim Spratt (Jimbo) for asking me to stretch my imagination. I learned a lot!

Here's a few more renders from the Lotus project. All the decals were created using the methods described here.


Lotus1 (122K)

Lotus2 (64K)

Lotus3 (163K)

Lotus4 (139K)

If you find any obvious errors in this Tutorial please email me and I'll fix them at once.


Go back to the top

Go to Tutorial 1
Tutorial 2
Tutorial 4
Tutorial 5
Tutorial 6
Go back to the Tutorials Page
Home Page
Introduction
The Gallery
Downloads
WaveGuide Manual
Other LightWave Sites
My Amiga