Shader error - Polyspatial Lighting node - Reflection Probes

Hi PolySpatial Team,

I get an shader error when i try to use PolySpatial lighting node with Reflection probes enabled.

This error only comes up if I use Reflection Probes Setting set to either Simple or Blended.

Shader error in ‘Shader Graphs/Master’: undeclared identifier ‘polySpatial_SpecCube0’ at line 361 (on metal)
Compiling Subshader: 0, Pass: Universal Forward, Fragment program with _ADDITIONAL_LIGHTS
Platform defines: UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_NO_DXT5nm 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_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING 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 _ADDITIONAL_LIGHT_SHADOWS _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 _FORWARD_PLUS _LIGHT_COOKIES _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT _WRITE_RENDERING_LAYERS

Is there any additional setup required in the shadergraph which is not documented?
When i declare the identifier polySpatial_SpecCube0 as cubemap, it solves this error.
However I get an new error:

Shader error in ‘Shader Graphs/Master’: undeclared identifier ‘polySpatial_SpecCubeWeight0’ at line 959 (on metal)

However declaring a float with polySpatial_SpecCubeWeight0 doesn’t work.

Polyspatial 0.5.0
Unity 2022.3.12f1
Shadergraph 14.0.9

This appears to be a bug that occurs when reflection probes are enabled but baked lighting is set to “None.” We’ll add a fix for that, but in the time being, you may be able to set baked lighting to “Light Probes” to get around this. By modifying the Environment Lighting in the Rendering → Lighting dialog (specifically, setting the Intensity Multiplier to zero), you can remove any actual contribution from the default light probe.

1 Like

@kapolka ok, thank you for the workaround. this work.
However we have discovered in shadergraph that leaving a Texture2D Input empty is not getting replaced with an default white texture. Instead the Texture2D Sample in Realitykit comes out as pink color instead of white color.

However we need this default mode feature, since we are basically recreating the Lit shader behaviour in shadergraph to have either the option to plugin a base color or an base texture. without having to do things like shader #if conditions (branching).

I believe that there’s a bug with default textures at the moment, but it should be fixed in the next bugfix release.

1 Like