Search Unity

custom light calculation / shadow projection. possibly SRP?

Discussion in 'General Graphics' started by BloodMarked, Oct 13, 2018.

  1. BloodMarked

    BloodMarked

    Joined:
    Dec 11, 2013
    Posts:
    28
    i want to modify the way my main direction light works:

    - i want to update the shadow Depth texture only once, when the Scene is loaded.

    -i want to change the shadow projection Matrix to match a voxel grid.
    meaning i want the z axis (depth, in shadow space / light direction) to stay the same, but modify the x and y axis (xy on the shadow Depth map) to match the Unity x and z axis.
    furhtermore, i would like to modify the scale of These axes so each Pixel in the shadow map represents one voxel.
    see Image (left is Default, Right is what i want)
    shadowmap.jpg

    it seems to me like this was something the new SRP could do, but i can not find a starting Point on how to modify light calculation.

    on the other Hand i was thinking About using a custom script which renders the custom shadow map and passes it to a custom material with a custom shader. but this would be far less flexible when adding more Lights etc.