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

Shader HotSwap [Released 1.1]

Discussion in 'Assets and Asset Store' started by usingtheirs, Jun 14, 2020.

  1. usingtheirs

    usingtheirs

    Joined:
    Oct 5, 2018
    Posts:
    38
    AssetStore: http://u3d.as/1Gti



    What Shader HotSwap is
    The Shader HotSwap allows you to hot-swap shaders running on a device.

    • Shader Debugging – Sometimes shaders don’t work properly on devices. You can save a great amount of time by using Shader HotSwap when you repeatedly edit your shaders and test them on the devices.
    • Performance Tuning – Turn on/off some features of your shaders without rebuilding the binary. You can see the change of frame time immediately.
    Setup for Player
    Just drop the ShaderHotSwapServer prefab in your first scene. The prefab has a small web server in it. And it communicates with the Unity Editor parts through the network.

    That’s it. You can build your binary now.

    Setup for Unity Editor
    Assign shaders that you want to hot-swap.


    If your PC and your mobile device are in the same network, just type the IP address of your mobile device and the port, and click the Swap Shaders button in the HotSwap window. The default port is 8090. Or you can change the default port in the ShaderHotSwapServer prefab.

    If your Android device is connected to your PC through a USB cable, you can make use of ADB’s port forwarding feature. The following command adds a port forwarding setting. If it is succeeded, type ‘localhost:8090’ and click the Swap Shaders button in the HotSwap window. See Unity document’s ADB profiling section for details.
    1. adb forward tcp:8090 tcp:8090
    Hot-swap Shaders
    If everything is ok, you can now hot-swap your shaders. Edit your shaders and click the Swap Shader button.

    Thank you for reading! Feel free to give us any feedback or ask any questions you might have.

    Asset Store: http://u3d.as/1Gti