Home Technical Talk

2d like Illumination method using 3d

polycounter lvl 16
Offline / Send Message
ZeroCartin polycounter lvl 16
Hi everyone,

I am trying to recreate an effect that is easy to make in 2d, but in 3d in Unity. I want to have a shader for 3d characters that get illuminated as if they had no normals, so that light just produces soft illumination and no shadows as if the image was a cutout. Here's a visual example:


Any ideas?

Thanks,

Felipe 

Replies

  • Eric Chadwick
    Easy way, bend all the vertex normals to point straight up. 
  • RN
    Offline / Send Message
    RN sublime tool
    Your lighting reference is using a bloom post-processing effect, so that contributes a lot to that look.
    Note that if you want to use bloom you don't need to use HDR rendering in your game for it to work. It does work with LDR as long as you use a threshold lower than 1.

    So besides using that bloom effect, you can also use a simple lighting method which is to just calculate a single flat light tone for the whole character based on how close they are to all light sources, like an average light tone. Similar to what Eric suggested, but doing it with scripting and a shader, instead of with the mesh normals.
    To find the light tone, in your script you need to take a weighted average of the color of all light sources, with the weights being the normalized distances from the character to the light sources (if the character is within their range at all, else they can be ignored), then send that average color to the shader as a uniform, to be additively-blended to the character color (which comes from textures, vertex-colors etc.).
  • RyanB
    Write a shader that doesn't use normals.  Use distance only to create gradients.  Then apply an additive gradient over the screen or something similar.
Sign In or Register to comment.