Fragment shader error on assigning lightmap to PBRMaterial

Hello guys,

I have created a new PBRMaterial like this…

Copy to clipboard

    let mat = new PBRMaterial('new',this._scene);
    mat.albedoTexture = diffuse;
    mat.useLightmapAsShadowmap = true;
    mat.lightmapTexture = lightmap;
   mat.unlit = true; 
  for(let i = 0 ; i < meshes.length ; i++)
    let mesh =result.meshes[i];
    mesh.material = mat;

I get the following error when I run the game…

BJS - [09:44:52]: Error: FRAGMENT SHADER ERROR: 0:449: ‘lightmapColor’ : undeclared identifier
ERROR: 0:449: ‘rgb’ : field selection requires structure, vector, or interface block on left hand side

Am I doing something wrong?

hey if that possible you make sample in here
and check it first then share error after you save it
we are wait you for have PG (playground ) here

Unlit PBR material + lightmaps was not supported, this PR will correct that: