MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

The VertexLit shaders fail to Build in Unity for the UWP Win 10 HoloLens with light baking

Open reneschulte opened this issue 10 years ago • 7 comments

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

reneschulte avatar Apr 29 '16 06:04 reneschulte

@teichgraf thanks Rene for filing this. Do you have a proposal to fix this? Would you like to try to fix this?

NeerajW avatar May 03 '16 21:05 NeerajW

Is this being worked on or does it still make sense to investigate a fix proposal?

reneschulte avatar Jun 16 '16 13:06 reneschulte

@teichgraf do you have a proposed fix for this? Would you like to fix this?

NeerajW avatar Jun 17 '16 17:06 NeerajW

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

ignavus avatar Nov 29 '16 13:11 ignavus

@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?

StephenHodgson avatar Jan 24 '17 22:01 StephenHodgson

@dbastienMS did your recent updates fix this?

StephenHodgson avatar Feb 03 '17 15:02 StephenHodgson

New shaders have fixed this issue.

StephenHodgson avatar Aug 01 '17 00:08 StephenHodgson