Author Topic: Tutorial - Lightmapping  (Read 3800 times)

Offline blaXXer

  • Your Leader
  • Posts: 479
  • Cookies: 96
  • The proud result of slave labor
    • blaXXer.design
Tutorial - Lightmapping
« on: November 15, 2007, 02:16:26 PM »
Lightmapping for dummies - everybody can do it!


Prerequisites:
  • 3ds Max 9 (or any other version of Max that has this feature)
  • A fully lit and textured model
  • Patience

Okay, let's get started, shall we?

I simply assume, you know how to texture and already have your model mapped out and
textured.

Now, you all you need to do, is set up the lights, the way your interior set should be lit (may be throw in a few glowmaps and whatnot for good measure); and then, you can begin the long and tedious process of lightmapping.

Perfect, now go into the 'Render'-dialogue and select 'Render to Texture' (or press 'O') and a dialog-window will pop-up and you won't be able to do much with it.

So, select one of the objects in you scene and you will be presented with a multitude of different options.

I'll just walk you through the most important parts:
First, check the box to enable 'Projection Mapping' and then proceed to the
next section that reads 'Mapping Coordinates' and set the options there to 'Use Existing Channel' (usually you
mapping channel will be 1).

After that's done, head over to the 'Output'-section and first of all specify your texture
size (the exact size of your base texture would be appropriate here).

Then, click on the 'Add'-button and choose
'Complete Map' from the list (you can also play around with some of the settings, see what you can come up with ;)).
After that's done, under the 'Enable'-section, enter what you feel is appropriate, like the filename, save location and whatnot (self-explanatory, really) choose your texture size and finally hit the 'Render'-button.

You should be done now. Rinse and repeat for other textures aswell.

other users are welcome to add and expand on this little tutorial...

YOU suck, get a life, moran.

COME TO MY PLACE clicketh me!

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
RE: Tutorial - Lightmapping
« Reply #1 on: November 15, 2007, 02:21:11 PM »
'bout time to have something like this.
I'm gonna try it out right now.
thnx blaxxer!!!!

EDIT:
previous versions go back up to v5 or so. version 3 doesnt have it that I know of.

Offline Adonis

  • Ze Meister xP
  • Posts: 670
  • Cookies: 84
  • Da Death Squad ???
    • Star Trek Excalibur
RE: Tutorial - Lightmapping
« Reply #2 on: November 15, 2007, 02:30:29 PM »
Just remember, this is how I do my spotlights on ships ;)
Easy is the path to wisdom for those not blinded by themselves.


Offline lint

  • Posts: 599
  • Cookies: 211
RE: Tutorial - Lightmapping
« Reply #3 on: November 15, 2007, 04:05:06 PM »
hehe blaxxer ;)

Offline Dawg81

  • Posts: 733
  • Cookies: 29
  • I am Dawg; Resistence is futile
RE: Tutorial - Lightmapping
« Reply #4 on: November 15, 2007, 04:36:26 PM »
Very good of ya to do this blaXXer; have a cookie

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
RE: Tutorial - Lightmapping
« Reply #5 on: November 15, 2007, 04:39:18 PM »
one Q tho:
do you actually need lights as lights? or can I use indirect/fake lighting?

also:
how does this affect red alert lighting?

Offline blaXXer

  • Your Leader
  • Posts: 479
  • Cookies: 96
  • The proud result of slave labor
    • blaXXer.design
RE: Tutorial - Lightmapping
« Reply #6 on: November 15, 2007, 04:42:06 PM »
one Q tho:
do you actually need lights as lights? or can I use indirect/fake lighting?
You can place your light wherever you feel like, you should, however see to it that it looks realistic.

also:
how does this affect red alert lighting?
you would have to re-lit it for each alert state.

/edit: who unstickied it?

YOU suck, get a life, moran.

COME TO MY PLACE clicketh me!

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
RE: Tutorial - Lightmapping
« Reply #7 on: November 15, 2007, 06:09:49 PM »
You can place your light wherever you feel like, you should, however see to it that it looks realistic.
no, I mean, self-lighted textures for example, like the ceiling

/edit: who unstickied it?
wasn't stickied yet.

Offline LJ

  • Retired Staff
  • Posts: 1661
  • Cookies: 1139
RE: Tutorial - Lightmapping
« Reply #8 on: November 15, 2007, 06:34:32 PM »
Consider it stickied. :)  Thankyou for the tutorial! :)

Offline blaXXer

  • Your Leader
  • Posts: 479
  • Cookies: 96
  • The proud result of slave labor
    • blaXXer.design
RE: Tutorial - Lightmapping
« Reply #9 on: November 15, 2007, 07:49:33 PM »
@Nighthawk: for areas that are self-lit you should use alpha- or glow-maps.

YOU suck, get a life, moran.

COME TO MY PLACE clicketh me!

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
RE: Tutorial - Lightmapping
« Reply #10 on: November 16, 2007, 12:34:37 PM »
@Nighthawk: for areas that are self-lit you should use alpha- or glow-maps.
that, instead of "complete map"?

Offline limey BSc.

  • JL Studios - Co-Founder
  • Posts: 1152
  • Cookies: 421
  • JL Studios - Co-Founder
RE: Tutorial - Lightmapping
« Reply #11 on: November 16, 2007, 01:09:38 PM »
Awesome tutorial, and great idea! I tried it, but when I tried to get it ingame, it crashed to desktop. I know its not the scripts, as I copied them from another bridge, and I don't think its the model. This is what the 'Render to Texture' menu looked like just before I clicked render:



Can you see what I'm doing wrong?
MUSE!!!


Offline Adonis

  • Ze Meister xP
  • Posts: 670
  • Cookies: 84
  • Da Death Squad ???
    • Star Trek Excalibur
RE: Tutorial - Lightmapping
« Reply #12 on: November 16, 2007, 01:27:35 PM »
Ok, first, I can see that you tried to do it for an Ori bridge.

Now, for bridges, it isn't as easy as port bridge model, rename some scripts and hope it works.

First, you need to reapply the lightmaps to the model on a different mapping channel (usually channel 1 is used for diffuse, channel 2 for lm's), do the animations, script everything and then you can remotely hope that it'll work. I played around with bridge scripts and it ain't pretty.
Easy is the path to wisdom for those not blinded by themselves.


Offline limey BSc.

  • JL Studios - Co-Founder
  • Posts: 1152
  • Cookies: 421
  • JL Studios - Co-Founder
RE: Tutorial - Lightmapping
« Reply #13 on: November 16, 2007, 01:39:45 PM »
Ok, first, I can see that you tried to do it for an Ori bridge.

Now, for bridges, it isn't as easy as port bridge model, rename some scripts and hope it works.

First, you need to reapply the lightmaps to the model on a different mapping channel (usually channel 1 is used for diffuse, channel 2 for lm's), do the animations, script everything and then you can remotely hope that it'll work. I played around with bridge scripts and it ain't pretty.


Well, the script I'm using is the one LJ wrote for me for the X-303 bridge, and that's in-game with the lighmaps. It calls on some generic animations, so the crew just sit there, breath and look around!

So do I set:



both to channel 2 then?

The main thing I was worried about was the 'Target Map Slot' down the bottom, or is that ok?
MUSE!!!


Offline Adonis

  • Ze Meister xP
  • Posts: 670
  • Cookies: 84
  • Da Death Squad ???
    • Star Trek Excalibur
RE: Tutorial - Lightmapping
« Reply #14 on: November 16, 2007, 01:42:55 PM »
Switch to use automatic unwrap, and select channel 2, after that, using a new material slot, apply the lightmap, in the lightmap slot to the object in question.
Easy is the path to wisdom for those not blinded by themselves.