Home Unreal Engine

UDK Normals in Ambient Shadow

polycounter lvl 15
Offline / Send Message
Autocon polycounter lvl 15
Is there a way in UDK to get normals to pop while in ambient shadow? Of course there is no direct sun light on these areas so they technically would never have normal detail, but normal maps are just here to help fake detail we cant model in. So in the real world, even these areas in shadow would still have some depth, not much but some.

So dose anyone know if there is a way to fake this and give the normals in shadow a little extra "pop" so they dont just appear as a flat texture? Preferably in the shader as I assume I could add a very small light to do that, but I would rather control things globally with a shader.

Midway through Uncharted 3 we got shader control to help fake a sun angle onto ambient shadowed areas to help with this problem, but I dont know if its something possible in UDK yet.

Thanks!

Replies

  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    If you setup a custom material, you could bake out the AO of the original mode/normal map, and have it Lerp/Mul on your Diffuse, and slot it into the DiffuseLighting on your material.

    Cheaper way, is to Mul the Blue channel of your Normal Map, but it won't look accurate. If you're on the other hand, trying to do it for environmental pieces ONLY, then you could try taking out the Green or Red channel or whichever one looks 'down' in terms of lighting information.

    Another thing to do is setup World Masked sky ambient, and multiply that too, should do the trick.
  • DeadlyFreeze
    Options
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    Do you have the lightmap specular turned on? That really catches a lot of bounced light.
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    Ace-Angel wrote: »
    If you setup a custom material, you could bake out the AO of the original mode/normal map, and have it Lerp/Mul on your Diffuse, and slot it into the DiffuseLighting on your material.

    Cheaper way, is to Mul the Blue channel of your Normal Map, but it won't look accurate. If you're on the other hand, trying to do it for environmental pieces ONLY, then you could try taking out the Green or Red channel or whichever one looks 'down' in terms of lighting information.

    Another thing to do is setup World Masked sky ambient, and multiply that too, should do the trick.

    The problem I see with those methods is that it will also increase the AO effect in sunlight as well as the ambient areas. Unless there is a way to mask out just the areas in ambient shadow, but for that, I have no idea how to do.

    If that is what you are referring to by World Masked Sky Ambient, well I cannot find any node similar too that or see anything that would possibly be similar to that effect.



    And yeah I have lightmap specular turned on, but the asset I am working with has little to know specular.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    OK, let me whip out the setup and see how it is, maybe I'm just being senile and not clever as I should be.

    ....
  • Snefer
    Options
    Offline / Send Message
    Snefer polycounter lvl 16
    Just popping a bit of fresnel multiplied with the diffuse in the emissive channel is a simple trick, using a very small number will basically nullify it sunlight, but will make it pop a bit more in shadow. Cheaty and not correct, but works decently.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    OK, here it is, I took a look at Naughty Dog's papers and their setup, and this should more or less roughly translate to what they did:

    Sky Ambient setup will look like this:


    sky.png

    World mask fed into a Lerp's Alpha and each slot takes in a color to fake the sky setup. I used a sky blue and deep red color to show what it will look like.

    =====

    And here is the final setup:

    skyamb.png

    In the case of UDK, you'll take you Sky Ambient and Mul it by your NdotL (Lambert) setup to correct 'certain' issues it has, and to also tone down the amount of 'glow' your model will get, especially from Normal Maps.

    Add this to the your Diffuse (which is also Mul by your Lambert).

    Take the final output from here and Mul it by your Occlusion, and feed it ONLY into your DiffuseLighting channel.

    NOTE: Looking back on the setup, I think I made a mistake where you could possibly (to compensate for real world light bounce in the world) add your Sky Ambient as your final over you occlusion instead of your occlusion being final, this way your compensate your occlusion setup to take into account Atmospherics and not be completely black (you can see the upper cheek bones are fighting for light information, which in my book looks wrong, but at the same time, I could be overthinking it and just talking out of my sweet peachy arse for no reason.

    =====

    Please, don't let the model and it's map represent the final quality. I'm using Miguel's model, which didn't have an AO map, so what you see is quick and dirty AO made in PS just for the sake of example.
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    Awesome, thanks for that Ace-Angel. I do have a question about your node setup though. There are 2 nodes I have never seen before. The top one I get what its doing as its pretty straight forward but I have never seen a node like that. For the bottom one I cant really tell by the image what the node looks like so I am not sure exactly what it dose, again its another node I have never seen before.

    crazynodes.jpg
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Those are my custom nodes, I made them to save space and so the material doesn't start lagging due to many, MANY nodes in the editor.

    Here is an SS of what's inside them:

    asdasd.png

    Just remember to clamp the second node, or else you will get weirdness here and there.
Sign In or Register to comment.