Home 3D Art Showcase & Critiques

Are you using Ambient Occlusion in your material?

JordanN
interpolator
Offline / Send Message
JordanN interpolator
QIBkkH2.jpg


I've seen a lot of materials posted here and other places and some of them leave the AO slot (or whatever the equivalent is in other programs) unplugged. I was wondering what's your reason to do that if you do?

According to the official Marmoset workflow on PBR,, an ambient occlusion texture is needed to stop incoming light from ambient light sources.

Replies

  • Lt_Commander
    Options
    Offline / Send Message
    Lt_Commander polycounter lvl 10
    You take the time to bake it, and it helps the engine properly shade details that exist only in the normalmap; I couldn't imagine not including it. (Unless there's some downside I don't know about?)
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    I am not certain as to how the UE4 does AO, but I recall it being a multiply into the diffuse and specular ( it might just be specular). Not just an occlusion of ambient light which is certainly how Marmoset's AO works.
  • billymcguffin
    Options
    Offline / Send Message
    billymcguffin polycounter lvl 11
    @stevston UE4's AO only shows up in areas lit by ambient light, I don't know if it's physically correct beyond that though.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    @stevston UE4's AO only shows up in areas lit by ambient light, I don't know if it's physically correct beyond that though.

    Ok then there is no reason what so ever to not use it. It is entirely physically correct. It will allow you to light an object without it occluding direct lights.
  • WarrenM
    Options
    Offline / Send Message
    I guess the only reason would be that it's another texture look up ... but for portfolio pieces, yeah, no reason not to if you have it.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    WarrenM wrote: »
    I guess the only reason would be that it's another texture look up ... but for portfolio pieces, yeah, no reason not to if you have it.

    Nope. With metalness you can store the metalnes map in the Red channel, the AO in the Blue channel, and then gloss in the green channel. Doesn't really matter what channel you store them. The point is you aren't using any extra textures. You actullay end up with 3 textures that way Albedo, Normals, and Metalness/AO/Gloss maps.
  • Tobbo
    Options
    Offline / Send Message
    Tobbo polycounter lvl 11
    I think it's fine to use as long as long as you don't multiply/overlay the AO directly into your diffuse/albedo.
  • WarrenM
    Options
    Offline / Send Message
    You're right, of course. Channel packing is the way around that.
  • sltrOlsson
    Options
    Offline / Send Message
    sltrOlsson polycounter lvl 14
    You shouldn't forget baked vertex AO either, if you're not using vertex colors for something else that is..
    stevston89 wrote: »
    Nope.***

    ^^^^You do realize you just tried to school someone that has more UE experience that all of us combined right? :poly142:
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    sltrOlsson wrote: »
    ^^^^You do realize you just tried to school someone that has more UE experience that all of us combined right?

    I didn't try to school anyone. Also that knowledge is hardly specific to UE.
  • WarrenM
    Options
    Offline / Send Message
    No need for that, he was right. :)
  • Analdin
    Options
    Offline / Send Message
    Analdin polycounter lvl 6
    stevston89 wrote: »
    Nope. With metalness you can store the metalnes map in the Red channel, the AO in the Blue channel, and then gloss in the green channel. Doesn't really matter what channel you store them. The point is you aren't using any extra textures. You actullay end up with 3 textures that way Albedo, Normals, and Metalness/AO/Gloss maps.
    Actually, if you leave out AO, you can store Metalness and Glossiness in the Alpha Channel of the Albedo and Normal maps, which makes only two textures. For AO, you'd have to use one texture for a single-channel image, and that means that by using separate AO maps on everything, you will either cut down your texture budget by 1/3 or you will have to pack textures from multiple objects into one file, which will make effective loading times a bitch to handle.
    Nothing wrong with using AO maps for your portfolio pieces imo though.
  • WarrenM
    Options
    Offline / Send Message
    As always, many angles. Storing stuff in the alpha channel affects which compression algorithms you can use and may ultimately end up wasting MORE memory than you think you're saving.

    TECHNOLOGY, HO!
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    Analdin wrote: »
    Actually, if you leave out AO, you can store Metalness and Glossiness in the Alpha Channel of the Albedo and Normal maps, which makes only two textures. For AO, you'd have to use one texture for a single-channel image, and that means that by using separate AO maps on everything, you will either cut down your texture budget by 1/3 or you will have to pack textures from multiple objects into one file, which will make effective loading times a bitch to handle.
    Nothing wrong with using AO maps for your portfolio pieces imo though.

    Yeah but using an alpha channel is just as expenisve as using a full rbg map so you would actually be using the memory of 4 textures at that point which isn't cheaper.
  • PyrZern
    Options
    Offline / Send Message
    PyrZern polycounter lvl 12
    ...... This whole thread and its content flies over my head like a bad joke #_#

    Really have to learn UE4 now !!
  • Analdin
    Options
    Offline / Send Message
    Analdin polycounter lvl 6
    stevston89 wrote: »
    Yeah but using an alpha channel is just as expenisve as using a full rbg map[...]
    As far as I know, an alpha channel is a single channel, not a three-channel RGB texture, and is stored and loaded with the other three channels in a 4-channel texture.

    @Warren: Now that's interesting. I thought most compression algorithms compress the R,B, and Alpha channels in the same way and leave a bit more room for the green one. Are there any good articles/papers dealing with this sort of stuff?

    //edit: It just crossed my mind that the Normal Map could be cut down to two channels, which would make room for the AO map. That will probably require modifying the engine's normal map handling process, though. So either with or without alpha channels, I too have come to the conclusion that there is no point in not storing AO separately.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    Analdin wrote: »
    As far as I know, an alpha channel is a single channel, not a three-channel RGB texture, and is stored and loaded with the other three channels in a 4-channel texture.

    I wish knew more technically to speak to specifics, but from what I have heard from tech artists alpha channels are really expensive especially if you need any sort of detail in them. So just as expenisve to have full rgb map as it would to add an 8 or 16 bit alpha channel. It would be especially preferable to do a full rgb and channel pack than it would be to add an alpha channel to 2 textures.
  • WarrenM
    Options
    Offline / Send Message
    Not sure about papers, Analdin. It's just something I was told. Basically, adding an alpha channel to your diffuse is the same cost as 2 textures.

    So one RGBA texture uses the same memory as 2 RGB textures. Or so I've been told... I used to try and pack my spec into the alpha channel of the diffuse and was politely asked to stop. :)
  • Analdin
    Options
    Offline / Send Message
    Analdin polycounter lvl 6
    That does sound convincing. I've gotten really curious though, and if I have the time sometime, I'll try and set up some sort of stress test for RGBA and RGB textures.
  • billymcguffin
    Options
    Offline / Send Message
    billymcguffin polycounter lvl 11
    Here's a great overview by Hourences on the subject: http://www.hourences.com/tutorials-ue3-texture-optimization/

    About halfway down the page he shows filesize of 3 textures with alphas vs 4 textures (the 3 alphas packed into RGB of the 4th image). 1 RGBA appears to take 1366kb, while 1 RGB takes 683kb, so 3x1366 = 4098kb vs 4x683 = 2732kb.
  • Ex-Ray
    Options
    Offline / Send Message
    Ex-Ray polycounter lvl 12
    I also remember being told to avoid using RGBA as well, as they get converted to a dx5 which has a 4:1 compression ratio. RGB converts to dx1 which has a 6:1 compression ratio so better for the memory resource.
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    If your AO is a layer in your Diffuse set to Multiplay your doing it wrong. That was last gen.

    If you have an AO texture that is in your shader that is separate from your Diffuse you are doing it right. Not needed and an extra texture look up, but for folio stuff no reason not too.
  • Shrike
    Options
    Offline / Send Message
    Shrike interpolator
    AO is part of pretty much every asset, sure i would use it

    do not forget that the AO you get by default from your bake is way too strong for realistic AO out of the box, implying you use default settings from xnormal etc
  • MattyWS
    Options
    Offline / Send Message
    MattyWS polycounter lvl 11
    This has been a rather educational thread. I was told a few months ago by my lead programmer that using the alpha channel was inefficient for what I was doing but wasn't sure exactly why other than the way things were packed and compressed. Also in Unity the default shader for diffuse/specular forces you to use the alpha channel as a specular map.

    Maybe writing my own shader that uses a separate image to store gloss, specular and even an alpha into RGB channels would be a good idea. It means having three images using RGB and no alpha channels would be used. ^_^ Before, I was using two textures with RGBA (diffuse with specular, normal with gloss, and a numeral value for transparency).

    To jump back on the topic of the thread, to show off your work you should be using the AO anyway. Many ways of packing that AO map in with other maps though.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    Just bumping this thread again as a PSA:

    I did some tests in UE4, and found the difference between using AO is night and day.

    Here is AO when being lit directly by the sun and skylight,
    i30EK20J7ocnk.jpg

    Here is AO when the sun is facing away from the object (so only the skylight is providing light)
    inyMIpPcgUBnD.jpg


    As you can see, you need AO to provide indirect shadowing in your object! This is very important for UE4 users when real time global illumination is kinda lacking right now.

    And here's the material. AO only goes in the AO slot. DO NOT BAKE IT IN YOUR DIFFUSE/ALBEDO.

    i5E3tCcGYSmir.jpg
Sign In or Register to comment.