Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Unity - Fake Point Light

Unity shader asset that lets you create stylized fake lights! · By Lazy Eti

Shader Code Error Message

A topic by Aistify created 61 days ago Views: 71 Replies: 3
Viewing posts 1 to 2

Shader error in 'LazyEti/BIRP/FakePointLight': undeclared identifier 'SAMPLE_TEXTURE2D_ARRAY' at line 166 (on d3d11)

Compiling Subshader: 0, Pass: Unlit, Vertex program with STEREO_INSTANCING_ON ___HALO____ON

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: INSTANCING_ON SHADER_API_GLES30 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 _PARTICLEMODE_ON _SHADOWSHEAVY_ON ___FLICKERING____ON ___NOISE____ON

I think the #define SAMPLE_TEXTURE2D_ARRAY might be missing for this one
I'm not sure if this is a problem but it might be necessary for VR I believe

Developer

Hey @Aistify ! sorry I haven't received notifications and just saw this post.
I thought I already fixed this issue but I might have overlooked something on the built in pipeline end.
Could you please let me know a couple of informations:

  • Unity Version 
  • Pipeline 
  • Target Device
  • Stereo rendering mode (I'm not entirely sure if you're using VR or not from your post)

I'll take a look again and try to fix this issue

Hallo Eti
No worries. I'm actually planning to use this to create things in VRChat so VR is definetely involved

Unity Version - 2022.3.22f1
Pipeline - Buit-in rendering pipeline
Target Device - Windows PC (VRChat)
Stereo rendering mode - Single-Pass Stereo Instanced (For VR. I think destop users still use mono)

Developer (3 edits)

Hello again,  thanks for the details! I think I managed to find a fix but since I don't have a VR headset,  so I would really appreciate if you could confirm if it's working on your end.

Would you mind opening your shader file with any text editor and replacing the line 166:

return SAMPLE_TEXTURE2D_ARRAY(_CameraDepthNormalsTexture,sampler_CameraDepthNormalsTexture,uvs,unity_StereoEyeIndex);

with the following one:

return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture,uvs);

Please let me know if this works for you and I'll update the asset here and on the Unity Asset store.

Thanks!