Search Unity

Feature Request Make SRP codes' API public

Discussion in 'Universal Render Pipeline' started by suntabu, Aug 15, 2022.

  1. suntabu

    suntabu

    Joined:
    Dec 21, 2013
    Posts:
    77
    Hi,

    So many internal APIs in SRP, we could code nothing scriptable features

    Why you need these API internal?
     
  2. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    What specific things are you not able to do that you would want to?
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
  4. suntabu

    suntabu

    Joined:
    Dec 21, 2013
    Posts:
    77
    I wanna make a 2D lighting solution, this solution use Depth as pixel flags for the lit area in the scene.

    But unity's URP 2d renderer does not support depth when using a single camera.

    So I wanna create my own renderer interacting with the depth map.

    When I created my renderer class, I found lots of APIs being marked as `internal`.
    I have to rewrite many codes based on SRP instead of URP.
     
  5. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    Ruslank100 and tmonestudio like this.
  6. suntabu

    suntabu

    Joined:
    Dec 21, 2013
    Posts:
    77
    I finally solved this problem.

    Share my way:

    1. Copy [RenderObjects.cs] to RenderCustomObjects.cs from URP code for customized RenderFeature
    2. Change LightMode of all shaders in Scene to "MyCustomObject"
    3. Add "MyCustomObject" as ShaderTagId in RenderCustomObjects.cs
    4. That's it! I can control all render flow by myself now!
     
    tmonestudio and DevDunk like this.