Anti-aliasing on iOS

Sorry, I’ve been stuck in release land. I’ve had a quick look and there is something strange going that I wanted to make a video about hence the question earlier

Looks like it might be related to batch groups.

Once I removed the batch groups (shown in the video below in a fork project), the lightmap matches the Editor view.

It’s not perfect as shown in this frame though which is puzzling:

Looks like it is related to this issue/comment: https://github.com/playcanvas/engine/issues/2455#issuecomment-725249871

The place where it does not match could have some uv unwrapping issue and some lightmap triangles overlap in uv1 space.

Alternatively, try also changing the lightmap multiplier to give lightmaps higher resolution.

Interesting, thanks for looking into it. So you can’t use batching at all then.

Another thing: When I untick my spotlights Affect Lightmapped and tick it again I somewhat get my wanted look for the lights (maybe you have to click on bake afterwards). However they don’t translate to Play mode.


If it’s not set to auto bake, then yes, you do have to click on it to update the lightmap

It looks like the model that was imported doesn’t have UV1 maps according to the engine:

Does the FBX have the UV1 maps already configured?

Looking at the FBX in Blender, there is only 1 UV map:

are you looking at the right FBX? The one in Models/GLB schould have multiple UV Maps

I’m importing the FBX in the project. Asset id: 61281315

Looks like not every mesh has multiple UV maps (see list in post before)

That said, the list doesn’t include the mesh that is not lit so not sure what is going on there

@mvaligursky Is there any polygon/vertices cap for lightmapping?

No limits.
When a node (entity) has a mesh instance without uv1, all mesh instances on that node get skipped. But I don’t think that is the problem as the node name is reported.

Can you isolate that single mesh not getting lightmaps to investigate in isolation?

I’ve slimmed a branch on a forked project to 3 render messes, a directional light and a spot light

I DM the project and branch name

Hmm, if I disable the ground entity, it looks fine at runtime. I wonder if there’s some weird inconsistency between the editor and runtime on how shadows are processed?

I think there is something weird going on in the Editor lightmapper where it’s inconsistent on what/how it lightmaps

This is my findings so far. I believe the lightmapper previewer in the Editor has a bug somewhere where it’s ignoring the shadow being casted from the ground object sometimes.

The building being dark is correct because the upward lights are being ‘blocked’ by the ground mesh

1 Like

Wow, thanks so much for this amount of effort! Nice that you found out why the spotlights behaved so weirdly. My thought pattern was, because the spotlights were set to only affect World layer meshes my ground and baked shadow wouldn’t affect them anyway. But apparently shadow casting doesn’t check for that!

If you still have some patience left, could you take a look at my current project state? Namely why most if not all lights and shadows don’t work correctly, especially at runtime? Maybe it has something to do with the new model.

yep shadow casting does not check that as an optimization … otherwise we’d need to re-render shadow maps for each layer.
glad you got it to work

Can you be more specific about which lights and shadows are not working?

I noticed that the building is not preloaded, does it change when all the assets are preloaded first? You may need to rerunning the lightmapper when all the assets are loaded.

1 Like

The directional light doesn’t produce a shadow on the ground and the spotlights don’t affect the model at all. Is it the same for you?

There was a batch group active again, but even without it only when light mapping is inactive the spotlights work.

Video:

I overdid it on the lightmap multiplier in the video, they don’t need to be that high. If the lightmap size * the multipler = 4096, you should be in good shape.

1 Like

Ticket for the bug to do with the JSON model causing issues with the lightmapper: https://github.com/playcanvas/editor/issues/645

1 Like