Search Unity

Custom Lighting Model in a Shader & Screen Space Reflections

Discussion in 'Image Effects' started by HTusa, Aug 25, 2017.

  1. HTusa

    HTusa

    Joined:
    Aug 2, 2017
    Posts:
    9
    Hi! Wasn't sure if this would be better posted in the shaders section or here in the Image Effects.

    I'm not an expert shader writer, but I've been working on a custom anime-like toon shader. Going with a Custom Lighting Model works better for what I'm looking for as it allows me to stack multiple lights, but for some reason, Screen Space Reflections (from v1 Post-processing stack) stop working. And if I'm going with a Standard Lighting Model, SSR works, but I only get the light from the Directional Light.

    Here's what I mean (the mesh is the free Unity-chan asset, and the scene is the free Unity Courtyard):

    animeshader_ssrproblem.jpg

    Note: the green light isn't coming from an emissive surface, but from a simple point light.

    Any idea if I'm doing something wrong, or where the problem might be?

    Thanks.
     
  2. HTusa

    HTusa

    Joined:
    Aug 2, 2017
    Posts:
    9
    Okay, I think I've traced the problem to the fact that I'm rendering the character as a Forward pass (since I need the light vector data). I presume Unity's Screen Space Reflections don't like forward shaders at all?
     
  3. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Unity's SSRR uses the deferred G-Buffers to work, so yeah, they don't like forward shaders.