This project is read-only.

Does XEN (or XNA) support Smoothing Groups?

Jun 14, 2010 at 11:26 PM

To be honest, I'm not completely sure what I'm asking here.  I'm working on a project where I'm building the engine, and another guy is doing the modelling and artwork.  Anyways, hes wondering if we have or can have that capability.

http://www.vigville.com/forum_images/SmoothingGroups.jpg

 

Basically, he said that rather than just a normal map (ex. http://media.giantbomb.com/uploads/0/5215/246594-normalmap01_large.jpg ), we would need to have a texture similar to this: http://www.tylersart.com/gallery/personal/thor_textures.jpg

Thanks, and great work with Xen, its what XNA should have been.

Jun 15, 2010 at 8:17 PM

I'm new to Xen myself, so I don't know specifically about smooth groups, other than they are a question of shading. From the look of your picture, even if you cant use them, I reckon you could get a good result from your artist's modelling software anyway, I've used subsurf to get a smoother appearance, although it does get more expensive in terms of drawing time.

Many models have more than just a normal map, the normal map is just the bumpy appearance, it's almost always accompanied by a texture, so I don't think that's a problem.

Jun 16, 2010 at 9:51 PM

I'd recommend you ask your artist to create something really simple, like half a cylinder (open at one end, closed at the other so you have 2 smoothing groups), textured with a normal map.

If using 3dsMax, export two fbx files, once with smoothing groups checked in the fbx exporter window and once with it unchecked.  Then substitute those files into the first Xen tutorial that demonstrates the material shader, or write your own test with a custom shader.  It should be a simple test to prove whether what you want is supported.

The thing is: if you look at the fbx files exported from 3dsMax, they're automatically duplicating vertices contain far more information than 3dsMax uses, meaning the smoothing group data is probably irrelevant once you export a shape.  I did the test myself (except I didn't use the resulting fbx files in Xen) and found that a 33 vertex half-cylinder was exported with 111 vertices and 460 normals (!)  When I imported the fbx files back into Max, they both reproduced the original shape.  In fact, both files were exactly identical, except checking "smoothing groups" in the exporter output a struct giving a block of numbers for the smoothing group data.  Given the history of smoothing groups (originally they were put into 3ds files because normals weren't output and they were needed to recalculate vertex normals), I really suspect nowadays they're only in the files to support the artists' tools.  With a decent exporter, the pipeline won't have to deal with them (the engine itself should never have to deal with them.)

Jun 16, 2010 at 10:00 PM

Yes. I'm pretty sure it all depends on how the mesh is exported.

I'll also note that the model importer in xen is based off the standard XNA importer - and both of them remove duplicate vertex data.
I'm not really a content guy so it's difficult to test these things. However it should work™

Cheers.