Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Wat a new way to bake custom textures in SRP?

Discussion in 'General Graphics' started by BattleAngelAlita, May 16, 2019.

  1. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    I often need to bake some custom textures in edit time. Like static shadows, masks, specific noise, world to uv space coordinates, ect.

    With legacy rendering i do
    Code (CSharp):
    1. CreateCamera();
    2. camera.SetReplacementShader()
    3. camera.Render()
    4. DeleteCamera()
    Now, in SRP, i can not use replacement shader, can not initiate rendering on push button in editor window.
    I use 2018 LTS
     
  2. Sh-Shahrabi

    Sh-Shahrabi

    Joined:
    Sep 28, 2018
    Posts:
    56
    I think this is exactly the type of things which you should add to your RenderPipeline code. There you can do things like which shader pass to use to render and ...
     
  3. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    I write my own SRP. But problem is i still can not
     
  4. Sh-Shahrabi

    Sh-Shahrabi

    Joined:
    Sep 28, 2018
    Posts:
    56
  5. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Unfortunately this is not what i need. SetOverrideMaterial override whole material, SetReplacementShader on the other side override only shader, and keep all uniforms intact. Ie i need to do my own shadow caster stuff, and for grass/trees i need to do alpha test in overrided material. But i cant because all information about textures are gone.

    As a temporal solution i just disable SRP, do my good-old camera.SetReplacementShader(); camera.Render(); and enable SRP back.