Closed mcread29 closed 3 years ago
Are you in URP?
I'm using the HDRP
I see, there are some issues with URP and it seems now with HDRP, I need to investigate these but since these pipelines are not completely stable I am not sure what to expect. So does this happen when you instantiate by hand by drag and dropping the asset in the scene as well? how about if you instantiate in the scene where you initially baked them?
Another thing that you can try is to comment out the section in the code where shaders are reassigned
// You have to release shaders. Material[] mat = info.renderer.sharedMaterials; for (int j = 0; j < mat.Length; j++) { if (mat[j] != null && Shader.Find(mat[j].shader.name) != null) mat[j].shader = Shader.Find(mat[j].shader.name); }
This section might be conflicting with new shaders in these pipelines
It doesn't matter how or where I instantiate them, they'll appear that way until I move then and then use ctrl+z to undo the move.
I tried commenting out that section and it didn't seem to fix the issue.
I will try an HDRP project when I get a minute. Does this happen at runtime as well or only in the Editor?
Runtime as well. I tried it with my level generating at runtime as well as having the prefabs instantiated in their broken state.
@Ayfel I figured out what the issue was. I had previously had auto generate on the scene's lighting, so there were baked lightmaps for geometry that didn't exist, and clearing the baked data fixed the issue.
I was mistaken, the issue persists even after clearing the existing baked data in the scene.
I just did a sample project with HDRP and everything worked fine. So I am afraid its probably something in the setup of your project most likely
This is in 2020.3.5f1 and HDRP
Figured out the issue. My artist had said they removed all probuilder meshes, but the ones that were causing issue WERE probuilder objects. After exporting the meshes and replacing them, works perfectly! Sorry to take up your time
I'm using this script to have baked lighting on prefabs for procedural levels, and I have it working, but for some reason the lightmaps don't apply correctly until I move the object in the editor, and then use ctrl+z to move it back to it's original position.
Here's what they look like after instantiation![BEFORE MOVE](https://user-images.githubusercontent.com/19232189/116300422-bc682c80-a753-11eb-8853-a44c07865de0.PNG)
And here's what they look like after moving then undoing the move in editor![AFTER MOVE](https://user-images.githubusercontent.com/19232189/116300414-ba05d280-a753-11eb-825b-1280f76ce5aa.PNG)
I've tried including the prefabs in the scene small and out of the way but the issue still persists.