Update Light baking (a head start on texturing) tutorial

I’m not sure if this will work, but i think it will.

The purpose:

  1. Using actual lighting in the game is expensive
  2. I hate setting up all the different grandients of light on my model. (I mean I’ve built the model so is there an easy way for blender to get me started.)
  3. For me, this should make texturing a game character much simpler and quicker.

The what.
What i’m suggesting is something I’ve seen else where but is likely very common, baking lighting to a UV map.

Step one. Make your model
…You can find tutorials all over the web on this topic.

Step two Make your uv map.
http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics - this will get you started

Step three Create smoothing groups
http://blenderartists.org/forum/showthread.php?t=61087&highlight=smoothing+groups

Step four Setup your lighting

Step five Bake to UV map
http://www.alienhelpdesk.com/index.php?id=22 - where you can get a baknig script along with information on using it
http://blenderartists.org/forum/showthread.php?t=57239 has infomation on baking normal maps
http://www.lowpolycoop.com/forum/viewtopic.php?t=21&sid=93ddb0931a972f2ea1e27b85f532ee92 - global light baking info

Step six Remove smoothing groups
edit mode, A, W, remove doubles then A, W, Set Solid

Step seven Edit the texture map.

I’m not sure if vertcolor make can be baked into a texture map but if it can’t then braybaker could be used.
I may flesh out the details and make this a tutorial later.

A short tut

  1. Got a model …
    https://mywebspace.wisc.edu/jgphillips/web/tut/model.JPG.
    check

  2. unwrap
    Follow the above links to see how to do these steps,
    Mark your seams. I try to hide them to an extent. Inside of the leg Inside of the arm in the glove in shirt sleeve. Were ever I can.
    https://mywebspace.wisc.edu/jgphillips/web/tut/seams.JPG

unwrap the model. Most of this is lscm unwrap…mostly
https://mywebspace.wisc.edu/jgphillips/web/tut/unwrap4.JPG

  1. smoothing
    Here is what the legs of the model will look like if you select all the faces (A) and set smooth (W,Set Smooth)
    https://mywebspace.wisc.edu/jgphillips/web/tut/badsmooth.JPG
    You can see the lip of the stockings look like crap. Here I switch over to edge select and shear the edges selected (V). Here the edges are selected
    https://mywebspace.wisc.edu/jgphillips/web/tut/preshear%20edge.JPG

Hit V to shear
https://mywebspace.wisc.edu/jgphillips/web/tut/shear%20edge.JPG
Above i’m just showing how they separted, but don’t move the vertices we just want to separate them. After shearing an edge, just right clck to leave the verts in place. Above I sheared the inner loop then I sheared the outter loop. With both sheared I set the area smooth again.
https://mywebspace.wisc.edu/jgphillips/web/tut/goodsmooth.JPG

Now you can see the stockings much clearer. Here is another area that needed smoothing
https://mywebspace.wisc.edu/jgphillips/web/tut/needsmooth.JPG

The entire model with smoothing. I applied smoothing to the shoes, sleeve, inside of sleeve, inside of the gloves, and around the front of the hood
https://mywebspace.wisc.edu/jgphillips/web/tut/finsmooth.JPG

  1. Light setup
    I’m no pro when it comes to setting up light sources so here is a quick and dirty light scheme. I have four lamps, one in front one to the rear and two half power out from each shoulder and one sun lamp.
    https://mywebspace.wisc.edu/jgphillips/web/tut/lightsup.JPG

Here is a quick render so I’ll know what I should expect.
https://mywebspace.wisc.edu/jgphillips/web/tut/lit.jpg

  1. Uv baking

Go to the alien helpdesk website mentioned above. There you will get all you need to install BrayBaker. Now to use BRB the first thing you’re going to want to do is change the world color. BRB isn’t perfect so having a neutral color will make it easier to remove mistakes later on.

Here is a quick snap shot of the options you will want to use, but don’t pay attention to the tile sizes in the image. They will be specific to your project
.https://mywebspace.wisc.edu/jgphillips/web/tut/brayoptions.JPG
We want to map “to uv coord” that we created. If it says no uvcoordnites make sure you select texface in the material tab. The image: must be set to what you want your final image to be. 256,512,1024. The max tile size needs to be set high enough to be able to handle the largest face on the uv map. In my case the face with the longest edge is one of the polies on the leg. If I took that edge length and made a guessed as to the percentage of the uv map that the length squared would take up, that would be the max tile size need. So if the longest edge out of all my polys was about 1/4 the length of my uvmap and my map was a 1024. 1024/4=256. I would want the tile max to be about 270. Just to have a margine of error. The minimum is not as important. It will influence the amount of time spent rendering all the faces and possilby may reduce the number of artifacts created using BRB.

Save before you run BRB. Now watch as BRB makes one render for each face on the mesh. The size of the render will be within the Tile max and Tile minimum. Then each image will be chopped up and placed onto our uvmap.

like this.
https://mywebspace.wisc.edu/jgphillips/web/tut/result.JPG

as you can see there are a number of mistakes that we’ll need to fixed when editting. I used grey for the world color which resultied in grey errors. If I had used the default blue, the lines down the middle would have been blue. The line down the middle are most likely the result of having a mirror modifer on while running the program. Though it would have created errors all the same.

Step 5.
Now you can remove all of the extra vertices. Go to edit mode select all verts (A) hit W, and remove doubles.

Step 6.
Last step is to clean up the mistakes and make your texture

note this could be used for a lot more than what is shown here Similar to lights, materials could also be baked in.

Have you ever looked at the recent cvs versions. It has render baking built in. You just have to unwrap your objects and then hit render, and go to the option for render baking.

I think the one advantage that braybaker has over the new render baker is it can map hi poly onto low poly. Atleast that is what i’ve read. I haven’t played around with it enough to know if thats the case. Doing a hi-poly to a low-poly would mean more work on setting up creases in a subsurf model but then the light gradients wouldn’t need to be smoothed out.

Should have already done that. What’s the point of posting if it’s not complete?

You could have multires meshes, you could bake it with the hi poly object and then go down to the lower res version, and it would maybe keep the baking. I’ll try it out.

I tested it out, and it seems if you have a multires mesh, and you render bake it you can go to the lower res version, and then apply that same image to the low poly one. It keeps the UV’s correctly also. I’m guessing the same would work with the normals.

Social, it offers a work flow regardless of pretty pictures and hand holding, and like I said it was just an idea. If it works I’ll create a tut. If someone has tried it and it doesn’t someone would be able to save me some time. I have a model sitting around so it should only take a day or two to create a tut. But with or without a tut it was mainly to inspire ideas on how to go about creating a character in different ways.

Blendermf, now to debate using a cvs version to make it or not. The cvs i’m willing to bet is much more user friendly than braybaker, but cvs are changing all the time.

I know, you would probably want to wait until the official 2.43 version comes out

Can somebody explain to me what “light baking” is?

In this case, I’m siimply going to setup a couple lights like I would if i was creating a scene for rendering. Then I’ll use one of the baking programs to run the rendering program and take pictures of each face from the render. The mini-pictures are then recombined and placed in a single picture using the uvmap layout.

So the bake program setups up the render and places a camera a certain distance from a face. And renders once for each face. It saves the render for each face and places them all together using the uvmap layout that you create… Essential creating a flatten image of the model with the shadows that the light setup created.

It’s already there… Radiosity…

radiostiy adds a ton of geometry to your model so if you think adding light isn’t something that you want to do. Then surely you don’t want radiosity.

blendermf

how do you get it to bake using the recent CVS? I know they are making it so you can bake normal info too… so using the sculpt mode you could bake the displacement to a normal map… and map it to the lower level mesh… put on the normal map… like in Z-brush… this would be an awesome modeling tool being able to paint/sculpt custom detail into normal maps…

and on the topic of using CVS’s you might as well use it if it has new modeling tools… but use a proper build if you want to make a fully functioning game… inother words use both as your needs arise…

solution to my problem
doh! just found renderbaking on the would you beleive it… on the render menu

Yea, but as I am sure many of us already know, the subdivisions made by radiosity make it a no-no for anything larger than a single room.

However, I don’t think the braybaker script is a solution either. Afaik, it’s just taking all the data and turning it into one giant UV texture (or collection of UV textures), so if you go for any semi decent resolution, it would just eat up texture memory.

Saving memory by having seamless texture pieces replicate (as is custom in games) could not be implemented, because every single UV segment would have to be a different texture in it’s own right.

What we need here is a good way to make light/shadow maps, that can be placed on a second texture channel, pulled over the first channel on which you could apply any texture you choose, and still have the ability to save memory by seamless replication, because the lightmap and texture itself would be two seperate channels.

Social they are working on multiple UV channels/sets for the next version of blender (finaly!)… so it will be possilble then to have your lowres non-tiling light map over a tiling texture plus a tiling normal map… or just having 2 textures blended with a third image… and all of them using there own unique UV’s

…thing is tho you can only use 4 maps at time in a material… older video cards only support 2 maps… not much we can do until then tho :frowning:

the next CVS is going to have the multiple UV’s and multiple vertex shading layers… ie you can paint diff colours on diff layers… so vertices can have more than just one colour… blender is going professional!

Right now (in 2.42a) you can have up to three texture channels, but they all use the same UV coordinates. It’d be nice if they could have individual coordinates in the next build, but we’ll see.

Hey if anyone knows of a better light setup (shouldn’t be tough) or way of using BRB to minimize artifacts toss em up. Or alternatives to BRB.

Dim

> Right now (in 2.42a) you can have up to three texture channels, but they all use the same UV coordinates. It'd be nice if they could have individual coordinates in the next build, but we'll see.

yes they are planning multiple UV channels (not to be confused with texture channels… you should be able to use 4 textures right now, I think now seeing as that’s how many most video cards support…) this means having diff UV co-ordinates for each channel… like I said in my post… they are busy working on it now…

go here to check out the recent builds etc…

Oh excelent, now I’m exited, this’ll make a lot of stuff easier. Thanks Kirado.