Open sagarmicronixsystem opened 3 years ago
Does your instantiating as prefab work when you make a build? It does sound like the shader stripping (look at ReadMe) or some setting in your project. Let me know.
No i have check it they are not working in builds if i instantiate that prefab , they are just working in editor after baked prefablightmap i am building it for windows
Cool, so that means it is just your settings, once you fix those it will be fine. Check the readme for the stripping modes
tried messing with lightmap modes to custom but not worked
Does you prefab still have the static flag on?
after building lightmap should i remove all flags? i am just keeping batching static of
If you leave the batching static flag it will combine meshes and mess the UVs, that's the only one you should be careful with
what should i do should i keep batching static flag on or off
You should turn it off so it doesn't combine meshes together. Let me know if that fixes it since it still might be something else
i have tried in that way too nothing works
Should i share my URP with you so that you can test it....
its just a simple test project with some baked cubes from probuilder
i have made a test on very small project the same project works in standard pipeline very well no issues in build but not working Properly in URP tried messing with all settings no luck
You need to bake (as in create actual meshes and not dynamic meshes, not bake as in lighting) your probuilder meshes or you will have issues in builds. It is a known issue with probuilder (maybe just in URP though).
Did you try including your prefabs inside your scene? In some cases this has shown if the issue persists.
Feel free to send me the test. I have done tests myself with URP and no problems so I would suspect is the probuilder assets
okay i have created one new simple scene with one plane one cube and one point light using default unity objevcts it works well for them . my question is should my mesh have separate uv channel for lightmapping because unity generate lightmap uvs dont work properly with this script for the external objects as i think so..................
I use generated lightmap uvs from unity all the time, that makes no difference for the script or the lightmaps. What I understood was that you were using probuilder meshes which will have issues, but if you transform them down to regular meshes it should be ok
i have exported that mesh and after that tried generate lightmaps uv but that case doesnt work for me.......
Can you share the mesh thats giving you issues?
there are 2 meshes i also provided texture just check once if they works fine for you
this meshes aRE EXPORTED FROM PROBUILDER
You need to bake (as in create actual meshes and not dynamic meshes, not bake as in lighting) your probuilder meshes or you will have issues in builds. It is a known issue with probuilder (maybe just in URP though).
Did you try including your prefabs inside your scene? In some cases this has shown if the issue persists.
Feel free to send me the test. I have done tests myself with URP and no problems so I would suspect is the probuilder assets
hey, how do i bake probuilder meshes, does that mean i have to not use probuilder at all?
You just need to use the "Export" to save the mesh/3d object in your project so its not a dynamic "probuilder" object and UVs are proper and good for this to work. Otherwise probuilder won't save properly to the prefabs you create.
In my project my lightmap are working fine if i am instantiating them as a prefab (Image1: Instantiating as a prefab)
but when i am building the asset bundle of that prefab and try load that asset then the lightmaps are getting misplaced: (Image 2: Instantiate from asset bundle of above prefab)
can anyone suggest me whats the issue (i am using unity 2020.3.4f1 URP)