Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

CameraEvent before/after shadow projection

Discussion in 'General Graphics' started by raja-bala, Mar 24, 2015.

  1. raja-bala

    raja-bala

    Joined:
    Jul 11, 2012
    Posts:
    29
    With the CommandBuffer addition to Unity 5, we get the chance to intercept specific rendering events and not be limited to PreRender/PostRender, which is awesome.

    However, I don't see events for directional light shadows like AfterShadowMap (or) BeforeShadowProjection and AfterShadowProjection events listed in http://docs.unity3d.com/ScriptReference/Rendering.CameraEvent.html

    I'm especially interested in the AfterShadowProjection to create volumetric particle shadows (that are cast on the scene). I'm looking at the .cginc files, but I can't edit them with Unity running, since they're read only file handles. I really want to use the existing standard material in Unity 5, but just tweak the directional light intensity based on my (projected) light propagation texture to let a particle volume cast shadows.

    Attached are two screenshots of my volumetric particle system. It receives shadows from the scene (I had to reconstruct a mini-shadow map for this, since I wasn't sure how to intercept/use the shadow map) but doesn't cast any.

    Hoping one of the rendering wizards sees this :D
    Ideas to do this in the current version are very much appreciated.

    Thanks.
     

    Attached Files:

    • ss1.PNG
      ss1.PNG
      File size:
      117.5 KB
      Views:
      912
    • ss2.PNG
      ss2.PNG
      File size:
      164.9 KB
      Views:
      890
  2. raja-bala

    raja-bala

    Joined:
    Jul 11, 2012
    Posts:
    29