Home Technical Talk

Texture baking basics

I'd like some advice on baking textures for low polygon assets for use in a software engine with no realtime lighting. So essentially, not baking a normal map or lightmap for use with a realtime lighting engine, but completely baking the lighting into the texture, as realtime lighting/shaders simply aren't an option with my software engine.

I'm using Max by the way.

I've been playing around with render to texture. Making an omni light, clicking render to texture, complete map etc, then render. The results are aren't very good, nothing that couldn't be done in pshop with ease, so what is the proper workflow for baking textures?

Especially softening edges on low poly models. Would it be necessary to make a high poly version of my super low poly model, normal map it, and use that for the lighting model to soften edges etc?

I was going to develop some basic ambient occlusion for environments, in engine but not realtime, then re encode all the textures on a finished level. But that was when I planned to make my own level editor, and it would be a lot of work.

Now that I'll be using Max as a level editor, I'd much rather do everything in max, and get on with making games.

Essentially what I'm looking to do is apply some lighting to very low poly models (2 or 3 hundred polys) with the purpose of adding some extra depth and texture, but also making them look less low poly, by eliminating hard edges. And also for environments, particularly interiors I guess, to add a bit of depth and atmosphere.

Cheers,
RumbleSushi

Replies

  • MegaMoogle
    Offline / Send Message
    MegaMoogle polycounter lvl 9
    Hi RumbleSushi,

    It seems to me you've tried most of the things that I know how to do. I recommend as you said, making a high poly version of your low poly models and projecting both normal and ambient occlusion textures using the render to texture option in max. If you want more dynamic lighting rather than basic shadows, I'd recommend a complete or light map, but it sounds like you've already tried those tactics. :/ In my opinion your best bet is projecting off of a high poly model. Good luck to you, and hopefully this helps even slightly.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    I would say, look at some late ps1 titles like RidgeRacer type 4 aka R4. No bakes, but some clever lowpoly shading on the textures.
  • rumblesushi
    Hey Mega, thanks for the reply. The thing is, even though I have a decent idea of WHAT needs to be done, I'm not sure how to go about it in Max ;)

    I've been studying modelling for about 5 solid days, and the basic render to texture I tried, was something I picked up from an Autodesk PDF tutorial, that just did some basic lighting, with a complete map on a low poly model.

    Lighting is something I haven't really experimented with code wise (well, very basic lighting using the polygon's normal for flat shaded lighting, but nothing more advanced than that) - so that's partly why I don't have an idea of how to go about it in Max, and what would be the best option to soften edges of low poly stuff etc, to make them appear less low poly ;)

    The bit that I haven't experimented with, but seems like it might be the best option, is projecting off a high poly model.

    How would I go about that? Literally just make a high poly version, bake the lighting from that, and use it on my low poly model or?

    Cheers,
    RumbleSushi
  • rumblesushi
    pior wrote: »
    I would say, look at some late ps1 titles like RidgeRacer type 4 aka R4. No bakes, but some clever lowpoly shading on the textures.

    So any lighting in the PSOne era would have been just hand painted lighting essentially?

    I thought of that actually, but then I thought, despite my low fi engine, I could take advantage of more current techniques, that could possibly be both faster and more convincing than shading a UV map by hand.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    I would think, a whole lot of vertex coloring too. MGS1 is another striking example. But it really depends on the visual style you want to go for ....
  • rumblesushi
    To give you guys a couple of examples...

    This car was using an omni light and complete map, rendered to texture. The lighting effects were actually a bit harsh, so I overlayed them on the original and reduced the opacity, to tone them down.

    ae86_screens.jpg

    Obviously this basic shading is something I could have done in photoshop in 30 seconds, I would have wanted to get the edges looking softer.

    I tried baking the texture of this snowmobile, but it actually looked awful, unpredictable and harsh, probably my inexperience of setting up the lighting in max or something about how I was doing render to texture.

    So this is just manually shaded in photoshop, which is actually quite tricky on a UV map with lots of islands.

    snowmobile_screens.jpg
  • rumblesushi
    pior wrote: »
    I would think, a whole lot of vertex coloring too. MGS1 is another striking example. But it really depends on the visual style you want to go for ....

    I'm an arcade man, so most of my games are going to be fairly bright and arcadey. But I would also like to create some realistic-ish looking games, well as realistic as you're going to get with such a low polygon budget, maybe something like Goldeneye with higher res textures ;)

    I was thinking about doing a horror game for example, luckily by nature most interiors are incredibly low poly, apart from the assets that actually fill a room and the enemies etc.

    And with a texture budget significantly bigger than the tiny textures used by the DS or N64, I'd quite like to create a fairly convincing horror game, like a haunted house with good, atmospheric lighting.
  • waedoe
    Offline / Send Message
    waedoe polycounter lvl 8
    dodge and burn are you friends for high lighting also add some texture to those surfaces, i know they are low res, but you can always start big and shrink and see what happens.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    The problem is that when you go portable-low like that, UV and texturing is a whole different game. It's not really a matter of increasing the resolution, but more about stretching gradients over certain surfaces, where to put the appropriate pixel detail, and so on ...
    It really is an aesthetic of its own. But yeah most likely, bakes won't get you very far. Check the low poly thread!

    On the very other end of the spectrum, you got games like Metal Gear iphone, where everything is photoreal but baked to billboard planes.

    Two approaches :

    Rooster (thought out and crafted especially for mobile lowpoly)
    http://www.redprodukt.com/sc/manwire.jpg

    TGZ (more like a scaled down but regular asset)
    http://tgz3d.com/images/128punk.jpg

    Makoa, same thing but with bolder color choices and less noise :
    http://i12.photobucket.com/albums/a241/kendobi/venomLayout.gif

    You might also be interested in this :
    http://boards.polycount.net/showthread.php?t=44773

    Basically you could very well create some sort of texture atlas that every asset draws from. This, plus vertex lighting, would give fantastic, consistent results.
  • MegaMoogle
    Offline / Send Message
    MegaMoogle polycounter lvl 9
    Ok, projecting off of a high poly model isn't too difficult. Once you finish modeling your high poly model you would place it directly over your low poly. Make sure that they're as close as possible in size. If you press the 0 key, it's the shortcut to bring up render to texture menu. With your lowpoly model selected, bring up render to texture, and click on enable projection mapping.

    step1w.jpg

    Select the high poly model.

    step2cn.jpg

    Select the type of map you want to render to texture (for ambient occlusion your renderer should be set to mental ray)

    step3r.jpg

    And click on the size you want your map to be.

    step4b.jpg

    Before rendering be sure to adjust the cage on your model to make sure that the absolute best quality texture can be gathered, and also make sure to click the ellipses (...) next to File Name and Type in the Render to Texture window to save off the texture somewhere. For best results with adjusting the cage, you will see in the modifier stack of the low poly model is something called "projection" expand it and with cage selected, scroll down the modifier panel, expand cage again and you will see a check box for "shaded". This will show you where parts of the mesh are sticking through the cage.
  • rumblesushi
    Mega, thanks a lot for that walkthrough, I appreciate it. I'll give it a try ;)

    Pior - I actually read through that entire low poly thread, every page ;) I particularly like the work from Tennis and Sama Van.

    I kind of assumed that most of the shading was hand painted actually.

    Even though I'll be hand painting most textures, I thought baking them could save me significant time, especially seeing as my pro experience in graphic art is very different (detailed vector illustrations etc for print).

    Also, part of the reason for my enquiry is interiors, as opposed to characters.

    Although as I said, most of my games are going to be fairly arcadey, and sort of hyper real (Daytona / RR esque), I'd also like to create a FPS and a horror game, with more realistic textures.

    I saw this wall by glynnsmith, I like the textures and lighting, and because interiors like this can be incredibly low poly, it is something I could conceivably do in my engine.

    How would you go about doing lighting like this?

    sc_walls02.jpg
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Ha! I see what you mean now. So, that sort of lightning can usually be baked fairly easily with max and maya. Most of the time you will get the option to either render this to texture, or to vertices. I never actually did it in Max but in Maya look for batch bake > MentalRay, there is tons of things you can do, even combining renders one after the other (say, one pass AO then one pass directional light, combined additively, exclusively, and so on)

    Vertex-based is interesting, because you can add cuts in the geo so that castshadows become very sharp and accurate where you want them (like around a pillar...). There are some walkthroughs around the internet. Your engine would kick ass if it supported vertex lighting.

    An engine like UDK does it internally in the editor, applying the lighting to au-unwrapped lightmaps.

    Something else you can do very easily, is to fake lighting with the use of 'gradient planes' and creative UV mapping. It's very hacky but gives fantastic results - if you have basic transparency. I Did all the shadows in this corridor with this technique as you can tell in the top-down shot, even the subtle 'AO' around the top of the pillars :
    http://www.pioroberson.com/modelpages/pior_snake_bunker_001.png

    I think the biggest challenge you will face is consistency. Daytonay USA style suggest very low unfiltered textures on super simple models ... but it seems like your engine could achieve much more? Then maybe you could give a very close look to MGS2 on ps2. This game is aaaaaaall about the clever, clean light hacks and it looks gorgeous and sharp.
  • rumblesushi
    pior, nice corridor ;) Looks very good actually, especially for something hacky, like a fake bloom/dof.

    I checked out your site too, great artwork mon ami.

    Something else I'll have to get used to is digital "painting" using brushes in pshop. I have a background in graphic art, but it's digital drawing, rather than digital painting.

    For instance these examples were done with the pen tool in AI.

    http://rumblesushi.com/illus/boy.jpg

    http://rumblesushi.com/illus/fruit03.jpg

    Which is very different from a more painterly approach in ps.

    It's excellent that you hold my engine in that much esteem ;) It's the fastest Flash 3D engine in the world, as far as I know, but to be honest it's still very limited.

    For several reasons.

    First, it's not a scanline renderer. I don't have pixel level control, making any kind of lighting etc very tricky, as well as using a depth buffer. The rendering is done per polygon rather than per pixel. Also it's 100% software, no GPU obviously, as it's Flash. And as fast as AS3 is, for the browser, it's still around 20 times slower than native C++.

    I have explored using real time vertex lighting (gouraud shading), and the performance hit is insane, it cripples the poly count.

    Why? The only way to do it is to render twice the amount of polygons and blend them. First, your normal textured poly, then another polygon on top, using a gradient fill from the lighting data - with a blend mode between the 2. So you've got twice the poly count to start with, then the VERY cpu intensive routine of realtime blending per pixel.

    So unfortunately realtime lighting isn't possible, I'll have to go one of 2 routes, either bake everything - for example glynnsmith's room baked, even if the lighting wasn't realtime, would still look pretty damn good IMO, especially for a browser game.

    The second route would be yours, which is an option too, using a series of flat shaded planes with the alpha set to 50 or 60 etc. I haven't tested this yet, but I could do, and see how the performance is.

    You asked about transparency, the engine does support transparency actually, either from using PNG's as the texture, or flat shaded polygons with an alpha setting.

    Couple more things pior - first, do you do any low poly work?

    Also, my engine does have a couple of advantages over older technology with similar polygon pushing power. Mainly texture resolution and RAM. Download speed is an issue, but I could conceivably have models with 1024 textures, as long as they were compressed a fair bit, and the loading was staggered.

    Also, I've worked very hard on fast transformations and culling, so as long as the poly counts are really low, I can have a shit load of objects at a high framerate, as evidenced by some of my demos.

    Regarding MGS2, I'd have to simplify the geometry a lot, but there's no reason why I couldn't have something looking at least as sharp as that, with baked textures etc. What kind of light hacks does MGS2 use? The PS2 doesn't support normal mapping does it? Which is strange, as the Dreamcast did I think ;)
Sign In or Register to comment.