HOW TO GET A
LIGHTMAPPED STATIC PROP INTO GRAW
PAGE 2
3.AWESOME
TO THE 3dsMAX
Ok, now when you have prepared your application for action, lets get
down to the dirty. Start off by creating your object . You should know how to do
this, and if you dont get a read a tutorial somewhere else on how to build
stuff in 3d . May I suggest www.polycount.com
or www.cgchat.com ? Im not here to teach you 3d
modelling and texturing!( not that I couldnt do it if I wanted too, as you can
see im a VERY good teacher!hehe)
Right, back to the actual stuff.
In this tutorial we are gonna keep it to the basics so what are gonna do
in this 3dsmax scene is this:
-Load up your object
I just ASSUME that you have been clever enough to make it in the proper
scale. If you havent, scale it so that it has real world scale in the metric
system.
Name it to something approriate, since this mesh you have now is the
graphics mesh a good name would be for example “gfx_wall” but this is just to
keep things orderly.
-position it properly
as a general rule, just to make it simpler for yourself, try to place
things on the 0,0,0 grid plane. So if you are gonna make a wall make sur the
buttom on the wall is on 0,0,0 , it doesnt really matter to the engine but it
makes it easier for YOU.
Also make sure its rotated(and its pivot) in a nice and orderly way. Y is forward, Z is up and X
is to the sides. In local space.(see the root_point further down)
Also its nice if you position it on 0 in the other axises(axi?latin
plural perhaps?) aswell so its slap bang in the middle, but standing on the
“ground plane”
Now reset your Pivot so its in the middle of your object(once again,
this isnt nessescary and sometimes you want it somehere else, but as a general
rule its nice to have it in the middle.
-Reset the transforms of your
object
you should know that when you build 3d models and you rotate them and
scale them and attach stuff here and there, in the end 3dsmax can get very
confused about what is actually up down, the correct scale and justa bout
everything else. So in order for your model to show up correctly in the engine
you should select it, go to the utilities panel (the hammer icon in the top
right, gosh, you should know that already!!) and choose “reset xform”. Now
BEFORE you do this, you should make sure that your object is not linked to
anything, doesnt have anything in the stack and BEFORE you press “reset
selected” you should save your work in a
new file, just incase it goes bonkers. It does that sometimes.see, GRAW isnt
the only flawed software in the universe, wich you should know if you have used
3dsmax for more than lets say 45 seconds. And it costs ALOT more than GRAW. Ah
well sorry, this isnt a rant about the bugs of 3dstudio(who I love to bits
ofcourse, despite her flaws).
Now when you have saved, press the “reset selected” button. If NOTHING
happens you have done very well.If your model gets flipped inside out, you just
have to flip the normals(you do this in edit mesh or edit poly in the modifiers
section, once again, im not here to teach you 3dsmax!)
If a whole lot happens, like the model shrinks into a tiny pea or gets
rotated 321 degrees you need to reload your maxfile and try again until you
have done it right.
Reseting the xform is VERY IMPORTANT!if you dont do this you will be
very sorry later! You should ALWAYS reset xform before you do ANYTHING
important to a mesh, wether it be adding skinning or linking it to something. I
cant stress this enough!ALWAYS RESET THE XFORM.
Right, assuming that you have now resetyour transforms correctly we can
now continue.Sorry about all the screaming.Its all in your best interest.
-Add the root_point
Now, the root_point is the a dummy box named “root_point” remember this.
Every *.Diesel file you create should have a root_point dummy box in it. This
is most likely the most important object in your scene!depending on how you
prioritize ofcourse.The root_points middle point(pivot) is the the excact point
from the which the object will spawn in the editor(locally ofourse) so its
usually good to position the root point on 0,0,0 in the world.The same as your
graphics object. You can move it around if you want to spawn something
diffrently tho, its really up to you and your needs!
I usually create the dummy box in the top viewport. That way I get it
correctly rotated straight away! The axis of the root_point dummy should be(in
local space) Y is forward, Z is up and X is to the sides.
If you havent named the root_point dummy root_point yet, do it now!
Now, select “gfx_wall”( or whatever the name of your graphics object is)
and link it to the root_point. If you have done this correctly, when you move
your root point dummy, the “gfx_wall” object should follow it accordingly. The
root point is now on the top of the link
hierachy. In almost every case, no matter how many objects you have in your
scene, the root_point should almost always be at the top of the link hierarchy.
Also, NEVER EVER SCALE THE
ROOT POINT!!! NEVER EVER SCALE IT! IF
YOU SCALE IT AND THEN LINK AN OBJECT TO IT,
IT WILL SCALE ACCORDINGLY IN THE ENGINE!!
-Add a material to your
graphics object
Now you move into the material editor.
You choose a material, (standard max material) name it something
appropriate like in this case “wall” and apply it to your graphics object, in
this case (gfx_wall)
Now, the only thing that translates into the diesel file from the
material editor is this name.NOTHING else. You can therefore use as many
subobjects etc etc that you want, as long as they all have uniqe names. Any
changes in the materials, like adding bitmaps or whatnot, doesnt matter, it
does not translate into the .Diesel. ONLY the name does.As you might remember,
the materials are set up in a materials.xml file that I will describe to you
later!
-Do the Lightmap Uvs
Right, to render out lightmaps on an object you need to unwrap its
texture coordinates so that the lightmaps can be baked onto a texture. However
since you dont want to mess with your original uvs that is made for your
diffuse texture, you will now do the Uvs for the lightmap in uv mapchannel 4.
To do this you select your graphics object, apply another unwrap
modifier of your choice to it and select “ mapchannel or channel 4(depending on
wich unwrapper you are using)
This way we give your model two seperate sets of texture coordinates.
To quote Grin_bumbi(or björn as we usually call him since thats his
name)
“To create a
lightmap you need to map up the object using map channel 4. To do this add a
Unwrap UVW modiifer
and set map
channel to 4. (I might add here that you HAVE to add a NEW Unwrap modifier,
otherwise it will overwrite your mapchannel one when you change it to 4)
Some guidelines
for lightmapping is that you may not have overlapping faces, and the map must
be within
0 to 1 in the uv
space. Also scale the map in a few pixels so that you make sure the will be no
bleeding
from the
other uv bits”
Id like to add that you should also keep a certain distance between the
diffrent parts of the uvs since the lightmaps are relativly small and lowres
and could therefor cause bleeding between faces.(well Björn kinda said that
already, but whatever)
Now..I think we are kinda done actually...uhh..yeah..I cant think of
anything else, lets move on to the next part!
Previous page ------ Next page