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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question Updating an Obsolete Splatoon Ink Shader in Unity

Discussion in 'General Graphics' started by JustTiredOfEverything, Apr 30, 2023.

  1. JustTiredOfEverything

    JustTiredOfEverything

    Joined:
    Aug 4, 2022
    Posts:
    78
    TLDR - How can I update obsolete functions from Mix and Jam's Splatoon ink shader video to use RTHandle/RTHandles as suggested when RTHandle lacks a 'ConfigureTarget' function and RTHandles doesn't have a 'Blit' function?

    I recently came across Mix and Jams Splatoon ink video on YouTube and found the repository to potentially use and learn from for my game. However, I've run into a roadblock: the code in the repo is now obsolete. I need some help updating it.

    The obsolete code involves the following errors:

    • ScriptableRenderPass.ConfigureTarget(RenderTargetIdentifier) is obsolete: 'Use RTHandle for colorAttachment'
    • ScriptableRenderPass.Blit(CommandBuffer, RenderTargetIdentifier, RenderTargetIdentifier, Material, int) is obsolete: 'Use RTHandles for source and destination'
    To be completely honest, I'm feeling a bit lost. I'm not sure how to convert the code to use RTHandle/RTHandles as suggested, especially since RTHandle doesn't have a 'ConfigureTarget' function and RTHandles doesn't have a 'Blit' function.

    I don't understand why these classes are suggested as replacements, or what I'm really supposed to do to fix this issue. I feel very unequipped to solve this problem on my own, so here I am.

    If anyone could provide some insight or resources on how to update this obsolete code, I would be incredibly grateful. Thank you in advance for your assistance!

    Relevant API:
    Class RTHandle | Core RP Library | 14.0.7 (unity3d.com)
    Class RTHandles | Core RP Library | 14.0.7 (unity3d.com)
     
    Last edited: Apr 30, 2023
  2. CameronLewis

    CameronLewis

    Joined:
    Apr 17, 2016
    Posts:
    16
    I'm having a similar issue, and would love to know if you found a solution. Sorry that I can't actually be of help! :)
     
  3. JustTiredOfEverything

    JustTiredOfEverything

    Joined:
    Aug 4, 2022
    Posts:
    78
    Unfortunately no. I have not found a solution yet.
     
  4. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    609
    Hi, I think you need to use
    CommandBuffer.Blit()
    or
    Blitter.BlitCameraTexture()
    to perform full screen blit in newer versions of URP (14).

    The Blitter API (which handles XR rendering correctly) needs you to modify the shader's vertex stage to make it work properly. (see documentation)


    For the configure target with RTHandles, there're:
    • ScriptableRenderPass.ConfigureTarget(RTHandle color, RTHandle depth)
    • CommandBuffer.SetRenderTarget(RTHandle color, RTHandle depth)