PDA

View Full Version : Smoothing Groups or similar?



malteins
02-02-2014, 04:10 PM
Hi, I am having trouble with some lighting on spherical meshes when exported to Unity 3D. For more detail read my thread here: http://forum.unity3d.com/threads/225699-Lightmapping-issues-on-spherical-geometry
I have recieved an answer that says I should try using Smoothing Groups. Now I have read a few stuff about smoothing groups but it seems this is not available in Lightwave.
So I was wondering if there is a tool in lightwave 11 for editing vertex normal, maybe a plugin. Any help appreciated!

thanx

probiner
02-02-2014, 07:02 PM
Open edges. Export OBJ. That's the only way to generate Vertex Normal maps in Lw...

Lewis
02-03-2014, 01:21 AM
Yes, sadly you can't make smooth groups in LW (Lw don't have tools for creating them) so just try what probiner suggested to see is it gonna work.

Ztreem
02-03-2014, 02:10 AM
Open edges. Export OBJ. That's the only way to generate Vertex Normal maps in Lw...

Then you can load that obj back in modeler and merge points and save it as lwo, obj or fbx and your vertex normals will look like the unwelded obj exported first.

malteins
02-05-2014, 07:37 AM
Then you can load that obj back in modeler and merge points and save it as lwo, obj or fbx and your vertex normals will look like the unwelded obj exported first.

Ok guys I'll give this a try, I'll let you know how it went!
Thanx :thumbsup:

malteins
02-07-2014, 11:29 AM
Ok guys I'll give this a try, I'll let you know how it went!
Thanx :thumbsup:

Hi, so I have come to a better outcome by following your suggestions of opened edges and exporting as .obj and then re-importing, nevertheless there's still some problems with how the baked lighting is acting on spherical objects.

119961

As you can see, I have horizontally based opened edges. Maybe this is not the way to go, one might also think that only 1 vertically based open edge could provide better results.

MarcusM
02-07-2014, 11:45 AM
Can you post zip with unitypackage? (Object as fbx exported from Layout)

malteins
02-08-2014, 05:10 PM
Can you post zip with unitypackage? (Object as fbx exported from Layout)

Hi, sure here's the file exported from Layout in .fbx format (2012).

http://m1.malta.cl/tester.zip

I've been using this method (.fbx export from Layout) since I started using Unity with Lightwave. I've read this is the way to go. Anyway I realized that spherical meshes have problems with Lightmapping, hence this thread started and I was recommended to export in .obj format in order to get the Vertex Normals to show up correctly. I've tried this but still not getting correct results which you can see here:

119988

As you can see in the image, when I show the Lightmapping resolution grid it gets distorted in some areas ( the squares don't match up ), so I'm thinking this is happening because of a wrong UV mapping method I'm using, basically the UV mapping on the spherical part of the mesh. Here is an image where you can see how I have set up the UVs.

119989

Now I am wondering what I could do to fix this issue. I am thinking this might have to do with the 2nd UV channel that is used for Lightmapping. I don't know if UV2s are editable in Lightwave, I've heard a few other apps let you do it.

Well any guidance, tips or ideas you might have, all are very welcomed.
Thanks a lot to all of you guys who have already helped!! :thumbsup:

XswampyX
02-08-2014, 06:30 PM
What does this one look like in unity?

MarcusM
02-09-2014, 03:50 AM
I mean Unitypackage that means when you create prefab then click on it RMB and create unitypackage.
Unity making own UV for lightmapping, what you know, if in importer you turn on this. When you have two your own UV on object you can use one for lightmapping. In object importer is option "swap UV".
http://docs.unity3d.com/Documentation/Manual/LightmappingUV.html

malteins
02-09-2014, 06:36 PM
I mean Unitypackage that means when you create prefab then click on it RMB and create unitypackage.
Unity making own UV for lightmapping, what you know, if in importer you turn on this. When you have two your own UV on object you can use one for lightmapping. In object importer is option "swap UV".
http://docs.unity3d.com/Documentation/Manual/LightmappingUV.html

Ok, here you can download the zipped unitypackage of the object in question : http://m1.malta.cl/unitypack.zip
1) I exported my model from Modeler into Layout,
2) then exported it from there to .fbx,
3) afterwards importing it to Unity and making a prefab,
4) which I exported then as a UnityPackage.

Anyway you'll be able to see what I've been mentioning in the pictures, there seems to be a problem whenever I lightmap a spherical mesh. I really tried many options but still no luck.
Hope you can find some indication of the problem with this package.

Thanks!

malteins
02-09-2014, 06:46 PM
What does this one look like in unity?

Hi, I've tested your version but I am still getting the same artifacts and strange shadings on the spherical part of the mesh.
In the image you can see what I'm talking about, I've placed your model in the scene and ran Lightmap. That's all.

120004

Anyway, thanks for your help, I do think we're getting closer to solve this.

MarcusM
02-10-2014, 01:41 AM
I think i found what was wrong.
Chek your lightmap (also in preview) when in model imporetr setting will be scale 0,01 and 1. There should be always 1.

In layout export scale should he 0.01, in Modeler 1.0.

Check also this great plugin for lightmapping with image-based lighting, Path Tracer GI, and Monte Carlo GI.
https://github.com/mstevenson/Lightmapping-Extended

And maybe you try bake texture, then object on scene not must be static.
http://forums.newtek.com/showthread.php?134461-Tip-Tutorial-Bake-textures-UV-borders-prepare-in-PS-Unity&highlight=texture+baking

malteins
02-10-2014, 02:47 PM
I think i found what was wrong.
Chek your lightmap (also in preview) when in model imporetr setting will be scale 0,01 and 1. There should be always 1.

In layout export scale should he 0.01, in Modeler 1.0.

Check also this great plugin for lightmapping with image-based lighting, Path Tracer GI, and Monte Carlo GI.
https://github.com/mstevenson/Lightmapping-Extended

And maybe you try bake texture, then object on scene not must be static.
http://forums.newtek.com/showthread.php?134461-Tip-Tutorial-Bake-textures-UV-borders-prepare-in-PS-Unity&highlight=texture+baking

Hi, thanks for the links, I was already aware of Lightmapping Extended, I use it pretty much all the time. Also I have done what you say about the scale, I always export from Layout at 0.01 and then in Unity set the import settings to 1.
Anyway I really don't think the problem has to do with the import o export settings, since I have applied different smoothing groups in Modo 701, exported the model as .lxo
and still I get the same artifacts and shading problems with the spherical part of the mesh when Lightmapping the object in Unity. You can see this here:
120029
In the image the mesh has a .lxo file extension, exported from MODO with a Vertex Map. You can still see the problems that I had before at the beginning of the thread.

I think this problem is due to the way I set up my UVs. You can see them here:
120031
Any suggestions, maybe I should have mapped the spherical top portion of the cylinder with "Planar on the Y-axis (top down)" ?

Thanks in advance

MarcusM
02-10-2014, 03:12 PM
I tested this today, baked lightmap with import scale in Unity 0,01 and saw problem from your images. After bake with scale 1 it was good. Tomorrow i will check this one more time and attach print screens.

MarcusM
02-11-2014, 12:58 AM
Now you can see difference between importer scale 1 and 0,01.

malteins
02-11-2014, 06:09 PM
Now you can see difference between importer scale 1 and 0,01.

Yes, I agree with you, the scale of the imported object changes the way the surface is smoothed out. I now see what you were saying before.
On other hand I also came to a solution, which I had overlooked! I disabled "Generate Lightmap UVs" in the inspector tab of the mesh in question.
Here I leave you with the image that shows the difference between enabling a disabling the "Generate Lightmap UVs" feature:

120118

As you can see in the image above, both meshes are the same, but the one on the left has "Generate Lightmap UVs" disabled, and the one on the right has it enabled.
The shading looks a lot better on the left and has a lot less artifacts. I need to mention that the mesh is exported from Lightwave 3D Modeler in a .obj filetype and imported directly into Unity with the following settings.

120119

Well I think this solves my problem, hope other people have found this information useful, well maybe a bit lame that I forgot to check a primary setting, but from time to time one tends to forget things a bit. Thanks to all who have collaborated on this topic.

:thumbsup: