BakedLit Shader

To chime in here, yeah, mixed lights arenā€™t fully supported right now in all cases
What you can do is set the objects that use lightmaps to Unlit at runtime, so that they end up only using the lightmap

i see. thanks for the answers! iā€™ll try them and come back with the result :slightly_smiling_face:

by user 263677777536876546

(For technical context, for proper mixed lighting basically each object needs to know which lights were used for baking for it and which not, and then render without those particular lights so you donā€™t get that duplication. Not unsolvable but we didnā€™t get to it yet)

good to know. needle is getting more and more powerful :cactus:

by user 263677777536876546

BakedMaterialShaderModifier.ts

by user 328144332622266369

The script should do what you have said, but we still get this error.

by user 328144332622266369

My guess would be your material ā€œUnlitMaterialā€ is not used in the scene and not used hence not compiled. The error says ā€œno mainā€ so ā€œexternalVertexShaderā€ is probably still empty when you assign it. You should make sure the shader has been compiled before trying to use it

Try creating a three mesh in your scene root at the top (first child) from awake for example with the unlit material (or add an object with the unlit material to your scene at the hierarchy root)
That being said: you could also just create an unlit material from code. Thatā€™s three.js MeshBasicMaterial - three.js docs
Not 100% sure if this is how @herbstā€‹:cactus: did imagine this / this is what he meant. Just saw your error briefly and wanted to explain whatā€™s happening :slightly_smiling_face:

this is what you said?
BakedMaterialShaderModifier.ts

by user 328144332622266369

the mixed spot light is still affecting the baked material.

by user 328144332622266369

Iā€™ll take a look in the next days on what a viable workaround is - weā€™ll figure this out!

hey there! any updates?

by user 263677777536876546