Search Unity

maximum ps_5_0 sampler register index

Discussion in 'Shaders' started by RoughSpaghetti3211, Sep 30, 2018.

  1. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    so seeing this error in my shadergraph using LWRP,I’m guessing I’ve hit a limit on how many textures I can use in my shader. I’m just staring to work with shaders so my understanding is next to noting but I’ve seen shader that can take 256 textures , how can I use more than 16 textures in my shadergraph,please help
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    You’re limited to 16 sampler states per shader, not 16 textures. By default each texture gets its own sampler state, which means you hit the 16 sampler limit after 16 textures. You can work around this by defining a sampler state and reusing it to sample multiple textures. I believe Shader Graph has the Sampler State Node for this. However that only gets you to 128 textures. The real solution to get past that is using a texture array, which is how those shaders that advertise 256 textures work. And those shaders really have a limit of 256 texture sets, which includes the diffuse, normal, and smoothness textures. A texture array is a special kind of texture which the shader sees as a single texture, and the 256 limit has more to do with the way the texture stores which texture layer to sample. Really you could have 65536 textures in a single shader by using 128 texture arrays with 512 layers each, but that’s overkill.

    If all you need is to get a few more textures, a shared sampler state is the easier option.
     
    gotiobg, _geo__, PhilMaster and 2 others like this.
  3. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    328
    Code (CSharp):
    1. // https://github.com/przemyslawzaworski/Unity3D-CG-programming/blob/master/texture_mapping.shader
    2.  
    3. //Shader shows configuration of using 24 textures per shader in single pass.
    4.  
    5. Shader "Texture Mapping"
    6. {
    7.     Properties
    8.     {
    9.         _Texture01 ("Texture 01", 2D) = "black" {}
    10.         _Texture02 ("Texture 02", 2D) = "black" {}
    11.         _Texture03 ("Texture 03", 2D) = "black" {}
    12.         _Texture04 ("Texture 04", 2D) = "black" {}
    13.         _Texture05 ("Texture 05", 2D) = "black" {}
    14.         _Texture06 ("Texture 06", 2D) = "black" {}
    15.         _Texture07 ("Texture 07", 2D) = "black" {}
    16.         _Texture08 ("Texture 08", 2D) = "black" {}
    17.         _Texture09 ("Texture 09", 2D) = "black" {}
    18.         _Texture10 ("Texture 10", 2D) = "black" {}
    19.         _Texture11 ("Texture 11", 2D) = "black" {}
    20.         _Texture12 ("Texture 12", 2D) = "black" {}
    21.         _Texture13 ("Texture 13", 2D) = "black" {}
    22.         _Texture14 ("Texture 14", 2D) = "black" {}
    23.         _Texture15 ("Texture 15", 2D) = "black" {}
    24.         _Texture16 ("Texture 16", 2D) = "black" {}
    25.         _Texture17 ("Texture 17", 2D) = "black" {}
    26.         _Texture18 ("Texture 18", 2D) = "black" {}
    27.         _Texture19 ("Texture 19", 2D) = "black" {}
    28.         _Texture20 ("Texture 20", 2D) = "black" {}
    29.         _Texture21 ("Texture 21", 2D) = "black" {}
    30.         _Texture22 ("Texture 22", 2D) = "black" {}
    31.         _Texture23 ("Texture 23", 2D) = "black" {}
    32.         _Texture24 ("Texture 24", 2D) = "black" {}      
    33.     }
    34.     Subshader
    35.     {
    36.         Pass
    37.         {
    38.             CGPROGRAM
    39.             #pragma vertex vertex_shader
    40.             #pragma fragment pixel_shader
    41.             #pragma target 5.0
    42.  
    43.             Texture2D _Texture01,_Texture02,_Texture03,_Texture04,_Texture05,_Texture06,_Texture07,_Texture08;
    44.             Texture2D _Texture09,_Texture10,_Texture11,_Texture12,_Texture13,_Texture14,_Texture15,_Texture16;
    45.             Texture2D _Texture17,_Texture18,_Texture19,_Texture20,_Texture21,_Texture22,_Texture23,_Texture24;
    46.  
    47.             SamplerState sampler_linear_repeat;
    48.  
    49.             struct structure
    50.             {
    51.                 float4 vertex : SV_POSITION;
    52.                 float2 uv : TEXCOORD0;
    53.             };
    54.  
    55.             structure vertex_shader (float4 vertex:POSITION,float2 uv:TEXCOORD0)
    56.             {
    57.                 structure vs;
    58.                 vs.vertex = UnityObjectToClipPos (vertex);
    59.                 vs.uv = uv;
    60.                 return vs;
    61.             }
    62.  
    63.             float4 pixel_shader (structure ps ) : SV_TARGET
    64.             {
    65.                 float2 uv = ps.uv.xy;
    66.                 float2 scale = uv/float2(0.25,0.1666);
    67.                 if (uv.x<0.25 && uv.y<0.1666)
    68.                     return  _Texture01.Sample(sampler_linear_repeat, scale);
    69.                 else
    70.                 if (uv.x<0.25 && uv.y<0.3333)
    71.                     return  _Texture02.Sample(sampler_linear_repeat, scale);
    72.                 else
    73.                 if (uv.x<0.25 && uv.y<0.4999)
    74.                     return  _Texture03.Sample(sampler_linear_repeat, scale);
    75.                 else
    76.                 if (uv.x<0.25 && uv.y<0.6666)
    77.                     return  _Texture04.Sample(sampler_linear_repeat, scale);
    78.                 else
    79.                 if (uv.x<0.25 && uv.y<0.8333)
    80.                     return  _Texture05.Sample(sampler_linear_repeat, scale);
    81.                 else
    82.                 if (uv.x<0.25 && uv.y<=1.0)
    83.                     return  _Texture06.Sample(sampler_linear_repeat, scale);
    84.                 else
    85.                 if (uv.x<0.5 && uv.y<0.1666)
    86.                     return  _Texture07.Sample(sampler_linear_repeat, scale);
    87.                 else
    88.                 if (uv.x<0.5 && uv.y<0.3333)
    89.                     return  _Texture08.Sample(sampler_linear_repeat, scale);
    90.                 else
    91.                 if (uv.x<0.5 && uv.y<0.4999)
    92.                     return  _Texture09.Sample(sampler_linear_repeat, scale);
    93.                 else
    94.                 if (uv.x<0.5 && uv.y<0.6666)
    95.                     return  _Texture10.Sample(sampler_linear_repeat, scale);
    96.                 else
    97.                 if (uv.x<0.5 && uv.y<0.8333)
    98.                     return  _Texture11.Sample(sampler_linear_repeat, scale);
    99.                 else
    100.                 if (uv.x<0.5 && uv.y<=1.0)
    101.                     return  _Texture12.Sample(sampler_linear_repeat, scale);
    102.                 else
    103.                 if (uv.x<0.75 && uv.y<0.1666)
    104.                     return  _Texture13.Sample(sampler_linear_repeat, scale);
    105.                 else
    106.                 if (uv.x<0.75 && uv.y<0.3333)
    107.                     return  _Texture14.Sample(sampler_linear_repeat, scale);
    108.                 else
    109.                 if (uv.x<0.75 && uv.y<0.4999)
    110.                     return  _Texture15.Sample(sampler_linear_repeat, scale);
    111.                 else
    112.                 if (uv.x<0.75 && uv.y<0.6666)
    113.                     return  _Texture16.Sample(sampler_linear_repeat, scale);
    114.                 else
    115.                 if (uv.x<0.75 && uv.y<0.8333)
    116.                     return  _Texture17.Sample(sampler_linear_repeat, scale);
    117.                 else
    118.                 if (uv.x<0.75 && uv.y<=1.0)
    119.                     return  _Texture18.Sample(sampler_linear_repeat, scale);
    120.                 else
    121.                 if (uv.x<=1.0 && uv.y<0.1666)
    122.                     return  _Texture19.Sample(sampler_linear_repeat, scale);
    123.                 else
    124.                 if (uv.x<=1.0 && uv.y<0.3333)
    125.                     return  _Texture20.Sample(sampler_linear_repeat, scale);
    126.                 else
    127.                 if (uv.x<=1.0 && uv.y<0.4999)
    128.                     return  _Texture21.Sample(sampler_linear_repeat, scale);
    129.                 else
    130.                 if (uv.x<=1.0 && uv.y<0.6666)
    131.                     return  _Texture22.Sample(sampler_linear_repeat, scale);
    132.                 else
    133.                 if (uv.x<=1.0 && uv.y<0.8333)
    134.                     return  _Texture23.Sample(sampler_linear_repeat, scale);
    135.                 else
    136.                 if (uv.x<=1.0 && uv.y<=1.0)
    137.                     return  _Texture24.Sample(sampler_linear_repeat, scale);
    138.                 else
    139.                     return 1;
    140.             }
    141.             ENDCG
    142.         }
    143.     }
    144. }
     
  4. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    Thanks for the info, looks like I will need to use a texture array. Have you done texture arrays in shadergraph I would know where to start, so I need to create a texture array or can I just plug textures in as I go
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Unity's editor doesn't help with creating texture arrays at all. You have to construct them entirely on your own from script, or download something from the asset store which can help. Once they've been setup, they can be plugged into a sample 2d array node.
     
  6. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    Ok , thanks again for all your help
     
  7. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
  8. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    61
    Hi there, I have the same problem but I am using ASE. I am doing a terrain shader and I just need a few more than 16 textures, 20 in fact. Is there an equivalent of this Sampler State Node in Amplify?
     
  9. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
  10. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    Ive used a textureArray in Amplify, seems like this is what you need. I used over 50 textures that way in a single sampler
     
  11. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    99
    Thanks Bgolus, using the Sampler State node worked perfectly to have more than 16 textures at once in a shader. Now is it optimized? Time will tell... :)
     
    theCodeHermit likes this.
  12. Wawwaa

    Wawwaa

    Joined:
    Sep 30, 2017
    Posts:
    165
    @Horus_Sungod42 How did you use SamplerState node? Just attaching its output to sampler input ok?
     
    theCodeHermit likes this.
  13. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    99
    Yes
     
    stellamocha and theCodeHermit like this.
  14. claudiocho

    claudiocho

    Joined:
    Aug 19, 2019
    Posts:
    9
    @Horus_Sungod42 I don´t know how using the samplerState node resolve this issue. I´m using 12 textures and one SamplerState node and Unity is having problem to render preview for material. You can post the schemas of how you work with this issue? Thanks
     
  15. Liderangel

    Liderangel

    Joined:
    Jul 8, 2018
    Posts:
    101
    I'm getting this error on Shaders made by Unity URP, only while building, which is extremely weird (Unity 2021.2.7f1 - URP 12.1.2):

    upload_2022-4-12_16-35-45.png


    Does anybody know why? And the solution to it? The build somehow does get completed but the errors worry me a great deal.
     
    Last edited: Apr 21, 2022
  16. bfaliuperspectives

    bfaliuperspectives

    Joined:
    Feb 10, 2021
    Posts:
    13
    I have exact same errors when I build my project or my addressables groups. I am using Unity 2021.2.14.
     

    Attached Files:

  17. Liderangel

    Liderangel

    Joined:
    Jul 8, 2018
    Posts:
    101
    I'm not 100% sure about this, but if you work for Unity perhaps you have a way of testing this.

    We managed to build the game by removing all the shaders (we added them all into a Shader Variant) and then build again with all the shaders.

    It makes no sense but we figure (because we tried this in a couple of PCs) it's something related to a Unity cache bug (not project cache because we re-generated the project like 5 times and even updated it).


    That's it.

    Our weird process was like:

    Build with all the shaders - Fail.
    Build with 0 shaders - Success.
    Build with all the shaders - Success.


    ¯\_(ツ)_/¯
     
    Lex4art likes this.
  18. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    Getting this in 2021.3.2f1 with built-in terrain shader:

    Code (CSharp):
    1. Shader error in 'Nature/Terrain/Standard': maximum ps_5_0 sampler register index (16) exceeded at Files/Unity/Hub/Editor/2021.3.2f1/Editor/Data/CGIncludes/TerrainSplatmapCommon.cginc(62) (on gles3)
    2.  
    3. Compiling Subshader: 0, Pass: FORWARD, Vertex program with DIRECTIONAL DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON LIGHTMAP_ON SHADOWS_SCREEN SHADOWS_SHADOWMASK _ALPHATEST_ON _NORMALMAP
    4. Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF3
    5. Disabled keywords: FOG_EXP FOG_EXP2 FOG_LINEAR LIGHTMAP_SHADOW_MIXING LIGHTPROBE_SH UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING VERTEXLIGHT_ON
    6.  
     
    DEEnvironment likes this.
  19. azganmtgo

    azganmtgo

    Joined:
    May 3, 2020
    Posts:
    12
    Same - got it after upgrading to 2021.3.2 looks like we got LTS release with a breaking bug... I think if the tech bubble bursts we might lose Unity altogether if they keep working like this.
     
  20. gillemp

    gillemp

    Joined:
    Nov 23, 2015
    Posts:
    81
    How do you build without the shaders? I do not understand what you did
     
  21. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    I'm also having this problem, a shader I've used for a long time keeps getting this error suddenly. I thought it was an amplify error.
     
  22. martin-kucer

    martin-kucer

    Joined:
    Sep 29, 2016
    Posts:
    3
    I have the same error. Any workarounds yet ???
     
  23. Liderangel

    Liderangel

    Joined:
    Jul 8, 2018
    Posts:
    101
    It appears to be an actual Unity error, and the temporary workaround until a proper fix from them was to move URP to the Packages folder and edit all the ShaderGraph shaders and leave them empty (helps with project size at least...).
     
  24. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    Still getting this with 2021.3.6f1
     
  25. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
    I'm getting this with 2021.3.7f1
    Built my Addressables Groups for the game yesterday and everything was fine. This just suddenly popped up today after I made some script changes (unrelated to shaders).
     
  26. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    If I delete 'library' this works initially, then after some time the error comes back again. What's going on? This is preventing building for Android.
     
  27. GameDevDustin

    GameDevDustin

    Joined:
    Jul 17, 2015
    Posts:
    16
    I am also having this issue with 2021.3.7f1.

    @Unity, can we get an answer on this?
     
  28. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,025
    Hi!
    It would be great if someone filed a bug report detailing the inconsistent behaviour.
    Thanks!
     
  29. Liderangel

    Liderangel

    Joined:
    Jul 8, 2018
    Posts:
    101

    Already did months ago! Case 1419725.
     
    aleksandrk likes this.
  30. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    Finding this same issue with 2021.3.8f1 building for WebGL. Works find on editor. I have not tried other builds.
     
  31. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Happened to me today in a URP project on 2021 LTS, after installing Unity Terrain tools, Removing the Unity terrain tools also removed the error.
    Lesson, don't use unity asset addons in Unity..
     
  32. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    101
    Thanks for the input, it didn't work for me, so i tried also to delete TerrainTools folder under the Library folder in the project folder and it worked for me
     
    Last edited: Dec 20, 2022
  33. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    101
    As said before, after sometime it happens again
     
  34. Samuele_Angeletti

    Samuele_Angeletti

    Joined:
    Jan 23, 2021
    Posts:
    4
    Hi, this is the full report of the bug knowing that i'm using the 2021.3.15f1 and using a texture from SampleTerrain Asset in a Terrain object (i've tried to use only One Texture but the problem stays):


    Shader error in 'Universal Render Pipeline/Terrain/Lit': maximum ps_5_0 sampler register index (16) exceeded at /Users/user/Documents/Unity/ProjectName/Library/PackageCache/com.unity.render-pipelines.universal@12.1.8/ShaderLibrary/AmbientOcclusion.hlsl(8) (on gles)

    Compiling Subshader: 0, Pass: ForwardLit, Vertex program with _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _MASKMAP _NORMALMAP _REFLECTION_PROBE_BLENDING _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT _TERRAIN_INSTANCED_PERPIXEL_NORMAL
    Platform defines: SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _CLUSTERED_RENDERING _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
     
  35. NeverWind

    NeverWind

    Joined:
    Jan 10, 2017
    Posts:
    1
    Shader error in 'Universal Render Pipeline/Lit': maximum ps_4_0 sampler register index (16) exceeded at
    .../Library/PackageCache/com.unity.render-pipelines.universal@14.0.5/ShaderLibrary/LODCrossFade.hlsl(7) (on d3d11)

    Compiling Subshader: 1, Pass: ForwardLit, Fragment program with LOD_FADE_CROSSFADE _ADDITIONAL_LIGHT_SHADOWS _DETAIL_MULX2 _EMISSION _FORWARD_PLUS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _PARALLAXMAP _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DEBUG_DISPLAY DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _DETAIL_SCALED _ENVIRONMENTREFLECTIONS_OFF _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF _SHADOWS_SOFT _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _SPECULAR_SETUP _SURFACE_TYPE_TRANSPARENT

    Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded at
    .../PackageCache/com.unity.render-pipelines.universal@14.0.5/ShaderLibrary/LODCrossFade.hlsl(7) (on d3d11)

    Compiling Subshader: 0, Pass: ForwardLit, Fragment program with LOD_FADE_CROSSFADE _ADDITIONAL_LIGHT_SHADOWS _DETAIL_MULX2 _EMISSION _FORWARD_PLUS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _PARALLAXMAP _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DEBUG_DISPLAY DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _DETAIL_SCALED _ENVIRONMENTREFLECTIONS_OFF _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _SPECULAR_SETUP _SURFACE_TYPE_TRANSPARENT _WRITE_RENDERING_LAYERS

    Shader error in 'Universal Render Pipeline/Lit': maximum ps_4_0 sampler register index (16) exceeded at
    .../Library/PackageCache/com.unity.render-pipelines.universal@14.0.5/ShaderLibrary/LightCookie/LightCookieInput.hlsl(12) (on d3d11)

    Compiling Subshader: 1, Pass: ForwardLit, Fragment program with DIRLIGHTMAP_COMBINED LIGHTMAP_ON _ADDITIONAL_LIGHT_SHADOWS _DETAIL_MULX2 _EMISSION _FORWARD_PLUS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _PARALLAXMAP _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DEBUG_DISPLAY DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_SHADOW_MIXING LOD_FADE_CROSSFADE SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _DETAIL_SCALED _ENVIRONMENTREFLECTIONS_OFF _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _SPECULAR_SETUP _SURFACE_TYPE_TRANSPARENT

    Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded at
    .../Library/PackageCache/com.unity.render-pipelines.universal@14.0.5/ShaderLibrary/LightCookie/LightCookieInput.hlsl(12) (on d3d11)

    Compiling Subshader: 0, Pass: ForwardLit, Fragment program with DIRLIGHTMAP_COMBINED LIGHTMAP_ON _ADDITIONAL_LIGHT_SHADOWS _DETAIL_MULX2 _EMISSION _FORWARD_PLUS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _PARALLAXMAP _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DEBUG_DISPLAY DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_SHADOW_MIXING LOD_FADE_CROSSFADE SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _DETAIL_SCALED _ENVIRONMENTREFLECTIONS_OFF _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _SPECULAR_SETUP _SURFACE_TYPE_TRANSPARENT _WRITE_RENDERING_LAYERS
     
  36. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    Still getting with 2021.3.15f1
     
  37. theepicmixer

    theepicmixer

    Joined:
    Jan 18, 2015
    Posts:
    7
    Hi! Getting same error in 2021.3.20f1:
    Code (CSharp):
    1. 1Shader error in 'Hidden/XFur Studio 2/URP Shells': maximum ps_5_0 sampler register index (16) exceeded at Pipeline/Shaders/CGIncludes/XFurStudio2_UniversalRPPass.cginc(12) (on d3d11)
    2.  
    3. Compiling Subshader: 0, Pass: Universal Forward, Fragment program with DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS_CASCADE _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION
    4. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING
    5. Disabled keywords: DEBUG_DISPLAY DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL USE_NORMALMAP _ADDITIONAL_LIGHTS_VERTEX _CLUSTERED_RENDERING _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF _SHADOWS_SOFT
    6.  
    7. Shader error in 'Hidden/XFur Studio 2/URP ShellsD': maximum ps_5_0 sampler register index (16) exceeded at Pipeline/Shaders/CGIncludes/XFurStudio2_UniversalRPPass.cginc(12) (on d3d11)
    8.  
    9. Compiling Subshader: 0, Pass: Universal Forward, Fragment program with DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS_CASCADE _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION
    10. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING
    11. Disabled keywords: DEBUG_DISPLAY DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL USE_NORMALMAP _ADDITIONAL_LIGHTS_VERTEX _CLUSTERED_RENDERING _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF _SHADOWS_SOFT
    12.  
    13. Shader error in 'Hidden/XFur Studio 2/URP ShellsD': maximum ps_4_0 sampler register index (16) exceeded at Pipeline/Shaders/CGIncludes/XFurStudio2_UniversalRPPass.cginc(12) (on d3d11)
    14.  
    15. Compiling Subshader: 1, Pass: Universal Forward, Fragment program with DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS_CASCADE _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
    16. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING
    17. Disabled keywords: DEBUG_DISPLAY FOG_EXP FOG_EXP2 FOG_LINEAR LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL USE_NORMALMAP _ADDITIONAL_LIGHTS_VERTEX _CLUSTERED_RENDERING _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _RECEIVE_SHADOWS_OFF
     
  38. Mushakushi

    Mushakushi

    Joined:
    Jul 5, 2018
    Posts:
    21
    Getting same errors as above in 2022.2.5f1

    Code (CSharp):
    1. Shader error in 'Universal Render Pipeline/Lit': maximum ps_4_0 sampler register index (16) exceeded at You/Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/ShaderLibrary/LODCrossFade.hlsl(7) (on d3d11)
    2.  
    3. Compiling Subshader: 1, Pass: ForwardLit, Fragment program with LOD_FADE_CROSSFADE _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _DETAIL_MULX2 _EMISSION _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS_CASCADE _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
    4. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    5. Disabled keywords: DEBUG_DISPLAY DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _DETAIL_SCALED _ENVIRONMENTREFLECTIONS_OFF _FORWARD_PLUS _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _PARALLAXMAP _RECEIVE_SHADOWS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _SPECULAR_SETUP _SURFACE_TYPE_TRANSPARENT
    6.  
    Code (CSharp):
    1. Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded at You/Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/ShaderLibrary/LODCrossFade.hlsl(7) (on d3d11)
    2.  
    3. Compiling Subshader: 0, Pass: ForwardLit, Fragment program with LOD_FADE_CROSSFADE _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _DETAIL_MULX2 _EMISSION _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS_CASCADE _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
    4. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    5. Disabled keywords: DEBUG_DISPLAY DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _DETAIL_SCALED _ENVIRONMENTREFLECTIONS_OFF _FORWARD_PLUS _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _PARALLAXMAP _RECEIVE_SHADOWS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _SPECULAR_SETUP _SURFACE_TYPE_TRANSPARENT _WRITE_RENDERING_LAYERS
     
  39. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    No one have a solution?
    what i have see if when i do build, works, if i do build & run then it breaks
     
    Last edited: Apr 15, 2023
    Ignacii likes this.
  40. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    192
    Same.
     
  41. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I'm getting

    Shader error in 'Tobyfredson/Detailed Map Coverage Moss_URP': maximum ps_5_0 sampler
    register
    index (16) exceeded at line 331 (on gles3)

    On URP build for no reason, I don't even have 4 texture samplers in my shader, doesn't make any sense the same for my other shaders!
     
  42. gnovos

    gnovos

    Joined:
    Apr 29, 2020
    Posts:
    33
    Is there a performance cost to reusing the same sampler multiple times? Why reasons would there be not to use a single sampler for a whole shader?
     
  43. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    GPUs can use multiple samplers in parallel to hide latency in the shader. If you use a single sampler the texture reads can end up being serialized.

    For example, when using separate samplers for diffuse and normal, the shader can request data from both textures at the same time. If you use the same sampler, it will first read the diffuse then read the normal, taking double the time.
     
    Last edited: Sep 5, 2023
    gnovos likes this.
  44. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    194
    As Neto suggested above if your shader is small don't bother as you will increase complexity
    if it's a large shader lots of samples ok as you get past a certain point you gain by using sampler states

    common practice
    when you use sampler state macros in a shader you should have some SS macro assigned to every sample within that shader all or nothing. You should not use a single sampler state for everything as you can break the mip chain crossing in the fragment stages. i suggest think of it in 3 SS groups and you should be safe.

    -- base color aka main tex can share with anything such as specular, smoothness, ............... except the below:

    -- normal maps should be in its own SS group

    --- anything that uses vertex offset in its own group

    cheers