Search Unity

Are these shaders needed?

Discussion in 'Shaders' started by UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396, May 12, 2020.

  1. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152

    This is from Project Settings > Graphics.
    I'm on URP (most recent package version) and on 2019.3.9f1

    Questions:
    1. Is Element 0 needed? Since I'm on URP and it uses its own set of shaders, can I remove this?
    2. Elements 1-3, what are those used for?
    3. Please correct me if I'm wrong, Element 4 is related to using the Sprite Renderer component and Element 5 is related to using the UI canvas, image, etc components, right?
    4. Elements 6-8, are these video shaders used for recording things in-game? If my game does not have an in-game recording feature can I remove them?
    5. Element 9, what is this for? Is it post-processing?

    Thank you for helping me understand this!
     
    lejean likes this.
  2. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
    Anybody? Am I the only one with such a weird question?
     
  3. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
  4. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
    Someone has some answers for this today?
     
  5. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
  6. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    I would imagine you would not need any that you are not using.
     
  7. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
    How would I know? There are 5 questions unanswered.
     
  8. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    You should know what shaders you are using in your project. If you click on an object in the game then the bottom of the Inspector will tell you the shader it uses. Also you can make a backup then remove them I guess and see if you get any errors. I find that writing your own for your project is for the best; for instance there were features of the sprite shader I did not need for a project so edited it and increased it's performance quite significantly.
     
  9. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
    Could you tell me what features you edited out? It might help me in optimizing my game!
     
  10. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    It has been awhile. I'll post the code for the sprite shader I currently use which I believe increased performance from the default.
    Code (C++):
    1. Shader "Sprites/Sprite"
    2. {
    3.     Properties
    4.     {
    5.         [PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
    6.         [HideInInspector]_Color("Tint", Color) = (1,1,1,1)
    7.     }
    8.         SubShader
    9.         {
    10.             Tags
    11.             {
    12.                 "Queue" = "Transparent"
    13.             }
    14.  
    15.             Cull Off
    16.             Lighting Off
    17.             ZWrite Off
    18.             Blend One OneMinusSrcAlpha
    19.  
    20.             Pass
    21.             {
    22.             CGPROGRAM
    23.                 #pragma vertex SpriteVert
    24.                 #pragma fragment SpriteFrag
    25.                 #pragma target 2.0
    26.                 #include "UnitySprites.cginc"
    27.             ENDCG
    28.             }
    29.         }
    30. }