PDA

View Full Version : Flat and smooth shading on game model



halvar
02-09-2011, 07:49 AM
I need to create game models for Unity3D which has parts that need to be flat shaded and smooth shaded both on the same object. I have already created different materials in Lightwave 9.6 which allowed me to render certain areas flat or smooth.
However when exporting this file into .obj or .fbx these adjustments are gone. I know that it is possible to have these adjustments saved, since blender allows using an "EdgeSplit Modifier" or using the simple "Set Smooth / Set Flat" command which applies the needed settings. These are also imported correctly in the game engine.

I have read that NewTek has solved this somehow with "Normal mapping" - however using normal maps to get this done is a complete No-Go - especially regarding the development for iPhone etc. where you have limited GPU power.

Therefore my question is, if I have missed such an "EdgeSplit" Modifier tool in Lightwave or if this adjustment is simply not possible in Lightwave?

warmiak
02-09-2011, 08:49 PM
The only way to do it is to have separate duplicate vertices at sharp edges - in other words select your "flat" parts of the model and then cut and paste in place.

The only way you can have a sharp edge is if a vertex has two sets of separate normals pointing in different directions - and since GPUs can only work with uniform vertices ( vertex1+normal1, vertex2+normal2 etc ...) , there is no other way but to duplicated vertices - their positions remain the same but their normals change.

JeffrySG
02-09-2011, 08:58 PM
Not sure if it's an option but I believe the new version of modo has features that could help you with this.
http://www.luxology.com/modo/tour/newmodelingtools.aspx

warmiak
02-09-2011, 09:32 PM
Not sure if it's an option but I believe the new version of modo has features that could help you with this.
http://www.luxology.com/modo/tour/newmodelingtools.aspx

Yeah, this will work too but ultimately they are simply a form of syntactic sugar - when exporting to a game engine smoothing groups will always end up being converted into duplicated vertices just as if you were to do it manually - there is no way around it, that's how hardware expects it.

PS.

I mention it only because people tend to get surprised when using smoothing groups and other options within 3d packages and then noticing sometimes markedly different vertex counts when rendering their models within a game engine.

Here is an example :-)
http://forum.unity3d.com/threads/25826-Vertex-count-doubled?

probiner
02-09-2011, 09:57 PM
So you want something to control what looks smooth and not? Can you use Vertex Normal maps? By exporting an OBJ, it will generate one.



Not sure if it's an option but I believe the new version of modo has features that could help you with this.
http://www.luxology.com/modo/tour/newmodelingtools.aspx
That background constrain is awsome. So many time you just want to redefine the topology, but keep the shape, and without something like this you have to tweak a lot!!
Many hot stuff for modeling going on there.

(Plan... NewTek, leave the modeling to Luxology, team up with them , just make some great layout and scene manager, you wouldn't have to run so much to do something that would be behind that, and modo would be a way more complete package and with history stack also in the modeling side... and you would be able to burry the hatchet :) and rock 3D world again *drops the weed for a second*
Imagine Modo tools + LWCAD/Trueart/Pictrix + History Stack + Edge UV Mapping + Action Centers/ToolPipes/Axis + Texture Painting + Awesome Renders Engines + Bullet Dynamics + Fully Rigged Characters + Node powa! (Dpont) + Slick Layout + 2 great communities + Actual Catmull-Clark + Particles.... CABOOM, so good it won't be truth... *facepalm*)

halvar
02-10-2011, 11:44 AM
Thanks a lot. Unwelding the specific vertices did the trick :)