Game Development Community

T3D mesh hiding: multi-mesh model lightning errors

by Peter Pedersen · in Artist Corner · 04/08/2010 (10:53 am) · 37 replies

I'm currently working on some character models with multiple meshes for use with mesh hiding.

My problem is that strange shadows appear where the models are split. I reproduced the error on a simple cylinder with straight faces:

www.wandering-willow.com/forwebforums/GG/Testcylinder.jpg
textured and normal mapped, normal mapped no texture
(the log on the ground is a single mesh for comparison.)

The vertexes share the exact same coordinates, the normals are facing the same way.
I searched the forums on the topic, but haven't found a solution yet.
It seems like the problems that occur with normal map seams and calculating the lightning, which was the only similar topic i could find.

I was wondering if I was the only one who ran into this problem with multi mesh models, or if anyone has come up with a solution for it-

Thank you
Peter

About the author

Started out on pixelpushing on the Commodore 64 and Amiga since '87 Worked with 3D modelling since 2001 so now I'm just a "fluid, lightning-fast, no hassle work flow, effortless art guy"

Page «Previous 1 2
#1
04/08/2010 (7:24 pm)
Looks like 2 separate 'smoothing' groups to me....put both mesh groups in same 'smoothing group'...see what happens then; welding may need to be done to the seam as well...
#2
04/09/2010 (12:29 am)
Thanks for the reply Rex, but there are no smoothing groups on the model and the seam can't be welded because it's 2 separate meshes in the model. The point of mesh hiding is to hide one mesh and turn on another, eg to change between 3 different head meshes on a character and keep the torso mesh the same...

I have a player character with the same light/shadow error on the neck and shoulder, and i reproduced the error in this much simpler shape to try to adress the problem from there... ;-)
#3
04/09/2010 (7:37 pm)
I understand what mesh hiding is....but I don't understand how there is 'no' smoothing groups....can you explain that part? And having no smoothing groups...to me...would replicate the shading you present in your image....

I don't know what program you're using, as you give no details....but with my 3D programs...I can put 'separate' groups into a 'single' smoothing group. I can do it on a Face by Face basis....imagine that, ;)...

I can weld two separate groups as well....

I'm sure, with your research and knowledge of mesh hiding; you'll get this sorted....;).

Good luck!

By the way; what program are you using? That might be a good starting point.
#4
04/10/2010 (7:37 am)
sorry I just didn't know that it was possible to weld 2 seperate meshes, which misled me...
I'm using Zbrush and 3DMax for chopping up the parts...
And thanks for pointing me to the smoothing groups which seems to hold the key to the solution. With all polygons in the mesh selected there are none of the 32 smoothing groups selected, -isn't that the same as no smoothing groups?
Anyway I tried to assign the polys to the same smoothing group (1)which gave the same edges. Then I assigned a new group to a single side of polys which made the edge dissapear on that side. -Seems that it's going to work with straight shapes, but with curved it takes a bit of experimenting.
I'll post some pics of my findings. (I hate when people asks questions in here, and forget to post how if a solution is found...)

Thanks Rex you've been a great help! :-)
#5
04/10/2010 (1:15 pm)
Sure thing, Gg...I'm sure Max has some good smoothing tools...have at it!
#6
04/10/2010 (1:49 pm)
Adding smoothgroup 1 to all polys on both meshes made no change (the 2 logs on the left, but the "round"/6 sided log appears smooth.
www.wandering-willow.com//Forwebforums/GG/SmoothinggroupsTex.jpgTextured, normal mapped
www.wandering-willow.com//Forwebforums/GG/SmoothinggroupsNotex.jpgNormal mapped, no texture.
Adding a smoothgroup 4 on one side of both square log meshes solves the problem and makes 2 adjoining meshes seem as one, but the round log still has the broken surface (red arrow on the two logs in the center)

Removing smoothgroup 1 from the faces with smoothgroup 4 makes all 4 sides on the rectangular log stand out perfectly, but the nice smoothness of the "round" log is gone since the smoothgroups makes edges stand out if two faces have different smooth groups.

so my problem just "shifted direction", and is only half solved.



Rex, how would you go about welding 2 separate meshes?
#7
04/18/2010 (2:30 am)
To conclude this; in 3DMax there are no way of welding 2 separate meshes, so the seams need to be hidden by other meshes or they will be visible regardless of smoothing groups, UVW mapping and textures. :-(
#8
04/18/2010 (5:45 am)
I am sorry Peter, but 3DS Max is one of a few 3D programs I don't use...I could probably do this with one of favorites, depends upon how complex it is...

May I ask; exactly what effect are you trying to achieve with 'mesh hiding', perhaps it could be done differently? Visibility animation, IFL...etc.

Oh, btw; in Max with this one single smoothing group, is there a way to alter the 'threshold'/angle for the smoothing/normals? Might try that first, adjust your smoothing group parameters larger or smaller. Again, if possible in Max.

Can't believe Max can't adjust the smoothing group data...??!
#9
04/18/2010 (12:46 pm)
Thanks for the suggestions Rex :-)
What I want to do is change limbs and/or parts of clothes on a character.

I want to be able to change between 3 different meshes for the hands, and 2 different for the lower- and upper arms. When the character has bare arms seams are visible like the example in post#6 (the single red arrow)

Would it he possible to hide part of the mesh (if it was a single mesh) by using smoothing groups?
-If the hand was group 3 the arm group 4 etc., could it be hidden codewise in T3D?

The smoothing group threshhold is just for auto assigning groups on the mesh according to face angles, it does not seem to have any effect other than that between adjoining meshes.
#10
04/18/2010 (4:29 pm)
Peter, you can weld meshes by welding their verts, bridging edges, etc.. however, the meshes must be open at the weld locations AND the must be elements of the same object.

Example about this then smooth groups..
torque.abigholeintheweb.com/public_system/useruploads/k.jpgall of the colored objects in the image are separate elements of the same object (think of this as an object set). That is when you select something in max...it can have X number of elements in 1 object or object set for the sake of this explanation.
The red: half of a sphere
white: half of a sphere
blue and green 2 elements in the same object set that are not welded
yellow, 2 elements were welded to create 1 element

Now with that information, Smoothing group exports from 3dsMax as DTS will force smooth groups to any faces that do not have a group specified. If this is not ideal to you, Collada exports normals and there is the DTS exporter pro that I recompiled with the Fyodor "Bank" changes to include exporting normals.

The key here is:
make you objects Editable poly or mesh and then attach meshes together into the same object set(not an object group) and then you can open faces and weld the chosen vertices/edges. LOADS of tutorials out there on this stuff...

am I helping you at all ?



#11
04/18/2010 (4:33 pm)
Perhaps adding this will help your idea move along..
example of losing a limb; You would need to hide the whole limb and unhide a partial limb. Making pieces and parts will not look good as you will always fight the technology behind this idea.

Hide Left Leg..Unhide Left Stump3
#12
04/19/2010 (12:51 pm)
Thanks for the illustration eb!
-The issue is that I have to keep blue and green so I can shift between blue or red and yellow or white.
It was suggested to me that I should weld the seam because this is apparently possible in some other 3D apps. In my experience with Max this is not possible, but if someone knew a trick for it It would be nice to know.
I was simply assuming mesh hiding involved multiple meshes, and was hoping for some way of welding the surface and still keep the meshes split.

I know how to weld meshes, group them and split them, but I was unaware that smoothing groups were such a pest!

The DTS exporter with the update -is it available to earlier versions of 3D max?

Limbloosing:

Yes I thought about that, the thing is, when we are talking limbs, the arm is attached to the shoulder, so where will I change the arm without the seam showing? - He most definately will not wear a bra!... ;-)
#13
04/19/2010 (4:17 pm)
ok, I was unsure if you knew about seams/meshes etc..
there are ways to go about that but in all seriousness..the concept I spoke about is the best IMO.

Example to explain that better, since you asked about it;
Of course this all depends on your player's appearance..
the player starts with a full arm, arm gets hit; full arm is hidden -> stub arm unhidden. stub-arm gets hit; stub arm hidden -> nub unhidden

This really involves nothing with shown seams depending on your character's appearance. Obviously a naked person as a player would not work very well.

What version of max do you use ?
#14
04/20/2010 (10:49 am)
Yes, but my character would have a loincloth as the base option, then different types of clothing, so the arms, upper body and neck are naked. I have a few ideas if my smoothing-group adventure is fruitless, but I wanted to be sure I wasn't overlooking some important feature or trick.

I'm very grateful for all the suggestions and help Rex and eb -It has made me test more possible solutions and I have been beating these meshes like mad, and exporting all kinds of variations to dts.

I checked the normals and they are fine, but if the exporter ignores the normals then I would really like to test the exporter pro you recompiled. I'm using max 9 though(32 bit -don't know if that matters)
#15
04/21/2010 (8:03 am)
Actually you guys are only partially correct (you are on the right track and some of your solutions are valid, but you aren't really fixing the problem, more like side-stepping it). The issue actually lies with the vertex normals.

This picture will describe it in more detail...

fosters.realmwarsgame.com/temp/segmesh_normals.jpgClick here to View image outside of the Torque Forums in case it is cut off

Top Image: A sphere where I cut a 1/4 section of it off to a new mesh. You will see the hard edge where the cut was made.

Mid Image: Displayed are the vertex normals. Pay special attention here. Notice that where the seam is, they are not pointing the same direction but instead away from one another in a "V" shape.

Bottom Image: This is the same set of meshes, but notice how there is no longer a visible seam! The meshes have not been merged or joined, they are still 2 seperate and unique pieces. What has changed is that I aligned the vertex normals along the seams to point in the same uniform direction.

So how was all this done... with the Edit Normals modifier in 3DS Max (which has been around since Max 5).

I hope that helps you guys out.

Logan
#16
04/21/2010 (10:26 am)
Thanks for your contribution Logan, your other post with these images was one of those i read before asking my questions here.
It is these normals i refer to in post#14.

I just made a ball to illustrate it.
a sphere 32 segments
converted to editable mesh
split it in the middle
selected both separate editable meshes
added edit normals modifier
averaged all normals and vertices
set up for export
imported in T3D:
www.wandering-willow.com/Forwebforums/GG/EinKugelschen.JPG
the ball rendered smoothly without the seam in max, but not in T3D, so it is likely to be the exporter which ignores the normals i set up...

What exporter do you use?
#17
04/21/2010 (11:10 am)
-I also tried welding all 64 normals by hand... the same result...
#18
04/21/2010 (5:16 pm)
I'm right on track with this, but Logan can't read my mind to see where I am going with this.( ..or can he ?? :P )

Logan's example will work but only with the pro-exporter that I compiled with Fyodor's code changes. Every other exporter ignores specified normals.

No matter the normals that you set, the regular exporter will ignore them as it only uses smooth groups. I have the pro exporter compiled with the forced normals code for exporting from Max9.
(The only other way to trick GG engines is to use collada that will force the changes into the DTS shape that is auto-compiled into DTS version25+(only T3D currently). Almost sure this idea works but I have not tested it.)

Here is the exporter with the changes !!*HOWEVER*!! !you must only have 1 dts exporter installed at a time!! Thus; remove the regular version, and install this one and vice-versa, all depending on your needs per model.

//I just compiled this because it turned out I only had a max2010 version compiled.
torque.abigholeintheweb.com/public_system/artists/exporter_related/max/dtspro_ex...


Let me know you results. Don't forget to use Logan's information and then export through this specific exporter. ..I hope I didn't miss something, it's been a long week already ;)

#19
04/21/2010 (5:19 pm)
I'm glad to know that there are at least a few people pushing the limits of this technology. ;)

3d dudes, unite!

I have to add that my concept of "switching out pieces" is pretty sane. Otherwise, you may have odd edges form the specified normals. Of course, it all depends on your specific work and art needed. blah blah blah...+:p
#20
04/22/2010 (4:17 am)
Thanks a bunch eb! testing is up when i get home from work... I'm sure this ship will land soon!
;-)
Page «Previous 1 2