Gile[s]…Part Three

You can now download the Deck scene here as a Gile .gls file.
It will load into either the demo or full version of Gile
Have Fun….

<!– m –><a class="postlink" href=""></a>&lt;!– m –>


Building up a scene in Gile
Suppose, having got this far, you decided your scene would look better with some extra bits and pieces, maybe some crates.
One way of doing this would be to go back to the model in 3DC, add the crates, re-load it back into Gile
and start all over….NO WAY, LIFE IS TO SHORT!!!

There are two ways of doing something like this, I’ll run through them both.
has a nice little feature In the File menu were you can Merge new objects into the scene.

The only thing to keep in mind with this is…
As you add new objects with new materials to the scene, these new materials will take up lightmap space already used by the materials presenty in the scene.
So keep an eye on the shadows, if they start to deteriorate or you get the blotches coming back , this is a sure sign you need to add another lightmap and divide up the materials between maps.

(Method 1)…. You can build your new object in 3DC, export it, and, using the Merge in Gile, merge it into your scene.
(Method 2)…. If this new object is something quite simple, say a crate, created from a basic cube. You could do this in Giles by creating a new cube primitive in Gile
and applying a texture, very similar to 3DC.

I’ll do both, it’s really just a matter of chosing the method that suits you best….for anything more comlex than a basic primitive you need to be using Method 1.

Method 1…(Top Image)
Open the scene in 3DC, I’ll go for a simple crate made from a basic cube primitive.
1) Drop a cube onto the scene, scale it so it looks like a sort of medium size crate, right click on the cube and from the drop down menu choose Groupingandgt;andgt;andgt;andgt;Ungroup.
When you drop a new object onto another object in 3DC it becomes a child of that object, I didn’t want that here so you need to Ungroup it from it’s parent.

2) Apply the crate texture with the brush tool to all the cube sides apart from the bottom face. Select the bottom face and delete it.
This bottom face won’t be seen unless you stack the crates up so they are above camera height. By deleting this face you save on the poly count and lightmap space. If you had applied the crate texture to the underside of the crate, it would still grab lightmap space, even though it was unseen by the camera.

Method 1… (Bottom Image)
Now Export this crate from 3DC.
Right click on the crate, from the drop down menu choose.. Export Selectionandgt;andgt;andgt;andgt;DirectX Object.
Save the file. Make sure it goes into the the same folder that contains the Textures, 3DC and Gile



Back in Gile with the deck scene loaded..
In the file menu choose Merge, select the crate .x file and click Open.
If you are asked if you want to use the existing scene material with the same name for the merged model, in this case click No. I’ll explain why later.
Next a window will pop up asking which lighting method you want for the new material(s)
In this case I have a choice between No Light, Vertex Lighting or either of the two lightmaps.
Eventually the crate material will be assigned to the DeckLtMap1 lightmap but for now choose No Light and click Use.

You should end up with something looking like this.
The reason for choosing No Light for the Lighting method, is that you will find it much easier to position the crates while you can see them clearly.
Giles doesn’t work like 3DC here, when you move the crate down to bring it into contact with the floor, the lower part of the bounding box doesn’t disappeare as it touches the floor, so it can at times, be a bit awkward try to judge when one object is in contact with another. Maybe Gile
could learn something from 3DC here.

BUT…there’s a problem. Look at the material panel on the right…I now have TWO materials called Matt_0
This is were I have a problem with the way 3DC exports the .x file.
If the texture names had been used instead of Mat_0 etc this wouldn’t occure.
The reason for the two materials with the same name is, the first is from when the original deck scene was loaded, the second is from the new crate object.
This is why, when you were asked if you wanted to use the existing scene material, you clicked No

Anyway to correct this just click on the new crate material in the Material panel and rename it.
Also make sure the Flat Shaded box is ticked for when the scene is rendered.


Top Image
Remember when I loaded the deck scene, I scaled it up by 2 in XYZ .Do the same with this crate object and I renamed it Crate1.
Go into Model Mode, select the crate, move the mouse pointer onto the green Y axis arrow, hold down the left mouse button and drag the crate down till it just touches the floor. You may need to zoom in so you can see clearly when the crate touches the floor.
Drag the crate around with the X and Z axis arrows to position it. TIP you will get better shadow effects if you don’t push it right up to the wall.
You could at this point just keep cloning this crate, scaling and positioning as required, then render the scene.

Bottom Image.
I’ll do it the other way…I’ll render the scene first then clone and position some other crates.
But the crate material is still assigned to No Lighting, so go into the Material panel, select the Crate1 material.
Under Lighing Properties, instead of No Lighting, I selected the DeckLtMap1 lightmap.
The crate will now no doubt turn quite dark.
Before you render this new scene, go into the Modify menu and choose, Recalculate Noramlsandgt;andgt;All.
If you ever get a problem were you change something within a scene and the shading goes all to pot try the Recalculate Normals first to try to correct it.
Render the scene.
So thats the first crate loaded into the scene and rendered.
As it is the colour of the crate material could be adjusted to make it stand out a bit more from the floor, I’ll do that in the next bit.



I cloned, rescaled and rotated slightly a number of crates, positionng them along the deck.
In the Material panel I changed the colour of the material to a reddish brown, you don’t need to much colour here, maybe I got to much but it’s easy to change later as the scene builds up.
The crate texture could do to have a bit more contrast I think, just to give it some umph, but this needs doing in your paint app, maybe later.
It don’t look to bad but all the crates are the same colour, maybe if some where slightly different it would look better. So….


Fig 1…In the Material panel Click the yellow star next to the paint brushes, this will create a new material for you.
Guess what, called New Material.
I renamed mine CrateTwo.
Move down the panel, in Effects tick the Fullbright and Flat Shade boxes.
Under Lighting Method I selected the DeckLtMap1 lighmap.
Now move down to the Texture Layers, they all read None apart from the layer resreved for the lightmap.
You need to assign a texture to this material, so click on Layer 0.

Fig 2…This brings up the Select Texture window.
Click on the Crate texture, make sure the Color and MipMap flags are ticked, and under Texture Blend choose Multiply, which it should be by default.
I have mine set to Mod2x, more on this later maybe.
Click Apply and the Crate1.bmp texture is assigned to Layer 0 of the new material.
Now all you need to do is to adjust the colour using the colour swatch.

Fig 3..I went for a greyish green colour, but you can change this later if it don’t look quite right.


So how do you get this new material onto some of the crates. Dead easy.
In the material panel next to the yellow star are two brushes.
These work in much the same way as the 3DC Fill and Brush tools.
The ‘ Apply material to Model’ brush applies the material to the WHOLE model, similar to the 3DC Fill tool.
The ‘ Apply material to Polygon’ brush applies the material to a single face/polygon similar to the 3DC brush tool.

So all you need to do is to make sure the new material is selcted ( in this case Crate2).
Click on the Apply material to Model brush
Decide which crates to apply the new material to, position the brush curser over the crate and click once.
Thats it…job done…nice.
This looks a lot better and I may adjust the Crate1 material later to get rid of some of the brown, not to keen on that.


Fig 1.
One of the problems you will find when buiding a scene up like this is that the hierarchy panel gets quite cluttered.

What you could do, is to drag all the crate clones onto the original crate in the hierarchy panel, creating a group.
You can then open and close this group by clicking on the small arrow symbol next to the parent object.
BUT….if you wanted to re-position the parent crate, all the child crates would move as well.
What I do here is to create a pivot object to act as the parent.

Fig 2.
In the Create Menu click Pivot.
A pivot/axis is created at world position 0,0,0. You can move this around just like any other object.
As I have quite a number of these, especially in a large scene, I stack them up above the scene.
So I just select the Y axis of the pivot and drag it up above the scene as in Fig 2.

Fig 3.
I renamed this pivot Crate Pivot and dragged all the crates onto it in the Model hierarchy panel.
Now you can move ANY of the crates around as you wish.

Fig 4.
By clicking the small arrow next to the parent you can now close this group.

It’s important you get this hierarchy sorted out as soon as you start adding other objects to the scene, if you leave it till later it can become a nighmare. Even with a small scene like this it’s a big help to get things arranged in the hierarchy panel.

As I add extra objects to this scene I’ll create more pivots for them, stacking them up above the scene.


If anyone is in doubt about this here’s a pic of PART of the Launch Deck on board the Morpheus.
Remeber my comments about NOT starting out with a large scene in Gile.
This scene has around 160 lights, 8 lightmaps and a vast amount of objects that have been merged into the scene.
The hierarchy panel scrolls on for ever, so ignore sorting the hierarchy and adding pivots at your peril.

Hey Fredborg…just thought, a Hide/Show ALL lights button would be a big help with scenes like this?

I may post a few screenshots of these scenes at the end of the tutorial.


Anyway, onto Method 2 of creating some extra objects for the scene.
They need to be simple objects as you can only use the primtives in Gile as they are.
You can’t extrude stuff to create more complex objects like you can with a 3D modeler.
Maybe one day…who knows…wouldn’t that be nice

So I’ll stick with a cube primitive and make yet another crate.

In the Create menu choose..Primitiveandgt;andgt;andgt;andgt;Cube
A cube primitive will be created at position 0,0,0 as in Fig 1.
The only problem is, you won’t be able to see it…only the bounding box. If you look in the Model hierarchy panel the little eye next to the cube object is turned off. Click the eye and the cube will appeare.
This only happens with the cube primitive, I think Fredborg wrote that in on purpose out of sheer wickedness.

So now select the Crate material
Select the Apply Material to Model brush and click on the cube.
The cube will go quite dark as the material is assigned to a lightmap.
Render the scene and you should end up with something like Fig 2. The crate texture is mapped around all the faces of the cube…Nice
Scale, and position as required and don’t forget to add it to the Crate Pivot group in the hierarchy panel.

That was easy, wasn’t it, BUT there’s a problem, (isn’t there always)
With the original crate that was imported into Gile
, I deleted the underside face of the crate so it wouldn’t grab any lighmap space.
With this new crate the material is mapped around the underside of the crate as well, and even though it is unseen by the camera, Gile
will still assume you want this underside face lightmapped because the material used is assigned to a lighmap.

If you’de created a number of these crates, the underside faces would end up grabbing loads of lightmap space.
You can’t delete faces/polygons in Gile
as yet ( at least I don’t think you can), so we need some way of getting around this problem.


This is how I do it..
In your paint app create a small 64×64 texture, fill it with a mid grey colour and add a bit of noise if you wish.
Save the file with a name relevant to the scene you are working on.
In this case I went for DeckNoLight.bmp.
You will need one of these in just about every scene like this that you create, so rather than just calling the texture NoLight, I put the scene name before it, then if I go back to the scene at a later date I know exactly what this texture is being used for.

What I now do is load the texture into Giles and assign it to a material…guess what called NoLight.
Remember a material assigned to No Lighting doesn’t take up any lightmap space but it can still cast shadows.

Fig 1
To Load a texture into Gile
In the Windows Menu choose, Texture window.
Click the Yellow star to create a new texture.
In the right hand panel under Texture file click the New Texture box, and select the DeckNoLight.bmp file.
Make sure Color, Mipmap and Multiply are all selected.
Click Close at the bottom of the Texture window

Now create the new material in the material panel in just the same way as I did earlier when I created the extra crate texture, and assign this new DeckNoLight texture to Layer 0
Select Fullbright and Flat Shade for the Effects. I’m not sure if this is acually needed with a material that won’t be seen.
In the Lighing Properties make sure it’s Lighting method is set to No Lighting, cast shadows is turned on and Effect Global Illumination is turned off.

Fig 2
So with the NoLight material selected click the Apply Material to Polygon brush.
Hold down the Ctrl key and position the camera so you can see the underside of the crate.
Let go of the Ctrl key and apply the NoLight material to the polys on the underside of the crate.
Be careful with this, I’m not sure how well the Undo feature works when applying textures.
If you do make a mess of it you can always re-apply the original texture.

Now these underside faces won’t grab any lightmap space.
But remember if your creating a number of crates using this method, apply this NoLight material to the FIRST crate, THEN clone the others.!!!!!

In Fig 2 I’m actually applying this material to the polys on the crates created earlier, because the same situation applies.
The sides of the crates, that are facing the wall can’t be seen either, but are grabbing lightmap space, so you can apply this NoLight material to these polys also.
You do need to be a bit careful here. If you have rotated any of the crates so they are at an angle to the wall the camera will sometimes pick these up.
If this does happen and you can’t live with it just re-apply the original material and render the scene again.

When your done go to the basic properties for this material, click the colour swatch and take the colour picker down to nearly black.
If you want to use the material again later for the same purpose, move it back up to a lighter grey so it’s easily visible while it’s being applied.

WOW…. that was a long part to write.


Nearly done now.
I just wanted to show one way in which you can set the Alpha flag for a material to get an effect. In this case some grime/discolouration onto the walls.

You start in your paint app with a small texture, this one is only 64×128 make the background colour black and paint something like this (Bottom left corner of the pic). I’m sure you can all come up with something better than this. Save the file into the same folder as all the other textures for the scene.

You load this into Gile just the same as the DeckNoLight texture. For now leave the flags as default (color and mipmap)
Create a new material and assign the texture to Layer 0. Fullbright and Flat Shade need to be ticked but turn Cast Shadows off. Assign it to No Lighting for now.

In the Create Menu choose Primitivesandgt;andgt;andgt;andgt;andgt;Plane
Apply this new material to the plane with the Apply Material to Model brush
You now need to rotate this plane so you can push it up against the wall, this is easiest in the Model panel under Rotation. I set mine to Pitch = -90 and Yaw to 90.
Now push this plane up to the wall, as close as you can get and scale as require.

Next go back to the Texture Window and tick the Alpha flag, so you should now have Color, Alpha and Mipmap set. In this case I also set the Texture Blend to Mod2x. Click close

Because the material is still set to no light it will appeare very bright.
I changed the Lighting Method from No Lighting to the DeckLtMap1 and rendered the scene.
I selected the material in the Material Panel and under Basic Properties set the Alpha level to 0.6. Just to blend it into the wall a bit better.

Last job, I created another pivot to act as a parent for the wall grime plane, cloned it a few times and rescaled some of them as well.

Before I leave this pic, remember I mentioned to keep an eye on the quality of the shadows as you add stuff to the scene.
Well if you look at the shadow cast onto the wall on the left hand side of this pic, you can just make out the jaggied edge this is now starting to get.
If I were going to continue adding stuff I would need to be thinking about creating another lightmap before to long.


OK…this is it the last bit. Yipppeeeee
So you’ve got everything set up, no more adjustments to make, nothing more to add to the scene.
Now when you render the scene, in the Render window, under Direct Illumination Settings you tick the Anti-Alias box.
Gile will now try to smooth out any jaggies along the edges of the shadows. The downside is the render time will jump up. So go and make a cup of coffee while you wait. This render took just under 5 Mins.

It still didn’t quite get rid of the jaggies, but it could really do with another lightmap.
However what you can do is, go back into the Lighting methods window (Click the yellow LM button to get there).
If you select any of the lightmaps, on the right hand panel under Lightmap tools you will find Blur Lightmap.
Click the lightmap you want, click the Blur Lighmap tool, enter a small amount to start with and click Blur.
This usually corrects the problem….if it don’t you need another lightmap.

So thats it…THE END

Well nearly.
Fredborg has kindly offered to host this Deck model on the Gile
Not as a 3DC file but as a Giles .gls file.
So if you have Gile
even the Demo version you should be able to load this scene and check it all out.
Use any of the textures and the model as you wish.
If you haven’t got anything to use as a test model of your own, use this scene to mess around with.

Try Merging in some of your own stuff, maybe change some of the textures, whatever.
Remember if you do so you’ll need another lightmap.
If you get stuck, post on the forums.
If you create a masterpiece…I’d like to see it.


great bazza,
this thing does a lot more than i thought..i have not had the time to sit down and really try a lot of things in the three tutorials but maybe this weekend if the old lady will leave me alone long enough. i’m glad your doing this for me because its hard to find tutorials that go into this kind of detail for gile
thanks again, pirate

Ok…thanks…no problem.
I may do a couple more yet but don’t hold your breath. <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –>

The way I look at all this is that both 3DC and Gile are extreemly good at what they do and are both reasonably priced.
When you use them both together you’ve got something VERY special.

In the mean time here’s a link to the download section of the Gile site.

<!– m –><a class="postlink" href=""> … b=download</a><!– m –>

You’ll find some of Fredborg’s demo scenes here.
Worth downloading so you can get some idea of how to set stuff up.

There’s also a demo version of Giles here, Free!!!
But the save is disabled ( wouldn’t you know), however for anyone thats intersted but not to sure about it all it’s one way to check it out.

All the scenes should load into the demo version ok.
I’ll send this deck scene off to Fredborg in the next day or so and post here when it’s ready for download.


You must be logged in to reply in this thread.