unity5 为什么unity5compress lightmapss中没有东西

Unity&5.X&SpotLight无法产生阴影的问题
在unity3d中Point Spot Directional三种光都可以产生阴影的。
Point Spot 两种光在选择shadow type时,不管是hardshadow
还是softshadow都会提示:only dirctional light can have shadows in foward
rending。(5.X并没有提示)
原来在 foward rending这种渲染模式下这两种光是不能产生阴影的啊,那就只好改变渲染模式。
方法:Edit&&Project
Setting&&Player&&Per-Platform Settings&&Other
Settings && Rendering&&Rendering Path*
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Unity 4 lightmaps in Unity 5 - Unity Answers
Navigation
Unity account
You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio.
Unity 4 lightmaps in Unity 5
I'm looking for help regarding Unity UV2 Generation for lightmapping. I have a Unity 4 project that has lightmaps generated and we have to migrate to Unity 5 but reuse the Unity 4 lightmaps.
As of right now, I have been able to inject the old maps in the lightmapping system, by forcing a lightmap array and reusing each object's tiling and offset values, but UV2s are all wrong. Everything looks ok, rendering is OK, but only the positioning of the maps are off.
I tried to manually export the values of UV2 for a mesh in Unity 4 to then inject them in the Unity 5 model (first disabled the generation of UVs in Unity 5 for models), but I found out that the same model in both versions of Unity does not have the same vertex count (with the same import settings). But this is another question.
So my question is: is there any way to export the UV2 values generated in Unity 4 to Unity 5.
Thank you,
Hello all,
Yes I successfully made it work! I have Unity 4 lightmaps in Unity 5. But be aware that this is not an easy and clean solution. I'll try to explain my process as best as I can:
Start in Unity 4 by exporting all lightmapped GameObjects Meshes (those with lightmapIndex != -1 on their Renderers) on the file system in a homemade format. I personnally made a text file with separator characters. You need to export everything you will need in Unity 5 to recreate a Mesh object, so triangles, normals, tangents, sub meshes, etc, etc. This can be done with some Editor scripts looping on all of your exported scenes, then all lightmapped objects. You have to make sure all exported models have unique name, or at least they are exported uniquely.
Still in Unity 4, you must store in a component added to all lightmapped object the data needed for the lightmapping system: that is offset, tiling and lightmap Index. You can also do that with Editor scripts that loops on the scenes, then add a component to the objects, then Save.
Then, in Unity 5, you can upgrade your project. Once this is done, there is two things to do: import the exportes meshes, create new Mesh class instances, then serialize these in the object's MeshFilters components. This way, your models are not links to the Model asset in the AssetDatabase, but a serialized version of the exact data from Unity 4, including lightmaps UVs. :)
Then, you must inject lightmapping data in the multiple objects Renderers, data we stored in the components.
And last but not least, there must be code that injects the actual lightmap textures into LightmapSettings, so you must match the lightmapArray from Unity 4, also mode, etc.
You may need to turn off Static Batching options in rendering, this option seems to do weird things to the models data.
Also, your dynamic lighting may not be aware that certain objects are lit, as we are injecting stuff into the lightmapping system. You may need to work on the layers bitfield of your lights.
And lastly, your lightmap textures may need to get tweaked in their import options, to have the actual pixel perfect colors from Unity 4.
So here you go, I hope I didn't miss a step. Let me know if it helps!
I am also looking for a way to do this, I wonder if you have made progress in doing this since your post?
Have you tried using the export package to export entire scenes and see if the original settings stay? I am looking to see if lightmaps can be used specifically in a shader.
Hello! Did you get any further with this? I've been trying to manually reference the lightmaps as a regular texture, but the lightmap importer in Unity5 is perhaps more involved and seems to mean I can't use the simple constant decoding as in 4. You mentioned injecting the old lightmaps into the lightmap array - that sounds interesting, do you have any more info on that? e.g. are you editing the LightmapSettings.lightmaps array directly?
Thanks, stu
Hint: You can notify a user about this post by typing @username
Attachments: Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
41 People are following this question.}

我要回帖

更多关于 unity setalphamaps 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信