Open justinmelillo opened 2 years ago
Check the readme about the shader stripping etc as this is the most common cause for what you describe.
I tried changing the shader stripping to custom but the issue persists...any other ideas or suggestions?
Can you share a picture of what it looks like? (to check if its a wrong application of the lightmap or something else) Also what Unity version, light mode and render pipeline are you using?
Also changing to Custom are you including all modes?
This is what it looks like in browser
And this is what it looks like in editor
Using Unity 2020.3.18f1
We have a core app using Unity3D (testing in editor) and the asset bundles we're building from a template file we created in a URP project, but we deleted the URP pipeline settings so everything is using standard shaders in the prefab.
These are the settings in our prefab assetbundle file:
Our core app is set up to load the assetbundle prefabs over the web
Yes that definitely looks like the lightmaps are not being applied. Can you share a picture of your graphics settings under Project Settings? And also have you tried just putting that prefab by hand in a scene after play mode? That looks like the light is baked regularly and is not in play mode (I also notice that it looks like nested prefabs which don't work great, better to have a top prefab for this baking).
Also I recommend removing the static flag from the prefabs after having baked them, so they don't get distorted in play mode (because of mesh batching etc)
Here are the graphics settings:
And yeah this is in play mode:
I just tried moving the floor meshes directly under the root "Space" and re-baking. Then changed all meshes back to not-static, but having the same issue.
Are you baking directly from the menu of the Script or just normally?
I just ran a test baking directly from the menu of the script...it's just Assets-Bake Prefab Lightmaps, right?
Could it be something with WebGL needing lightmaps to be Non-Directional? Is there a way to specify that in your script settings?
Also - idk if you're free but I'm on discord if it's easier to hop on a quick call / screenshare: https://discord.gg/Ad7hBzCqwV
Yes, can you show me the object with the script that is the prefab? I am looking for the lightmap information in the script. Also did you try making it not a nested prefab?
Yep! The top level prefab "Space" has the script on it:
And yes, I un-nested all of those planes (and the point light) to place them directly under Space
Did you solve this problem ? I have exactly same situation
I'll need to do a test myself, I will report back once I have checked webgl
Yep! The top level prefab "Space" has the script on it:
And yes, I un-nested all of those planes (and the point light) to place them directly under Space
Did you try without assetbundles? Not that it should make a difference but just trying to gather info
I just tested in Unity 2020.3.5 with URP (and without) and in WebGL and it is working fine
When using AssetBundles you need to be careful that the project that creates the assetbundle has the same settings for the lightmaps as the one that opens it, specially this
Hello! Love this script - it's perfect as we're assetbundling prefabs. One thing though, it seems to work when we load the asset bundle in editor, but when we load in our web app, the textures turn black. Any idea what could be causing that? Thanks!