Download the Lightwave scene from Part IV here. (ZIP 2.6 Mb)
So you've got your color vertex mapped highly tesselated but looking good model in Layout, and you want to make this into a lower poly object where the vertex map is discarded and textures are used instead. This will benefit the following areas:
- Real time application such as Shockwave3D and VRML, much lower poly count
- Editability of the solution, since image maps are much more editable than vertex color maps
- Editability of the mesh, since there are no more excessive polygons
- Organisation, easier to manage materials with image maps
This cannot be done with Surface Baker.
What you do is take the original model that we first had in Lightwave before exporting it to Lightscape. We need to UV map this model properly. Open it in modeler and select the surfaces that you want to have one single texture. Some common sense is usefull here. If you are unfamiliar with UV mapping, there are excellent tutrials out there, but its really quite straightforward. Select the polygons you want to UV map, Make New Map, choose Atlas as a projection method. I always use a huge gap in between the polygons. This will really help later on when 'expanding' the UV map. Also, only create the maps based on surface selection. DO NOT select directly. That will give you lots of trouble later on. so use the polygon statistics panel (w) to select the surfaces per map.
Take notice that every UV mapped polygon that does not directly neighbour an attached polygon can produce nasty black lines when used in VRML for instance (not when rendering in LW). Therefore do not unweld before making the map, but only after making it, so the polygons stay together. Then perhaps organise the map a bit to increase efficiency.
Do this for every set of polygons you feel is handy to have one map. Keep in mind smaller textures are slightly more fficient than larger ones, so prefer 10 2048x2048 textures over 4 4096x4096 for instance. For the test model I think I used 5... ceiling, walls, wooden floor, other floors, chairs and windowframes, stairs.
Oh yes, Microwave doesnt support poly's with more than 4 points, so using the statistics window (w) select all poly's having more than 4 points and triple them. Perhaps use MergeTrigonsX to get them back to quads. Also, make sure there are no 2 point poly's, no crooked geometry and all. so do a unify polygons and delete alone vertices and so forth. Make sure your UV maps are correct and there are no intersecting lines on them (if you have, you need to unweld them poly's in the Uv map).
Once the object is mapped (never mind the material settings, they are irrelevant), save the object as something new, like SimpleHouse_UV.lwo or something.
Now have the scene in which the object resides which resulted from the previous tutorials. Make sure you have your direct lights such as your sun set up properly so that it matches the original position in Lightscape. It doesnt have to be exact, and frankly you can put it anywhere you want, it just sometimes won't look right... up to you. Anyway, you can also have pointlights and other lights added as well.
Also make sure all your materials are the way you want. Depending on what you're going to do with the model after it is baked you might want to considder baking reflections too for small metal objects, such as the frames of the chairs in the tutorial model. If you use it for realtime application, that is what I would do. If you use lightwave to render things, then you can keep the raytraced reflections, and baking reflections is not recommended.
Anyway, if not baking reflections, turn them off in the render options panel. Make sure Shadows are on.
Now yo have a scene which, if rendered from a camera standpoint would see exactly what the baked output will see. We will now use microwave to actually do it.
Save the scene as 'Scene_Microwave.lws' or something, and also save the main objects under a recogniseable name (SimpleHouse_fromLS_Microwave.lwo or something). Now, without closing anything, open the model you saved from modeler (SimpleHouse_UV.lwo) into layout. You will now have two objects in layout that occupy the same space. Go to the object properties of the simplified, uv mapped object and set it to 'Unseen by Rays' and 'Unseen by Camera'. Go tot he object properties of the tesselated model and set it ONLY to 'unseen by camera'.
Now go to the pixel filter plugins dialog (ctrl-F8). Select MicroWave.
As an object you choose the UV mapped object, NOT the object containing the solution! Also select the UV map you wish to bake first.
As a projection type use 'Object' and the direction should be 'To'. Then set a distance of 1 mm or something small. This number will be the tolerance in which MicroWave will allow the distance between the points of the tesselated object and the clean object to be.
Keep the 'Bake Render' option to on.
As a resolution, pick whatever you want. Soemthing like 2048x2048. Make it square of course. Use an expand that is relevant and usefull for the image map. So for 2048x2048 I would expand with 4 pixels. You can turn AA on if you want, but its not as important as in a normal render. I usually do though, as it bakes rather fast anyway. Alpha channel for these maps is useless so choose a 24 bit format like tiff24.
Now set your Image base name, that is recogniseable. Make it the name of the UV map perhaps...
If baking really large textures I would reccomend turning the 'show preview' off. Otherwise it can be fun to watch.
Then, close the microwave panel, and just press F9. You will see nothign in the render window, but the Microwave preview and/or monitor will pop up. Once it is done, the image was saved.
Do this for all the UV maps in the object untill you done them all. Save the scene and objects.
Now save the clean object as 'simplehouse_MWbaked.lwo' or something. Save the scene as 'Simplehouse_MWbakes.lws'. Remove the tesselated object from the scene (yaay), and also all lights. Set the last light to 0.
Now apply each image map that Microwave made that belongs to certain surfaces (see why you should have mapped according to surfaces?) to those surfaces, using UV projection, an dusing the UV map that you used to generate the map in the first place. It should fit perfectly. Do this for all the maps, and voila you're done.
Alternatively, you can even increase efficiency by using lightmaps in combination with the texture maps that were applied. Its roughly the same process though. Ill leave you with this for now, and let me know if you want to know abouyt the lightmaps in time, if you cant figure it out.
Good luck!
|