The VertexLit shaders fail to Build in Unity for the UWP Win 10 HoloLens with light baking
The HoloToolKit VertexLit shaders fail to Build in Unity for the UWP Win 10 HoloLens target when light baking is turned on:
Error building Player: Shader error in 'HoloToolkit/Vertex Lit Configurable': invalid subscript 'texcoord1' at Assets/HoloToolkit/Shaders/VertexLitConfigurable.cginc(67) (on d3d11)
Compiling Vertex program with DIRECTIONAL SHADOWS_OFF LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_OFF Platform defines: UNITY_NO_SCREENSPACE_SHADOWS UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF3 UNITY_HARDWARE_TIER1
@teichgraf thanks Rene for filing this. Do you have a proposal to fix this? Would you like to try to fix this?
Is this being worked on or does it still make sense to investigate a fix proposal?
@teichgraf do you have a proposed fix for this? Would you like to fix this?
I am no shader expert by any mean, but I encountered this, as I far as I understand the texcoord1 is the texture of the lightmap that will be sent to the shader along with its normal texture in the case of having lightmap enabled The problem is while texcoordis that texcoord1 is not defined in the appdata_t struct in the file "VertexLitConfigurable.cginc" so when trying to access it while having baked GI enabled it results in that error, when I added the following lines to the file after the definition of texcoord. it worked fine
struct appdata_t
{
float4 vertex : POSITION;
#if _USEMAINTEX_ON || _USEEMISSIONTEX_ON
float2 texcoord : TEXCOORD0;
#endif
#ifndef LIGHTMAP_OFF
float2 texcoord1 : TEXCOORD1;
#endif
float3 normal : NORMAL;
};
Again I am no shader expert, and this may cause bugs I am not aware of
@teichgraf, there was some shader updates recently. Has those updates resolved this issue?
@ignavus Would you be willing to submit a PR with those fixes you've detailed?
@dbastienMS did your recent updates fix this?
New shaders have fixed this issue.