Jump to content

Ambient Occlusion


Recommended Posts

[COLOR=#000000]I make parts and launchers for KSP as a hobby and for my own personal use, but I noticed my parts lack the minor detailing that most modders have on their parts. I did a little research and found that in addition to just being good at making textures, they also used Ambient Occlusion. I tried it out following these steps:[/COLOR]

[COLOR=#000000]- AO bake on a white-ish material.
- Export as PNG.
- Open AO Map in Gimp/Photoshop and paste it onto a layer above the main texture.
- Set the AO layer to multiply.
- Voila?

To be honest, it does not come out all that great. Yes there are some details and what not, but I think I might not be making the AO map correctly. It doesn't look as good as I would like it to.

Are there any tutorials out there on how to make good AO maps? I am mostly interested in how to do it in Blender for KSP parts. If any modder out there wants to share their tips and tricks, that would be greatly appreciated.[/COLOR]
Link to comment
Share on other sites

Hi. Texture baking is a very powerful tool. From your post it is not so easy to tell in what way it is not coming out well (as there are several ways it can come out bad)

The first and most common way is that the ao is grainy/spotty. This is due to insufficient samples(i havent used blender in ages but the setting for that is in the baking menu i think)

The second way is that there are black splotches/hard outlines around where meshes are intersecting (in blender i believe the only way to get around this is to eather detach the intersecting objects(this is called exploding) and bake seperatly or paint out the artifacts in post)

The third way is that there are too much/not enough "shadows"(this is caused by a too high/too low distance and/or spread parameter, again i dont remember how to set this in blender but its there)

There are also other map types that are useful for texturing that are not much used here on the ksp forums. Those are materialcolor, curvature , cavity/concavity and dirt. Of those i mainly use curvature as it can be used to get procedural/semiprocedural worn edges and materialcolor for blocking out pure colors for the base layer. But i dont remember if blender has the ability to bake those.

Actually baking ao(+others) from your lowpoly to itself is the "worst" way to do it. Baking from a hipoly will give a much better result (but takes much more effort)
hope this helps
Maybe someone who uses blender will outline the process for you
Link to comment
Share on other sites

I guess my bake settings are not optimal. I can get rid of the grainyness by upping the samples, but the hard shadows(?) are still very much visible, even though none of the UVs are intersecting. I'm not happy with where the shadows/dark areas are projected on the model after AO baking. It is almost as though there are issues with the lighting, or the "world" settings. I honestly don't know what the issues is, or how to fix it, as this is my first crack at AO baking.

I'm interested in trying out the other mapping techniques you mentioned, so I'll give those a try and see what the outcome is.
Link to comment
Share on other sites

[URL]http://www.katsbits.com/tutorials/blender/baking-ambient-occlusion.php[/URL]

It would help to see your model and the textures you baked. Otherwise, the things that landeTLS said are THE common problem spots.

Just another neat trick: you usually have to set a new texture when baking: make this as huge as possible!. Then resample it in Photoshop/Gimp to your texture size. This way you increase the quality.

Also I use a layer adjustment 0 1 250 to improve the ao map. Edited by InsaneDruid
Link to comment
Share on other sites

[quote name='CobaltWolf']I just paint it in on the textures by hand haha[/QUOTE]

Yeah, that is kind of why I am wanting to try AO baking and/or other techniques. I've only got a mouse, no tablet, so handpainting shadows and other small details is a royal pain and time-consuming.

[COLOR=silver][SIZE=1]- - - Updated - - -[/SIZE][/COLOR]

[quote name='InsaneDruid']Just another neat trick: you usually have to set a new texture when baking: make this as huge as possible!. Then resample it in Photoshop/Gimp to your texture size. This way you increase the quality.[/QUOTE]

I'll give that a shot. Is 4096x4096 a bit overkill, or does it not matter when I resample it back down afterwards?
Link to comment
Share on other sites

[quote name='InsaneDruid']4096*4096 is "barely" just ok. Its 2015, not 1996. ;) Also yet it doesnt matter if you resample it. In fact, the better the original render, the better the resampled version.[/QUOTE]

Well I just re-did the process with the AO map res at 4096x4096 and the difference was leaps and bounds better. It created beautiful soft-edge shadows exactly where they needed to be, instead of the previous "microsoft paint"-hard-edge-shadows.

The only small issue I am left with is that the model is mostly supposed to be white, but the AO map makes the white areas very dark grey. I can of course fix that with layering and changing the opacity and such, but out of curiosity, are there any light settings I am missing? Is there a way to make the baking not cast shadows on the big white areas? I mean the biggest parts of the models are supposed to be white, and would most definitely get alot of light.
Link to comment
Share on other sites

If your AO map is coming out too dark the first thing to check is the material assigned to it. By default Blender's materials have an 'intensity' slider under the diffuse color that starts out at 80%. You have to up that to 100% to get white things to come out white!

Beyond that - don't accept your AO map just the way it is, feel free to edit it. I'm a photoshop guy, so someone else may be more help with specifically what to do in Gimp, but I'm certain there's a simple brightness/contrast slider somewhere you can use to adjust both the lightness of the white areas and then the depth of the shadows?
Link to comment
Share on other sites

Not sure how blender treats this but in 3dsmax the standard ao bake is based on geometry only(materials and lighting are not considered) but i sometimes use an alternative workflow in mentalray where i bake a complete map from a completly white material with 100% self illumination(so lights dont affect it) and an ambient occlusion shader in the diffuse slot. I think this would be closer to how the process works in blender
Link to comment
Share on other sites

[quote name='artwhaley']If your AO map is coming out too dark the first thing to check is the material assigned to it. By default Blender's materials have an 'intensity' slider under the diffuse color that starts out at 80%. You have to up that to 100% to get white things to come out white!

Beyond that - don't accept your AO map just the way it is, feel free to edit it. I'm a photoshop guy, so someone else may be more help with specifically what to do in Gimp, but I'm certain there's a simple brightness/contrast slider somewhere you can use to adjust both the lightness of the white areas and then the depth of the shadows?[/QUOTE]

I just tried that and it worked like a charm. Still a tiny bit grey, but that was fixable by layering the AO map over the texture, setting the mode to "Multiply" and a little bit of tweaking.

Thanks a lot guys, really appreciate the help. I'm very happy with how the textures look now.
Link to comment
Share on other sites

Yeah, I haven't set a bake up for KSP, just as fast to do it by hand ( in PS, vector masks & gradients are really quick - I think the latest PS can even shape gradient layers to non-rectangular masks? and layer effects are magical ) - but I was doing that before we had AO baking anyway :). Plus KSP's art style doesn't generally lend itself for external models at least; I haven't done an IVA but that would be an obvious place ( not least because most of the lighting is static ).

I'm also sticking by the idea that unless your surface is *really* complex, it's probably cheaper to model detail rather than use a normal map.
Link to comment
Share on other sites

Baking AO in blender -- make sure you have it set to 'Normalize' (e.g. have 'Normalize' enabled) -- this causes it to ignore any material settings/colors/lighting values, and should result in a 'neutral' AO bake -- white will be fully lit, black will be fully shaded (the default settings use the material values, where the fully-lit color might be.. dark grey).
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...