KhronosGroup / KhronosGroup/UnityGLTF
Shader error in 'UnityGLTF/PBRGraph'
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 536
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug 💬
Shader error in 'UnityGLTF/PBRGraph': maximum ps_4_0 sampler register index (16) exceeded at /Projects/BeijingSchool/Library/PackageCache/org.khronos.unitygltf@2.14.1/Runtime/Shaders/ShaderGraph/PBRHelpers.cginc(27) (on d3d11)
Compiling Subshader: 0, Pass: Universal Forward Only, Fragment program with _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _ALPHAMODULATE_ON _ALPHAPREMULTIPLY_ON _ALPHATEST_ON _CLEARCOAT_ON _IRIDESCENCE_ON _LIGHT_COOKIES _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _RECEIVE_SHADOWS_OFF _REFLECTION_PROBE_BLENDING _SHEEN_ON _SPECULAR_ON _SPECULAR_SETUP _TEXTURE_TRANSFORM_ON _VOLUME_TRANSMISSION_ANDDISPERSION
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
Disabled keywords: DEBUG_DISPLAY DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON EVALUATE_SH_MIXED EVALUATE_SH_VERTEX 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_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 UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _FORWARD_PLUS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT _SHADOWS_SOFT_HIGH _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SURFACE_TYPE_TRANSPARENT _VOLUME_TRANSMISSION_OFF _VOLUME_TRANSMISSION_ON _WRITE_RENDERING_LAYERS
### Steps to reproduce 🔢
1. Unity 2022.3.45f1c1 、 URP Pipeline
2. Build project
3. See console
### Files to reproduce the issue ♻
_No response_
### Editor Version 🎲
2022.3
### Render Pipeline and version
URP 14.0.11
### UnityGLTF Version
2.14.1
### Operating System 👩💻
Windows
### When does this problem happen?
- [ ] Editor Import
- [ ] Runtime Import
- [ ] Editor Export
- [ ] Runtime Export
### Additional Info 📜
_No response_
### Validations 🩹
- [X] I have [searched existing issues](https://github.com/KhronosGroup/UnityGLTF/issues): no issue already exist that reports the same problem.
- [X] I follow the [Code of Conduct](https://www.khronos.org/about/code-of-conduct)
- [X] I provided a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example), including files when necessary.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the build in Unity 2022.3.45f1c1 with URP 14.0.11, then inspect Runtime/Shaders/ShaderGraph/PBRHelpers.cginc at line 27 in the org.khronos.unitygltf@2.14.1 package. Confirm the shader compiles without exceeding the ps_4_0 sampler register limit on d3d11; the issue does not provide a minimal project or additional affected files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- unity
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100