Home Technical Talk

What's happening with the AO?

a-k-m
polycounter lvl 5
Offline / Send Message
a-k-m polycounter lvl 5
Hello,

does someone know why the interior of my pot is almost black (I mean the ambient occlusion bake from 3ds max...)?

bcmtp8.jpg

topfao.jpg

And another question:
Isn't it possible to bake ambient occlusion with the default renderer? I always have to switch to mental ray. But mental ray doesn't bake the normal-maps properly... so I always need to switch back and forth...

Thx for help!

Replies

  • SsSandu_C
    Options
    Offline / Send Message
    SsSandu_C polycounter lvl 13
    You can use light tracer to bake your ambient occlusion maps. Even so mental ray does a good job for baking AO too. I think you are not baking it right. I mean why is the highpoly above it. Are you baking that way? Because that covers your object and you get shadows on it. Here is a link on how to bake with mental ray. If you want to go with light tracer then check this out.
  • Phrexeus
    Options
    Offline / Send Message
    Phrexeus polycounter lvl 6
    Just looks like yo are doing something wrong, like baking with a large object above which casts a shadow, or baking using a mesh that doesn't match the original.
  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    Check your normals, it seems that they point in the wrong direction.
  • almighty_gir
    Options
    Offline / Send Message
    almighty_gir ngon master
    this actually makes perfect sense to me...

    even in the real world, the inside of a bucket would be shadowed, the light being occluded by the bucket itself.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Shouldn't AO take into account light-bounce INSIDE the pot?

    Anyway, mind showing us your baking setup?
  • Stromberg90
    Options
    Offline / Send Message
    Stromberg90 polycounter lvl 11
    ^^
    I would think so, this ao bake would make it pretty useless if it got flipped over in a game.
    My bet would be on the highpoly pot overhead.

    AO is pretty much only contact shadows.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Ace-Angel wrote: »
    Shouldn't AO take into account light-bounce INSIDE the pot?

    Anyway, mind showing us your baking setup?

    No this happens a lot with objects like this. I will usually put an omni light inside the object with a low brightness to lighten up the inside.

    I guess upping the number of light bounces might fix this but it'll make your rendering time take a lot longer.
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    Ace-Angel wrote: »
    Shouldn't AO take into account light-bounce INSIDE the pot?

    Anyway, mind showing us your baking setup?

    "ambient occlussion" does not calculate any bounces at all, its simply a occlusion factor of the surface. It casts a bunch of rays in a dome from every point on the surface and whatever fraction is occluded is how dark the surface is.

    You can set a max distance though so rays don't travel forever (or to the other side of the bucket).
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    sprunghunt wrote: »
    No this happens a lot with objects like this. I will usually put an omni light inside the object with a low brightness to lighten up the inside.

    I guess upping the number of light bounces might fix this but it'll make your rendering time take a lot longer.

    AO totally disregards scene lights, all it does is measure distance to nearby occluders. Like Jordan said, just shorten the max distance so the rays wont get to the bucket sides.
  • Will Faucher
    Options
    Offline / Send Message
    Will Faucher polycounter lvl 12
    r_fletch_r wrote: »
    AO totally disregards scene lights, all it does is measure distance to nearby occluders. Like Jordan said, just shorten the max distance so the rays wont get to the bucket sides.

    That depends how you bake it. I almost always bake with the scanline, using a skylight. This way, I can use scene lights if I want to, and I bake out a shadowmap. I tend to like the results much, much better than the actual MR AO.
  • Mark Dygert
    Options
    Offline / Send Message
    1) it looks like mental ray is fudging up the padding, not surprising.
    2) Are you sure you're baking AO and not a diffuse map with lights and shadows turned on? That's pretty weird.
    3) Do you have any overlapping pieces in your UV layout? They should be moved outside of the 0:1 space, preferably exactly one tile to the left, right up or down.
    You can do this by using the type in coordinates box at the bottom of the UV editor.
    UnwrapUVWCoords.jpg
    Turn on #1 and in #2 type 1.0 and hit enter.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Prophecies wrote: »
    That depends how you bake it. I almost always bake with the scanline, using a skylight. This way, I can use scene lights if I want to, and I bake out a shadowmap. I tend to like the results much, much better than the actual MR AO.

    Out of interest how do you feel light tracer is better? I'm yet to find a scenario where mental ray cant do the same job with more control.
  • Mark Dygert
    Options
    Offline / Send Message
    I don't mean to answer for Prophecies, but I bounce back and forth between the two methods, or I did until they fucked up the edge padding in mental ray...

    It really boils down to what you need. If you're trying to bake in a particular lighting effect like a top down light where the object is more shaded on the bottom than on top.
    Or you want shadows cast from objects that aren't going to occlude.
    Or you might want an overall gradient that would be hard to apply to a jumble of UV pieces.
    Or you might have objects that glow on the character and you want to capture the light, then scene light work pretty well.

    If you want a pits and peaks view of the surface MentalRay AO.

    Personally I'm not a big fan of using a skylight and light tracer, I find it just as slow as MRAO, but instead I go with a standard light dome. There are a few scripts around plus you can build one and import it into whatever scene.

    Neither is better than the other (but I do have padding issues and normal background color issues with MR) when everything works like it should but that doesn't mean you'll use one or the other in every single case.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Mark, arent they more like general baking issues than AO issues?

    Baking any ray traced shaders is much faster in mental ray. If you want a light tracer style render you use Final Gather and put a low distance high spread AO map on top of it. its faster to render and just as smooth.

    *If you're trying to bake in a particular lighting effect like a top down light where the object is more shaded on the bottom than on top.
    FG is great for this, and its doesn't slow down to a crawl when you add a light bounce. (like i said AO for the fine crevices)

    *Or you want shadows cast from objects that aren't going to occlude.
    Not sure what you mean by this one

    *Or you might want an overall gradient that would be hard to apply to a jumble of UV pieces.
    I usually just apply a planar map to uv channel 2 or 3 and use that for the gradient.

    *Or you might have objects that glow on the character and you want to capture the light, then scene light work pretty well.
    FG again ;)


    Im not trying to say your wrong because I know you know your stuff, but i think you might be plesently suprised :)
  • Mark Dygert
    Options
    Offline / Send Message
    3dsmax_MentalRayPaddingIssue_AO.jpg3dsmax_MentalRayPaddingIssue_N.jpg
    The mental ray padding makes it unusable, no matter what you're baking. I'm not sure which version it started doing it 2011 or 2012 but I can't use it until they fix it. That's total garbage. Not to mention it applies the wrong background color to the normal map, even if its set correctly in RTT. Annoying but can be worked around.

    Until this padding issue popped up I was happy using mental ray for almost everything. The speed difference really doesn't bother me that much the maps I bake aren't that complex or huge and I have a micro render farm I send them off to if they do take up too much of my time.

    You can kind of see the padding issue on in the original post. Its a big map with a low padding setting, but it will still generate seams... How does anyone at Autodesk think that's acceptable "padding"?
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Ill take a look, I've always dismissed light dome because its so old.
  • Mark Dygert
    Options
    Offline / Send Message
    r_fletch_r wrote: »
    *Or you want shadows cast from objects that aren't going to occlude.
    Not sure what you mean by this one
    With some pieces mostly static environment art with very particular lighting, you might want a shadow cast from an object. It could be that its easier to bake in that shadow rather than try and do it with costly lighting effects. A good example is the shadow of a grate on a specific prop or section of wall/floor, or a chain link fence shadow, or fancy wrought iron patterns ect... Getting it too look right can be expensive in the engine so burn it in if no one will notice and it frees up some resources. Likewise if its not a hit don't waste your time, like everything else its situational

    You won't have any direct light effects or shadows with Mental Ray AO output, due to the way it's calculated so you can render MRAO all day tweaking light settings and nothing is going to change.
    r_fletch_r wrote: »
    *Or you might want an overall gradient that would be hard to apply to a jumble of UV pieces.
    I usually just apply a planar map to uv channel 2 or 3 and use that for the gradient.
    I've done that before and that works in some cases but sometimes the planar map angle doesn't treat the non-planar faces well and shows stretching. By doing the gradient with lights you mostly get around that.
    r_fletch_r wrote: »
    *Or you might have objects that glow on the character and you want to capture the light, then scene light work pretty well.
    FG again ;)
    I was mostly talking about the difference between baking in lighting and using just MentalRay AO map output from RTT. It doesn't matter which render you use to bake the lighting AO map output, won't be effected by lights in the scene.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    I've done that before and that works in some cases but sometimes the planar map angle doesn't treat the non-planar faces well and shows stretching. By doing the gradient with lights you mostly get around that.

    excellent point, I hadn't considered that.

    Im going to do some side by side speed tests, If the results are interesting ill post em.

    edit: point taken the seam issue in 2011+ is a killer.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    r_fletch_r wrote: »
    Out of interest how do you feel light tracer is better? I'm yet to find a scenario where mental ray cant do the same job with more control.

    I've found that mental ray always puts this grain across renders. The light tracer just appears smoother. You can see the grain in the OP's image. However sometimes mental ray is useful for other reasons.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Turn the number of samples up = grain gone
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    poopipe wrote: »
    Turn the number of samples up = grain gone

    true but its better to use FG if you want a super smooth render. then put a low distance ao map over the top.

    like mark said though the most recent versions of max have broken fg baking
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    Tbh, I find it a drag setting this stuff up in Max (especially if you need to exclude floaters from rendering shadows into the AO), so xnormal is my weapon of choice. And it's quick too.
  • Bruno Afonseca
    Renderhjs' textools (http://www.renderhjs.net/textools/) have buttons for quick AO baking with both mental ray and Light tracer. Not that many settings available, but it's practical for someone like me who makes tons of quick and small props.

    xNormal is quite good as well, but it doesn't support multiple UV channels...
  • cw
    Options
    Offline / Send Message
    cw polycounter lvl 17
    don't forget you can also save render presets and object presets in max, which vastly reduces the ballache of switching back and forth for normals in scanline / ao in MR.
  • retleks
    Options
    Offline / Send Message
    retleks polycounter lvl 18
    Did your issue get solved? because it honestly just looks like you have your distance set too high. Mess with these numbers:
    aodistance.jpg
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    retleks wrote: »
    Did your issue get solved? because it honestly just looks like you have your distance set too high. Mess with these numbers:
    aodistance.jpg

    spread had nothing to do with this. spread controls how wide the cone of rays is.
  • Entity
    Options
    Offline / Send Message
    Entity polycounter lvl 18
    Retleks might be right, looks like an issue with the Max Distance setting. Try reducing it and see if it solves the problem.
  • Mark Dygert
    Options
    Offline / Send Message
    cw wrote: »
    don't forget you can also save render presets and object presets in max, which vastly reduces the ballache of switching back and forth for normals in scanline / ao in MR.
    Yep. You can assign object properties to layers and then set objects to take their properties from the layer so you don't have to micro manage all of the object properties, just dump them on the right layers.

    If you have a scene set up with lights and layers you can just dump your models in the scene and a lot of the work is done.
  • retleks
    Options
    Offline / Send Message
    retleks polycounter lvl 18
    right and if the spread was lower you would get tighter ao... And I usually find that I have to balance the two... He could have a heigh distance and a high spread would just exacerbate the issue...
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    I guess if it was overdriven past 1 it could cause it.
  • a-k-m
    Options
    Offline / Send Message
    a-k-m polycounter lvl 5
    First of all, thanks for all the info and help!

    I have solved the problem by playing around with the max distance. Before it was set to 0... apparently 0 equals for infinitive distance (can this be?!)

    In my first post's photo the object above my AO-Object is just the high poly I moved upwards to have a better look on the Lop-Poly. I was baking the AO from High-poly model to the low-poly.

    Here are my new results after playing around with the max dist.

    topfao2.jpg

    62848140.jpg

    I didn't know that xnormal can bake AO too, next time I will go for it... But for simple objects like this I still want to be able to do the render quickly in 3ds max.

    And what about Light tracer... I can't select that renderer.. or isn't it a renderer?
  • Stromberg90
    Options
    Offline / Send Message
    Stromberg90 polycounter lvl 11
    Here Laurens Corijn(Xoliul) goes over ao baking in max, lighttracer is the first one he covers.
    http://www.laurenscorijn.com/articles/ambient-occlusion-baking
  • Mark Dygert
    Options
    Offline / Send Message
    Here Laurens Corijn(Xoliul) goes over ao baking in max, lighttracer is the first one he covers.
    http://www.laurenscorijn.com/articles/ambient-occlusion-baking
    If you're going to use scanline you're better off staying away from the skylight method, for the reasons Laurens brings up and because its really really slow. Instead use scanline and a custom light set up, like a light dome made up of spot lights. This script makes one easily and quickly and allows you to tweak the settings in one spot, pretty handy. You can also do it on your own and drop it in your scene.

    Using a light dome is much faster than using a skylight and much more customizable. Scanline right now actually calculates edge padding correctly unlike MentalRay that just makes a mess of the padding (see examples in my previous posts).
  • Stromberg90
    Options
    Offline / Send Message
    Stromberg90 polycounter lvl 11
    Thanks Mark, I tried to create one myself once but it did render horrible slow, probably something wrong with the settings I used.
    Going to try that script out, always enjoy faster rendering :)
  • Mark Dygert
    Options
    Offline / Send Message
    The light dome sets the shadow map size pretty low for each light (default of 128 I think), which if you had a lot of lights with large shadow maps (default of 512) it would slow the render down, especially if you turn on light tracer or switched to raytrace or area shadows.
  • Stromberg90
    Options
    Offline / Send Message
    Stromberg90 polycounter lvl 11
    From my tests it was pretty useful fast rendering, even when I had the shadows maps at 512 cause I thought 128 was to smooth, wonder why I have not seen this script mentioned before here, seems like a good alternative to the other methods :)
Sign In or Register to comment.