Home Technical Talk

How would you create this lighting technique? (controlling light with geo intersection)

polycounter lvl 4
Offline / Send Message
Korvas polycounter lvl 4
Hi, I am trying to reproduce this lighting technique which I theoretically know how it's done, but I have no idea how to execute it. Right now I am using Maya, but I would also like to know if this is possible in Unity (which I have minimal experience with).

In short the shading is not controlled with physical lights but with geometry. The character has a toonshader applied. There is an invisible piece of geometry that represents where the 'light' is. Where the character intersects with this geo is where the character is in 'light'. Here is the short "Pearl" where I know the director is using a technique like this, rather than out-of-the-box toonshading. Alternatively this geo can be used just to say "render lighting completely and only in this location, all else in is shadow"

Here's a demonstration with my own rough model, I quickly drew up what sort of thing I'm looking for in photoshop.



If you all have any sort of leads let me know. Also feel free to mention anything that feels close to what I'm going for.

Replies

  • Anchang-Style
    Options
    Offline / Send Message
    Anchang-Style polycounter lvl 7
    I think that issue was very much discussed in this thread
    http://polycount.com/discussion/121144/convincing-3d-that-looks-like-2d-wow/p8
    Jump to the last pages. If i remember correctly it's something about baking the normals of super low polies to a higher poly mesh.
  • Scruples
    Options
    Offline / Send Message
    Scruples polycounter lvl 10
    You need to soften the normals, easiest way is to transfer them from another shape.
    Guilty gear has a good pdf on this somewhere....ah here
    page 21
    http://www.ggxrd.com/Motomura_Junya_GuiltyGearXrd.pdf
    you'd be transferring from basically a sphere...
  • Korvas
    Options
    Offline / Send Message
    Korvas polycounter lvl 4
    Thanks for the above links, especially the PDFs. I know altering the normals to be smoother is an option, and one I can pursue if all else fails. I'll read up on it in the meantime.

    I just know that the technique with light shapes can be done, and is preferable in some situations, especially when framing multiple objects in light and with a specific shape. This is more for cinematic purposes.
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    It might be a stencil buffer trick, the same one used in Wind Waker:
    https://simonschreibt.de/gat/zelda-wind-waker-hyrule-travel-guide/#fireflying
  • Korvas
    Options
    Offline / Send Message
    Korvas polycounter lvl 4
    RN said:
    It might be a stencil buffer trick, the same one used in Wind Waker:
    https://simonschreibt.de/gat/zelda-wind-waker-hyrule-travel-guide/#fireflying
    Yes I think this is exactly what I want! Thanks for the lead, Windwaker always seems to be a point of reference for ideal toon shading.

    I'll look into this more, though I feel some of the technology explained here is a little over my head and may take time to digest. Creates a cool effect though. The stencil buffers also seem to be capable of something I couldn't find a solution to ages ago which was turning a mesh invisible where geometry intersects. Also the 'portal windows' they can create also look pretty wild.
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    That article mentions 3 spheres, but I think it's really just one sphere rendered in 3 passes (each pass using different depth-test and stencil-test settings).
    These 3 passes are needed to build a "mask" on the stencil buffer that represents only the pixels you want to light up. Think of it like working with selections in Photoshop: you can add, subtract, intersect selections etc. and at the end you have the complex selection you want. These selections that you are making are the pixels of the sphere that is being rendered sometimes with frontface culling and sometimes with backface culling.

    After the mask is ready, you can render a fullscreen quad with an additive blend and set the stencil-test to only let pixels of the quad appear when they are within the region of that mask.
    You can also do the opposite: render a fullscreen quad with like a multiply blend and set the stencil-test to only let pixels of the quad appear when they are outside of the region of that mask. The whole scene is rendered lit, but the pixels outside of the mask are darkened to make them look like they're in shadow. This is kinda like stencil-buffer shadows work.
Sign In or Register to comment.