Home Unreal Engine

UDK - Material - AO/Cavity Texture based solution?

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Hey to all,

OK, quick question, what is the best way to use an AO map, which is married to my Diffuse, to fake pending on Light Vector, the effect of AO.

Here currently what my setup looks like:

Diffuse * Lerp ( 1.0, AO Map, (Dot (L, N ) )

Currently, it looks OK, but at the same time, it looks weird. The light doesn't feel like it's killing the AO map when directly exposed to a surface, especially up close and personal.

However, strangely enough, when I use the blue channel on my Normal Map to as my AO, it interacts correctly with the light.

To make it even more strange, when I plug my Normal Map to my Dot, as opposed to 0,0,1 I get WORSE result.

Much appreciated for any feedback on this.

Replies

  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    Hey ace,

    I was curious about this as well, but unfortunatly I don't know how I would do it. Can you post some pics of what you got so far?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Sure, here what mine looks like, it's taking the information from my Blue channel (for now).

    20947271.png

    Basically, Lerp gets in the Alpha your Light function and the AB slots get the texture.

    The problem is, from my normal map, especially the blue channel, the shadows get exposed correctly. The bends project shadows, etc, without being too dark in the light areas.

    Problem is, with a REAL AO map generated from the HP model, the parts of model which receive light end up looking real nasty, as in someone shot liquorice on my model. I'm guessing I need to also copy the function to my Specular slot to tell it to not expose any Spec power in the shadowed parts.
  • sinistergfx
    Options
    Offline / Send Message
    sinistergfx polycounter lvl 18
    Wouldn't it make more sense like this?:

    LERP(diffuse*ao,diffuse,DOT(lightvector,normalmap))
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    A basic lighting model that would include AO would work like this:

    Direct lighting would have NO AO, direct lighting's shadows are handled my dynamic shadows or shadow maps, so that would be Dot(Normal,LightVector)*DiffuseTexture going into custom lighting, then DiffuseTexture * AO would go into CustomLightingDiffuse input. CustomLightingDiffuse is what handles indirect lighting.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Ah, OK, understood. Thanks alot guys for the feedback!
  • HAWK12HT
    Options
    Online / Send Message
    HAWK12HT polycounter lvl 12
    Just one thing you said you using blue channel for AO, what i have read on some forums is that use Red and green for important stuff and blue for least. Not sure if it affects how info is read by UDK.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    No, you're right, Red and Green channel would the most correct ones to use if you manipulate them correctly.

    Unfortunately, no matter what I do, the R and G channels end up with seams on my model. They simply do not match up at the seams, so I'm left with the blue, which while works, can look abit off in certain dents and pushed in areas.

    However, the delicious paradox is for any tile based texture, you can get out the RG channels correctly and play around with them.
Sign In or Register to comment.