Search Unity

Maximum number (256) of shader keywords exceeded

Discussion in 'FPS.Sample Game' started by FelipeReis, Oct 24, 2018.

  1. FelipeReis

    FelipeReis

    Joined:
    Jan 27, 2012
    Posts:
    26
    Hi, i have tried opening the project and it says
    " Maximum number (256) of shader keywords exceeded" for a bunch of shaders.
    Im not sure whats going on
     
  2. FelipeReis

    FelipeReis

    Joined:
    Jan 27, 2012
    Posts:
    26
    And reopening unity solved it. hah
     
  3. DougRichardson

    DougRichardson

    Joined:
    Oct 7, 2017
    Posts:
    74
    I see the same thing after first open after clone from github: 30 "max shader exceeded" errors and 2 "cannot set mode of files in offline mode" error. If the shader error messages are to be believed, some aspects of the shaders are being disabled.

    I'm guessing the "cannot set mode" messages are due to the project being configured for Perforce.

    I'll paste the first and last "max shader exceeded" messages here:

    First message:

    Code (CSharp):
    1. Maximum number (256) of shader keywords exceeded, keyword _DISPLACEMENTLOCKOBJECTSCALE_OFF will be ignored.
    2. You will have to delete some shaders or make them use less keywords.
    3. Keywords used in project now: APPLY_FORWARD_FOG AUTO_EXPOSURE BEVEL_ON BILLBOARD_FACE_CAMERA_POS BLOOM BLOOM_LOW CHROMATIC_ABERRATION CHROMATIC_ABERRATION_LOW COLOR_GRADING_HDR COLOR_GRADING_HDR_2D COLOR_GRADING_HDR_3D COLOR_GRADING_LDR_2D DEBUG_DISPLAY DECALS_3RT DECALS_4RT DECALS_OFF DIRECTIONAL DIRECTIONAL_COOKIE DIRECTIONAL_SHADOW_HIGH DIRECTIONAL_SHADOW_LOW DIRECTIONAL_SHADOW_MEDIUM DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE DISTORT DYNAMICLIGHTMAP_ON EDITOR_VISUALIZATION EFFECT_BILLBOARD EFFECT_BUMP EFFECT_EXTRA_TEX EFFECT_HUE_VARIATION EFFECT_SUBSURFACE ETC1_EXTERNAL_ALPHA FINALPASS FOG_EXP FOG_EXP2 FOG_LINEAR FXAA FXAA_KEEP_ALPHA FXAA_LOW GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH GLOW_ON GRAIN INSTANCING_ON LIGHTLOOP_SINGLE_PASS LIGHTLOOP_TILE_PASS LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING LIGHTPROBE_SH LIGHT_LAYERS LIT_PARTICLE_FULLLIGHTING LOD_FADE_CROSSFADE LOD_FADE_PERCENTAGE MASK_OFF OFFSCREEN OUTLINE_ON OUTPUT_SPLIT_LIGHTING PIXELSNAP_ON POINT POINT_COOKIE PROCEDURAL_INSTANCING_ON PUNCTUAL_SHADOW_HIGH PUNCTUAL_SHADOW_LOW PUNCTUAL_SHADOW_MEDIUM SHADOWS_CUBE SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_SHADOWMASK SHADOWS_SINGLE_CASCADE SHADOWS_SOFT SHADOWS_SPLIT_SPHERES SHOW_FEATURE_VARIANTS SHOW_LIGHT_CATEGORIES SOFTPARTICLES_ON SOURCE_GBUFFER SPOT SSS_MODEL_BASIC SSS_MODEL_DISNEY STEREO_CUBEMAP_RENDER_ON STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON TONEMAPPING_ACES TONEMAPPING_CUSTOM TONEMAPPING_NEUTRAL TRANSPARENCY_ON UNDERLAY_INNER UNDERLAY_ON UNITY_HDR_ON UNITY_SINGLE_PASS_STEREO UNITY_UI_ALPHACLIP UNITY_UI_CLIP_RECT USE_CLUSTERED_LIGHTLIST USE_FPTL_LIGHTLIST USE_MIS VERTEXLIGHT_ON VIGNETTE WRITE_MSAA_DEPTH WRITE_NORMAL_BUFFER _ALBEDOAFFECTEMISSIVE_OFF _ALBEDOCONTRIBUTION _ALPHABLEND_ON _ALPHACUTOFFENABLE_OFF _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _ANISOTROPYMAP _AXF_BRDF_TYPE_BTF _AXF_BRDF_TYPE_CAR_PAINT _AXF_BRDF_TYPE_SVBRDF _BENTNORMALMAP _BENTNORMALMAP0 _BENTNORMALMAP1 _BENTNORMALMAP2 _BENTNORMALMAP3 _BLENDMODE_ADD _BLENDMODE_ALPHA _BLENDMODE_PRESERVE_SPECULAR_LIGHTING _BLENDMODE_PRE_MULTIPLY _COLORADDSUBDIFF_ON _COLORCOLOR_ON _COLORMAP _COLOROVERLAY_ON _DENSITY_MODE _DEPTHOFFSETENABLE_OFF _DEPTHOFFSET_ON _DETAIL_MAP _DETAIL_MAP0 _DETAIL_MAP1 _DETAIL_MAP2 _DETAIL_MAP3 _DETAIL_MULX2 _DISABLE_DBUFFER _DISABLE_DECALS _DISPLACEMENT_LOCK_TILING_SCALE _DOUBLESIDED_ON _EMISSION _EMISSIVE_COLOR_MAP _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR _ENABLEFPSMODE_OFF _ENABLESPECULAROCCLUSION _ENABLE_FOG_ON_TRANSPARENT _ENABLE_GEOMETRIC_SPECULAR_AA _ENABLE_SUN_DISK _FADING_ON _FPS_MODE _FUZZDETAIL_MAP _GLOSSYREFLECTIONS_OFF _HEIGHTMAP _HEIGHTMAP0 _HEIGHTMAP1 _HEIGHTMAP2 _HEIGHTMAP3 _HEIGHT_BASED_BLEND _INFLUENCEMASK_MAP _IRIDESCENCE_THICKNESSMAP _LAYEREDLIT_3_LAYERS _LAYEREDLIT_4_LAYERS _LAYER_MAPPING_PLANAR0 _LAYER_MAPPING_PLANAR1 _LAYER_MAPPING_PLANAR2 _LAYER_MAPPING_PLANAR3 _LAYER_MAPPING_PLANAR_BLENDMASK _LAYER_MAPPING_TRIPLANAR0 _LAYER_MAPPING_TRIPLANAR1 _LAYER_MAPPING_TRIPLANAR2 _LAYER_MAPPING_TRIPLANAR3 _LAYER_MAPPING_TRIPLANAR_BLENDMASK _LAYER_MASK_VERTEX_COLOR_ADD _LAYER_MASK_VERTEX_COLOR_MUL _LAYER_TILING_COUPLED_WITH_UNIFORM_OBJECT_SCALE _MAIN_LAYER_INFLUENCE_MODE _MAPPING_6_FRAMES_LAYOUT _MAPPING_PLANAR _MAPPING_TRIPLANAR _MASKMAP _MASKMAP0 _MASKMAP1 _MASKMAP2 _MASKMAP3 _MATERIAL_FEATURE_ANISOTROPY _MATERIAL_FEATURE_CLEAR_COAT _MATERIAL_FEATURE_COAT _MATERIAL_FEATURE_COAT_NORMALMAP _MATERIAL_FEATURE_COTTON_WOOL _MATERIAL_FEATURE_DUAL_SPECULAR_LOBE _MATERIAL_FEATURE_IRIDESCENCE _MATERIAL_FEATURE_SPECULAR_COLOR _MATERIAL_FEATURE_SUBSURFACE_SCATTERING _MATERIAL_FEATURE_TRANSMISSION _METALLICGLOSSMAP _NORMALMAP _NORMALMAP0 _NORMALMAP1 _NORMALMAP2 _NORMALMAP3 _NORMALMAP_TANGENT_SPACE _NORMALMAP_TANGENT_SPACE0 _NORMALMAP_TANGENT_SPACE1 _NORMALMAP_TANGENT_SPACE2 _NORMALMAP_TANGENT_SPACE3 _PARALLAXMAP _PIXEL_DISPLACEMENT _PIXEL_DISPLACEMENT_LOCK_OBJECT_SCALE _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_SSRAY_HIZ _REFRACTION_SSRAY_PROXY _REQUIRE_UV2 _REQUIRE_UV3 _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECGLOSSMAP _SPECULARCOLORMAP _SPECULARHIGHLIGHTS_OFF _SPECULAROCCLUSIONMAP _STACKLIT_DEBUG _SUBSURFACE_MASK_MAP _SUBSURFACE_MASK_MAP0 _SUBSURFACE_MASK_MAP1 _SUBSURFACE_MASK_MAP2 _SUBSURFACE_MASK_MAP3 _SUNDISK_HIGH_QUALITY _SUNDISK_NONE _SUNDISK_SIMPLE _SURFACE_TYPE_TRANSPARENT _TANGENTMAP _TERRAIN_8_LAYERS _TERRAIN_BLEND_HEIGHT _TERRAIN_INSTANCED_PERPIXEL_NORMAL _TESSELLATION_DISPLACEMENT _TESSELLATION_PHONG _THICKNESSMAP _THICKNESSMAP0 _THICKNESSMAP1 _THICKNESSMAP2 _THICKNESSMAP3 _THREAD_MAP _TRANSMITTANCECOLORMAP _USE_DETAILMAP _USE_TRIPLANAR _USE_UV2 _USE_UV3 _VERTEX_DISPLACEMENT _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE _VERTEX_WIND _VLAYERED_RECOMPUTE_PERLIGHT _VLAYERED_USE_REFRACTED_ANGLES_FOR_BASE _WINDQUALITY_BEST _WINDQUALITY_BETTER _WINDQUALITY_FAST _WINDQUALITY_FASTEST _WINDQUALITY_NONE _WINDQUALITY_PALM
    Last message:

    Code (csharp):
    1.  
    2. Maximum number (256) of shader keywords exceeded, keyword _UVSEC_UV1 will be ignored.
    3. You will have to delete some shaders or make them use less keywords.
    4. Keywords used in project now: APPLY_FORWARD_FOG AUTO_EXPOSURE BEVEL_ON BILLBOARD_FACE_CAMERA_POS BLOOM BLOOM_LOW CHROMATIC_ABERRATION CHROMATIC_ABERRATION_LOW COLOR_GRADING_HDR COLOR_GRADING_HDR_2D COLOR_GRADING_HDR_3D COLOR_GRADING_LDR_2D DEBUG_DISPLAY DECALS_3RT DECALS_4RT DECALS_OFF DIRECTIONAL DIRECTIONAL_COOKIE DIRECTIONAL_SHADOW_HIGH DIRECTIONAL_SHADOW_LOW DIRECTIONAL_SHADOW_MEDIUM DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE DISTORT DYNAMICLIGHTMAP_ON EDITOR_VISUALIZATION EFFECT_BILLBOARD EFFECT_BUMP EFFECT_EXTRA_TEX EFFECT_HUE_VARIATION EFFECT_SUBSURFACE ETC1_EXTERNAL_ALPHA FINALPASS FOG_EXP FOG_EXP2 FOG_LINEAR FXAA FXAA_KEEP_ALPHA FXAA_LOW GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH GLOW_ON GRAIN INSTANCING_ON LIGHTLOOP_SINGLE_PASS LIGHTLOOP_TILE_PASS LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING LIGHTPROBE_SH LIGHT_LAYERS LIT_PARTICLE_FULLLIGHTING LOD_FADE_CROSSFADE LOD_FADE_PERCENTAGE MASK_OFF OFFSCREEN OUTLINE_ON OUTPUT_SPLIT_LIGHTING PIXELSNAP_ON POINT POINT_COOKIE PROCEDURAL_INSTANCING_ON PUNCTUAL_SHADOW_HIGH PUNCTUAL_SHADOW_LOW PUNCTUAL_SHADOW_MEDIUM SHADOWS_CUBE SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_SHADOWMASK SHADOWS_SINGLE_CASCADE SHADOWS_SOFT SHADOWS_SPLIT_SPHERES SHOW_FEATURE_VARIANTS SHOW_LIGHT_CATEGORIES SOFTPARTICLES_ON SOURCE_GBUFFER SPOT SSS_MODEL_BASIC SSS_MODEL_DISNEY STEREO_CUBEMAP_RENDER_ON STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON TONEMAPPING_ACES TONEMAPPING_CUSTOM TONEMAPPING_NEUTRAL TRANSPARENCY_ON UNDERLAY_INNER UNDERLAY_ON UNITY_HDR_ON UNITY_SINGLE_PASS_STEREO UNITY_UI_ALPHACLIP UNITY_UI_CLIP_RECT USE_CLUSTERED_LIGHTLIST USE_FPTL_LIGHTLIST USE_MIS VERTEXLIGHT_ON VIGNETTE WRITE_MSAA_DEPTH WRITE_NORMAL_BUFFER _ALBEDOAFFECTEMISSIVE_OFF _ALBEDOCONTRIBUTION _ALPHABLEND_ON _ALPHACUTOFFENABLE_OFF _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _ANISOTROPYMAP _AXF_BRDF_TYPE_BTF _AXF_BRDF_TYPE_CAR_PAINT _AXF_BRDF_TYPE_SVBRDF _BENTNORMALMAP _BENTNORMALMAP0 _BENTNORMALMAP1 _BENTNORMALMAP2 _BENTNORMALMAP3 _BLENDMODE_ADD _BLENDMODE_ALPHA _BLENDMODE_PRESERVE_SPECULAR_LIGHTING _BLENDMODE_PRE_MULTIPLY _COLORADDSUBDIFF_ON _COLORCOLOR_ON _COLORMAP _COLOROVERLAY_ON _DENSITY_MODE _DEPTHOFFSETENABLE_OFF _DEPTHOFFSET_ON _DETAIL_MAP _DETAIL_MAP0 _DETAIL_MAP1 _DETAIL_MAP2 _DETAIL_MAP3 _DETAIL_MULX2 _DISABLE_DBUFFER _DISABLE_DECALS _DISPLACEMENT_LOCK_TILING_SCALE _DOUBLESIDED_ON _EMISSION _EMISSIVE_COLOR_MAP _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR _ENABLEFPSMODE_OFF _ENABLESPECULAROCCLUSION _ENABLE_FOG_ON_TRANSPARENT _ENABLE_GEOMETRIC_SPECULAR_AA _ENABLE_SUN_DISK _FADING_ON _FPS_MODE _FUZZDETAIL_MAP _GLOSSYREFLECTIONS_OFF _HEIGHTMAP _HEIGHTMAP0 _HEIGHTMAP1 _HEIGHTMAP2 _HEIGHTMAP3 _HEIGHT_BASED_BLEND _INFLUENCEMASK_MAP _IRIDESCENCE_THICKNESSMAP _LAYEREDLIT_3_LAYERS _LAYEREDLIT_4_LAYERS _LAYER_MAPPING_PLANAR0 _LAYER_MAPPING_PLANAR1 _LAYER_MAPPING_PLANAR2 _LAYER_MAPPING_PLANAR3 _LAYER_MAPPING_PLANAR_BLENDMASK _LAYER_MAPPING_TRIPLANAR0 _LAYER_MAPPING_TRIPLANAR1 _LAYER_MAPPING_TRIPLANAR2 _LAYER_MAPPING_TRIPLANAR3 _LAYER_MAPPING_TRIPLANAR_BLENDMASK _LAYER_MASK_VERTEX_COLOR_ADD _LAYER_MASK_VERTEX_COLOR_MUL _LAYER_TILING_COUPLED_WITH_UNIFORM_OBJECT_SCALE _MAIN_LAYER_INFLUENCE_MODE _MAPPING_6_FRAMES_LAYOUT _MAPPING_PLANAR _MAPPING_TRIPLANAR _MASKMAP _MASKMAP0 _MASKMAP1 _MASKMAP2 _MASKMAP3 _MATERIAL_FEATURE_ANISOTROPY _MATERIAL_FEATURE_CLEAR_COAT _MATERIAL_FEATURE_COAT _MATERIAL_FEATURE_COAT_NORMALMAP _MATERIAL_FEATURE_COTTON_WOOL _MATERIAL_FEATURE_DUAL_SPECULAR_LOBE _MATERIAL_FEATURE_IRIDESCENCE _MATERIAL_FEATURE_SPECULAR_COLOR _MATERIAL_FEATURE_SUBSURFACE_SCATTERING _MATERIAL_FEATURE_TRANSMISSION _METALLICGLOSSMAP _NORMALMAP _NORMALMAP0 _NORMALMAP1 _NORMALMAP2 _NORMALMAP3 _NORMALMAP_TANGENT_SPACE _NORMALMAP_TANGENT_SPACE0 _NORMALMAP_TANGENT_SPACE1 _NORMALMAP_TANGENT_SPACE2 _NORMALMAP_TANGENT_SPACE3 _PARALLAXMAP _PIXEL_DISPLACEMENT _PIXEL_DISPLACEMENT_LOCK_OBJECT_SCALE _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_SSRAY_HIZ _REFRACTION_SSRAY_PROXY _REQUIRE_UV2 _REQUIRE_UV3 _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECGLOSSMAP _SPECULARCOLORMAP _SPECULARHIGHLIGHTS_OFF _SPECULAROCCLUSIONMAP _STACKLIT_DEBUG _SUBSURFACE_MASK_MAP _SUBSURFACE_MASK_MAP0 _SUBSURFACE_MASK_MAP1 _SUBSURFACE_MASK_MAP2 _SUBSURFACE_MASK_MAP3 _SUNDISK_HIGH_QUALITY _SUNDISK_NONE _SUNDISK_SIMPLE _SURFACE_TYPE_TRANSPARENT _TANGENTMAP _TERRAIN_8_LAYERS _TERRAIN_BLEND_HEIGHT _TERRAIN_INSTANCED_PERPIXEL_NORMAL _TESSELLATION_DISPLACEMENT _TESSELLATION_PHONG _THICKNESSMAP _THICKNESSMAP0 _THICKNESSMAP1 _THICKNESSMAP2 _THICKNESSMAP3 _THREAD_MAP _TRANSMITTANCECOLORMAP _USE_DETAILMAP _USE_TRIPLANAR _USE_UV2 _USE_UV3 _VERTEX_DISPLACEMENT _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE _VERTEX_WIND _VLAYERED_RECOMPUTE_PERLIGHT _VLAYERED_USE_REFRACTED_ANGLES_FOR_BASE _WINDQUALITY_BEST _WINDQUALITY_BETTER _WINDQUALITY_FAST _WINDQUALITY_FASTEST _WINDQUALITY_NONE _WINDQUALITY_PALM
    5. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  4. drhodor

    drhodor

    Joined:
    Aug 18, 2013
    Posts:
    20
    Got this too -- and yes, the cannot set mode is from Unity's internal Perforce, in my experience.
     
  5. Vestergaard

    Vestergaard

    Unity Technologies

    Joined:
    Oct 20, 2016
    Posts:
    25
    Reopening is the current workaround as the keywords are reset on the second import, work is ongoing to solve this annoying issue. It should only hit you on the first import.
     
    drhodor likes this.