Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Faked "Lightmap" Creation in 3D Studio Max - A Tutorial  () 2 Votes
Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182658] Sun, 18 December 2005 22:10 Go to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
Since Reborn refuses to show how simple their technique was, even though it was blatently obvious (Texture baking in Max, press the zero key and you're almost at their skill level!), I've decided to make this tutorial so that everyone can use lightmaps in their creations if you feel it's worth the ridiculous amount of time necessary to do so.

You're going to need 3D Studio Max, any version that natively supports texture baking via the zero key will suffice. You will also need the BFF Export plugin. You can find the BFF Export plugin at FileFront's download service:

http://www.filefront.com/?filepath=/renalert/BFFExporter.zip

Okay, now that you have the necessary files (ignore the MultiUnwrap plugin), now you need to know how to install them! Drag and drop the BFF script into your Max viewport. Once you've done that, select the Customize menu and select the Customize UI option. Click the Menu tab and select the "Bobo_s Tools" category. Click the plus sign next to the File menu to open it, and drag the "BFF_Exporter" item below the Export item. You're all done setting up your scripts, congratulations!

This step can be slightly tricky, so if you need help please feel free to e-mail me at aircraftkiller@cncgames.com if you have any questions.

Now to start helping you set up the faked lightmaps:

Load your Max file. For example, if you're making a building interior with lightmapping applied, be sure to load said building interior so you can begin work with it. Make sure your scene's geometry is complete. Set up all your lights the way you want them to look in-game, and make sure you've got a Shadow Map applied for your lights, or Ray Traced Shadows. Either will produce great results for the purpose we're using them for. Once all your lights are set up, select your main piece of geometry (For reason's sake, the largest piece so it's easier to work with) and attach all the scene's geometry to it. Before you do that, though, be absolutely sure to save your work before doing the attachment so you don't have to worry about having a single instanced piece of geometry if you wanted to have separate smaller pieces to work with. Add the Unwrap UVW modifier and set it to UV channel 3.

Select the Mapping menu after you've brought up the UV vertex editing menu. Select the Flatten Mapping option and leave the settings at default, press enter to allow Max to chug away for however long it will take. On a 2.8 GHz machine, my Refinery interior (About 4,000 polygons) takes about two seconds to finish. A slight delay is to be expected with any complicated scene, so heads up if you have a slower system.

After you've run that, select the Tools menu and select the Pack UVs option. Change the packing type to Recursive, change the spacing to 0.01, and check all the options beneath the spacing spinner. Allow Max to restructure your UV coordinates to optimize map space (Since this is really pointless to do yourself unless you're the masochistic type) and then convert everything to an editable poly object or an editable mesh object. Either one is irrelevant, just make sure not to convert it to an editable patch object.

Once you've done that, keep the object selected and press zero on your keyboard's number strip. When the Render to Texture (Texture bake menu) opens, make sure to tell Max the UV coordinate your lightmaps are working off. Generally the number would be 2 or 3, depending on which you used earlier. You tell Max how to bake the scene's radiosity into a texture by selecting the Use Existing Channel option and setting it accordingly. On the output menu, click the Add button and add the LightingMap option. Set the texture size at whatever you feel appropriate. 256 to 512 is more than enough for a building. 1024 is pushing it in any case.

Next to where your new lightmap's filename is, a button with three periods inside needs to be clicked to set up your export path for the lightmap. Set it to some easy to find location, since the default Max location is C:\YourMaxPath\Images.

Select the Render option and let Max chug away. Once you've done that, select File > BFF_Exporter and uncheck everything but Geometry, Materials, and Progress Report. Export this file to your workspace folder and close Max, or do whatever you want with it at that point. Load RenX; the output will be a *.ms file. This MaxScript file can be read in gMax by using the MaxScript > Run Script menu option. This saves your extra texture channel, allowing the lightmaps to exist in the engine without having to remap everything in gMax to your lightmap's UV coordinates (Again, unless you're the masochistic type, this really isn't recommended.).

Set up your textures in RenX as usual, but this time go to the Vertex Material tab. Set the detail texture's UV channel to whatever your lightmap channel is. On the Shader tab, set the Detail Color to Scale. On the Textures tab, set your Stage 1 (Detail Texture) to the lightmap's filename. The Pass Hint should be set at Emissive Lightmap so the engine code knows exactly why it's there, in case anyone decides to do a WDump analysis of your soon to be W3D file. Export to W3D and check our your newly lightmapped building!

There's more work than this once you get it into LevelEdit, but I'll let you figure that out on your own. I hope this helps everyone since Reborn seems to think that they're slick with an obvious texture baking technique.

[Updated on: Sun, 18 December 2005 22:17]

Report message to a moderator

Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182666 is a reply to message #182658] Mon, 19 December 2005 00:45 Go to previous messageGo to next message
Goztow is currently offline  Goztow
Messages: 9737
Registered: March 2005
Location: Belgium
Karma: 13
General (5 Stars)
Goztoe
It's not nice to be jealous, ACK... Even if it's not hard to do, it still needs to be done.

You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182669 is a reply to message #182658] Mon, 19 December 2005 00:57 Go to previous messageGo to next message
Chronojam is currently offline  Chronojam
Messages: 688
Registered: March 2003
Karma: 0
Colonel
It *needs* to be done? Why hasn't anybody bothered or really cared publicly since just about 3 years ago then?

And this is that attitude that's going to basically require us to do it now. Everybody now thinks it "Needs" to be done, so we're going to need to go ahead and do it now. Renardin says we're stupid and lazy if we don't now too; we'll ignore that a few seconds later he said it's sad that we had to "copy", ya know? What the hell do people want: us to do it, or us to not do it? There's no jealousy here, just serving the fans.
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182674 is a reply to message #182658] Mon, 19 December 2005 05:38 Go to previous messageGo to next message
Goztow is currently offline  Goztow
Messages: 9737
Registered: March 2005
Location: Belgium
Karma: 13
General (5 Stars)
Goztoe
Ah come on, read between the lines, man...

I don't say YOU need to do it, i say even if it isn't all that difficult, they still are doing it and therefor can get credit for it.


You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182675 is a reply to message #182658] Mon, 19 December 2005 05:55 Go to previous messageGo to next message
Daze is currently offline  Daze
Messages: 45
Registered: February 2005
Karma: 0
Recruit
Whether or not it's a pretty obvious and/or simple technique (that takes a while nevertheless), the point is it makes Reborn's stuff look good.

Besides Aircraftkiller, wasn't it you who went and traded something like 4 (around that range) unreleased Renegade models or something, in exchange for a modified Dazzle.ini, which involved copying and pasting a bit of code here and there, in order to make some goofy looking blood spatters and vehicle lights show up in Renegade?

For simply moving some code around in a small ini file, making lights work and stuff is pretty good anyways though. Shows how some small simple stuff can still make for some pretty bloody cool results.
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182682 is a reply to message #182658] Mon, 19 December 2005 07:06 Go to previous messageGo to next message
Fabian is currently offline  Fabian
Messages: 821
Registered: April 2003
Location: Boston, MA
Karma: 0
Colonel
If it were really that simple and obvious, the process wouldn't take you that long to describe.
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182686 is a reply to message #182658] Mon, 19 December 2005 07:51 Go to previous messageGo to next message
Titan1x77 is currently offline  Titan1x77
Messages: 1086
Registered: February 2003
Karma: 0
General (1 Star)
First of all there isn't much left to do in LE. Secondly there is quite a few steps you mentioned that isn't necessary.

Seeing you never helped me out I'll let you figure it out on your own.

Reborn will be releasing a proper tutorial shortly after the release of the mod.


"But if the gameplay sucks, the looks don't matter at all." - Sir Phoenixx

Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182687 is a reply to message #182658] Mon, 19 December 2005 08:09 Go to previous messageGo to next message
sloth4urluv is currently offline  sloth4urluv
Messages: 29
Registered: May 2005
Karma: 0
Recruit
ACK I suggest you spend your time more wisely and work on your own mod instead of wasting your time trying to bash our mod. When are you gonna realize that this is not a competition.
Besides leeching information from one of our exmembers im sure you knew I used texture baking which isnt a big secret Big Grin
The process involves more than youve dumbed it down to. Of course you could merge all your objects together into a single mesh and then unwrap, but then you have to break that merged mesh back into its original pieces and if you used a good amount of textures on your model that becomes a pain in the ass.

And what if you already have your building fully textured and rigged in gmax? Are you giong to export to max, merge, unwrap, bake texture, break into original pieces, export to gmax, and fully retexture again?


http://my.fit.edu/~rhines/Notserious/graphics/user_sloth4urluv.jpg
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182689 is a reply to message #182658] Mon, 19 December 2005 08:44 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
Oh, but you made it out to be a "big secret" since you and Retardin claimed it wasn't texture baking. I've never really seen a bunch of pathological liars like members of the Reborn team. You claimed it was a secret technique that didn't involve texture baking, now once you're exp0sed; you claim that it was what I said it was all along.

No, you don't have to break anything up. If you idiots knew much of anything about the W3D engine this would be obvious. A building interior can be comprised of a single object and it's completely able to run well in the game, with or without visibility rendering.

Quote:

And what if you already have your building fully textured and rigged in gmax? Are you giong to export to max, merge, unwrap, bake texture, break into original pieces, export to gmax, and fully retexture again?


Not really, since Silent Kane's Max to W3D exporter circumvents that. Smile

[Updated on: Mon, 19 December 2005 08:45]

Report message to a moderator

Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182692 is a reply to message #182689] Mon, 19 December 2005 09:03 Go to previous messageGo to next message
sloth4urluv is currently offline  sloth4urluv
Messages: 29
Registered: May 2005
Karma: 0
Recruit
Never once said it wasnt texture baking, might have said it wasnt just texture baking.

And if you have such great love for the community and dont keep stuff from the community like reborn then you should have no problem sharing silent kanes max plugin with everyone. Tell Me


http://my.fit.edu/~rhines/Notserious/graphics/user_sloth4urluv.jpg
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182693 is a reply to message #182658] Mon, 19 December 2005 09:06 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
I'd rather not; Reborn members really don't have the faculties to use it.
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182695 is a reply to message #182658] Mon, 19 December 2005 09:51 Go to previous messageGo to next message
Sir Kane
Messages: 1701
Registered: March 2003
Location: Angerville
Karma: 0
General (1 Star)
http://www.n00bstories.com/image.fetch.php?id=1075392561
http://www.n00bstories.com/image.fetch.php?id=1044175092
http://www.n00bstories.com/image.fetch.php?id=1272360678
Sidenote: I was too lazy to make it hide/show pass options based on the current passcount.


Proud N9500 and proud N6270 user. Creator of the IEE libraries (original bhs.dll) and the RB series software.
http://n00bstories.com/image.fetch.php?id=1189992501http://www.n00bstories.com/image.fetch.php?id=1257492907
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182699 is a reply to message #182695] Mon, 19 December 2005 10:42 Go to previous messageGo to next message
sloth4urluv is currently offline  sloth4urluv
Messages: 29
Registered: May 2005
Karma: 0
Recruit
Thats cool, never doubted that you didnt have it, just that you would never give it out Big Grin

http://my.fit.edu/~rhines/Notserious/graphics/user_sloth4urluv.jpg
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182725 is a reply to message #182692] Mon, 19 December 2005 13:29 Go to previous messageGo to next message
Renx is currently offline  Renx
Messages: 2321
Registered: April 2003
Location: Canada
Karma: 0
General (2 Stars)
Category Moderator
sloth4urluv wrote on Mon, 19 December 2005 12:03

And if you have such great love for the community and dont keep stuff from the community like reborn then you should have no problem sharing silent kanes max plugin with everyone. Tell Me


I believe that's up to SK, not Ack...


~Canucck

http://www.sloganizer.net/en/style7,Espion.png

Blazer

...RG made me ugly
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182739 is a reply to message #182658] Mon, 19 December 2005 16:04 Go to previous messageGo to next message
SuperFlyingEngi is currently offline  SuperFlyingEngi
Messages: 1756
Registered: November 2003
Karma: 0
General (1 Star)
So ACK, if this is such an obvious technique why didn't you use it for RenAlert?

"To announce that there must be no criticism of the President, or that we are to stand by the President, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt (1918)

"The danger to political dissent is acute where the Government attempts to act under so vague a concept as the power to protect "domestic security." Given the difficulty of defining the domestic security interest, the danger of abuse in acting to protect that interest becomes apparent. --U.S. Supreme Court decision (407 U.S. 297 (1972)

The Liberal Media At Work
An objective look at media partisanship
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182755 is a reply to message #182658] Mon, 19 December 2005 17:08 Go to previous messageGo to next message
rm5248 is currently offline  rm5248
Messages: 1156
Registered: November 2003
Location: USA
Karma: 0
General (1 Star)
omg ack dats liek such a gud tutorial i will uz it 4 reborn

w00t?
Re: Faked "Lightmap" Creation in 3D Studio Max - A Tutorial [message #182776 is a reply to message #182658] Mon, 19 December 2005 18:59 Go to previous message
YSLMuffins is currently offline  YSLMuffins
Messages: 1144
Registered: February 2003
Location: Moved a long time ago (it...
Karma: 0
General (1 Star)
Moderator - Mod Forum
This is a great tutorial, but I do not wish to see the inevitable arguing that may ensue. I'll bump this in a few days, maybe.

-YSLMuffins
The goddess of all (bread products)
See me online as yslcheeze
Previous Topic: SSAOW Version 1.4
Next Topic: Custom Building - MCT invisible ingame?
Goto Forum:
  


Current Time: Fri Nov 15 18:44:42 MST 2024

Total time taken to generate the page: 0.00998 seconds