Search Unity

How to edit the Default-Sprite Material/Shader?

Discussion in 'Shaders' started by boehmzViacommix, Apr 26, 2018.

  1. boehmzViacommix

    boehmzViacommix

    Joined:
    May 4, 2017
    Posts:
    16
    I see the source code for the Sprites/Default shader in the built in shaders download from the Unity archive. What I don't know is where to put that to be the new default sprite shader.
    I tried putting it in Assets/Resources folder but still whenever I create a new SpriteRenderer it defaults to material Sprites-Default using shader Sprites/Default that is the unmodified version of Sprites/Default shader. It says Sprites-Default material exists in Resources/unity_built_in_extra but I cannot find that folder.
    Is it possible to change the default Sprites-Default shader so that every time I create a new SpriteRenderer it will start with that changed Shader? I'm on OSX if that affects folder locations
     
    DragonCoder likes this.
  2. LukasCh

    LukasCh

    Unity Technologies

    Joined:
    Mar 9, 2015
    Posts:
    102
    Well not for my knowledge. However I am not sure why would you need this functionality, as it might break other systems that depends on SpriteRenderer having default shader by default. Why not just create new material and assign with modified shader and if this is the case of easier usability, you can create editor script that does that.
     
  3. VoidVenom

    VoidVenom

    Joined:
    Jul 2, 2019
    Posts:
    7
    One reason which I have recently come across is the ability to set HDR colors. Currently, there is no easy way to make a sprite glow using an HDR/Emissive color...
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Just make it a shader file with it's own shader name, and make materials that use this shader and apply the material to the SpriteRenderer component for sprites you want to have glow.
     
  5. VoidVenom

    VoidVenom

    Joined:
    Jul 2, 2019
    Posts:
    7
    I have no experience making shaders either with code or with Shader Graph. Any tips you can offer would be greatly appreciated.