Shadow Masking: What is it and How to do it

Discussion in 'Halo and Forge Discussion' started by Fythic, Jul 6, 2016.

  1. Fythic

    Fythic Legendary

    Messages:
    15
    Likes Received:
    5
    **
    I made a post on the forge subreddit and someone told me I should post it here for all of you :)
    POST HERE: https://www.reddit.com/r/forge/comments/4qxq89/shadow_masking_what_is_it_and_how_to_do_it/
    **


    **INTRODUCTION**


    Shadow Masking is a new method of shading devised by me (PLEASE correct me on this statement, I'll gladly change it.) which takes the old pixely-style shading given to us in the halo 5 game and attempts to make it high-res. I hope this gets seen and used because I keep seeing good interior maps get lowres shadows, ruining the graphical fidelity of the map.

    Relevant Pictures here:

    http://imgur.com/a/G2Lj0

    http://i.imgur.com/IC5SCnm.jpg


    **NOTE: I HAVE ONLY TRIED THIS WITH INDOOR LIGHTING. DON'T THINK IT'LL WORK FOR OUTDOOR LIGHTING, BUT TRY FOR YOURSELF**


    **NOTE2: CHANGING THE SIZE/ANGLE OPTION OF THE SPOT LIGHT WILL CHANGE THE RESOLUTION AND ACCURACY OF THE SHADOW.**

    **SIZE/ANGLE HIGHER = LOWER-RES AND LESS ACCURATE SHADOW**

    **UPDATE SINCE REDDIT POST:
    I tested this with objects that have scripts that move and I can confirm that it does not work. I cannot confirm if it works with objects that have scripts but DO NOT MOVE, but as a precaution assume it doesn't. Also, animated objects such as trees cast shadows but the shadow does not follow the animation of the tree.**



    **How To**

    This is quite simple but let's first talk about the drawbacks before we do anything.

    Drawback 1: This only works with SPOT type lights with the dynamic setting set to off.

    Drawback 2: This shadow masking requires the use of "Masking", something i'll talk about in the next section.

    Drawback 3: The Masked objects MUST receive a tiny bit of light to be able to cast a shadow.

    With that said, let's get started.


    **CASTING WITHOUT MASKING**


    The first thing you're gonna want to do is to spawn a light with these two [settings](http://i.imgur.com/Td0lk36.jpg) applied.

    After that, you're going to want to place an object that has Light Bake [**ON**](http://i.imgur.com/khGtX4R.jpg) so it casts a shadow.

    The last step is to place an object that you want to receive the shadow, but turn its Light Baking **OFF**.

    Now all you have to do is generate the lighting and you'll get a highres shadow.


    **CASTING *WITH* MASKING**


    This is a lot more tricky, but is absolutely necessary for most scenes. First, let's start with a picture of the current problem with this scene(http://imgur.com/a/lFyp1). Because everything isn't being baked, the light passes right through every object and lights up everything in sight. This is where masking comes in.

    So, what we must do is cover the area with large blocks that will stop the light from casting on to places that is unwanted. This means we need Baked objects in view. To do so, I took some large blocks and offset them in rotation by about 1 degree and placed them around places where shadows are needed. Pictures(http://imgur.com/a/Rz3LG) (I removed some objects to make it clearer). The goal is to keep the visibility of the baked objects at a minimum due to their lack of blending in non-baked environments while still achieving the shadowmasking. Finished Product(http://i.imgur.com/eeAPmya.jpg).

    That's about it! If there's anything i missed/need to clarify, please tell me and i'll fix it.
     
  2. CHa0s

    CHa0s Forerunner
    Wiki Contributor Senior Member

    Messages:
    137
    Likes Received:
    93
    Awesome! I had no idea you could do this. Thanks for sharing!
     

Share This Page