Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Triangulation problem?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
sdframpton
DeleD PRO user


Joined: 13 Jan 2008
Posts: 6
Location: Palmerston North, New Zealand

PostPosted: Wed Dec 31, 2008 1:35 am    Post subject: Triangulation problem? Reply with quote

Hi all.

I posted this question over on the RealmCrafter forum, but it was also suggested that I put it up here as well.
I've been working very slowly through some of my modeling using DeleD Pro, but have run into a minor problem that I hope someone can show me how to get around (in particular point out any mistakes that I may have made). My house model looks like this in DeleD:


However, when it has been exported using the B3D exporter plugin (which I guess also triangulates the model), the newly added edges are clearly visible in RC, and it gives a slight shadow effect in the areas that I have circled.


Is there any way to stop this from happening? It is probably something that I am doing wrong when I make my models, but it would really be helpful so I know what to avoid doing.

Thanks
Back to top
View user's profile Send private message
trucker2000
DeleD PRO user


Joined: 11 May 2005
Posts: 1839
Location: Sacramento, California

PostPosted: Wed Dec 31, 2008 2:40 am    Post subject: Reply with quote

Have you tried to optimise or triangulate your model before exporting? You can do eather or both from within deled, then export. That may/may not fix your issue.
I don't use Realm Crafter so all I can do is offer advice.
_________________
Some day I will grow up and be a real modeler.
"Never give up! Never surrender!!"
Sys specs:
asus
8 gigs ram
Invidia gtx560 video card
Windows 8 (worst op sys Ever)
Back to top
View user's profile Send private message Visit poster's website
sdframpton
DeleD PRO user


Joined: 13 Jan 2008
Posts: 6
Location: Palmerston North, New Zealand

PostPosted: Wed Dec 31, 2008 4:04 am    Post subject: Reply with quote

I had tried triangulating and then exporting before, and got the same problem except in slightly different positions.

I have just tried Optimising and then exporting and this is the result:


It seems that it is still picking up the new edges from the optimise.
Back to top
View user's profile Send private message
Starnick
DeleD PRO user


Joined: 28 Jul 2007
Posts: 611

PostPosted: Wed Dec 31, 2008 4:53 am    Post subject: Reply with quote

Can you show the mesh's geometry (e.g. the wireframe outline when you select it)? Also, make sure all your vertices are welded, its probably more of unclean geometry than the triangulator.
Back to top
View user's profile Send private message Visit poster's website AIM Address
sdframpton
DeleD PRO user


Joined: 13 Jan 2008
Posts: 6
Location: Palmerston North, New Zealand

PostPosted: Wed Dec 31, 2008 5:09 am    Post subject: Reply with quote

Okay, here are the 2 front views with the wireframe selected.
Original Model (before triangulation):


Optimised Model:


In case you would prefer to look at the models here are the dxs files in a zip (I haven't included the textures):

http://peridot-software.co.nz/b3d/mudhouse.zip

The entire model was done using extrude, csg unite, csg subtract, and a bit of smoothing on the top edges.

EDIT:
Okay, I've done a bit more checking, and have created the following model:
http://peridot-software.co.nz/b3d/cube%20subtracted.zip
which is simply a cube that has been extruded a couple of times and then had one of the bottom corners csg subtracted. This ends up with the same problem around the newly added edges from the csg operation. However the problem is only visible in RC if a light coloured texture is used (I started with one of the pale wall textures that is in DeleD). If I use the Wall06 texture (a dark brown brick) that came with DeleD, then you can't see any edges and it looks fine.
Back to top
View user's profile Send private message
mappy
DeleD PRO user


Joined: 18 Aug 2005
Posts: 340
Location: France

PostPosted: Wed Dec 31, 2008 6:59 pm    Post subject: Reply with quote

I think your problem has something to do with the way your model is displayed in RC.
I know nothing about RC but if you can set your model to be drawn "flat shaded", I think it will solve your problem.

Some app also use the term "phong" for that.
For a house model, you should use a phong of 45 degres, or something ...

Hope that helps.
_________________
OL.
Back to top
View user's profile Send private message
John
DeleD PRO user


Joined: 22 Dec 2008
Posts: 182
Location: Houston, TX

PostPosted: Wed Dec 31, 2008 10:19 pm    Post subject: Reply with quote

If Realm Crafter has antialiasing you might want to enable it, it should make the edges look less jagged.
Back to top
View user's profile Send private message
elementrix
DeleD PRO user


Joined: 11 May 2006
Posts: 1300
Location: The Netherlands

PostPosted: Wed Dec 31, 2008 11:37 pm    Post subject: Reply with quote

The problem here is that the normals of the edges around the door that should be hard are soft, DeleD doesn't support to change the hardness of an normal, you could try to find some other software that does that job or I could take a look and give you an OBJ with the right normals, however it's now 0:30 1st january here so first Im going to fire some fireworks:D
_________________
Chickens RULE | www.elementrix.nl
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
sdframpton
DeleD PRO user


Joined: 13 Jan 2008
Posts: 6
Location: Palmerston North, New Zealand

PostPosted: Thu Jan 01, 2009 6:24 am    Post subject: Reply with quote

@elementrix: Thanks for the advice. I'll have a look through some of my tools and see if I can find anything that might do the adjustments to the normals. Just out of interest, did you ever get similar problems with your models when you were using RC?

@everyone: Thanks for any help you have given, I will see if any of those options are available in RC.
Back to top
View user's profile Send private message
elementrix
DeleD PRO user


Joined: 11 May 2006
Posts: 1300
Location: The Netherlands

PostPosted: Thu Jan 01, 2009 11:46 am    Post subject: Reply with quote

as far as I can remember I didn't have any of these problems with my elementrix models, but I did have with a church once, I guess it's also the result of bad geometry/topology. Like the poly above the door is an N-gon which has 12 vertices that share the same poly. You could try to triangulate the model yourself and avoid very sharp like edges (that come together at one vertex and both edges are very long and close to each other.) You should always try to keep your model as clean as possible and keep the edges as short as possible.

For this building I would make the beams seperate objects and just place them so that they go in the building a bit. This way you will save alot of poly's and you can make some clean geometry. (the model you have now with all those beams merged with the wall is hard to get clean)

Also make sure all vertices are welded because when you have 2 edges lying on top of eachother you can never get a smooth normal there.
_________________
Chickens RULE | www.elementrix.nl
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Coty
Member


Joined: 20 Mar 2007
Posts: 30

PostPosted: Fri Jan 02, 2009 2:36 am    Post subject: Reply with quote

The polys on both side of the door are not triangles. I believe what you need to do is triangulate those polys with 4 sides, preferably from the top right of the door down to the bottom right corner of the poly on the right side of the door. This happens when not enough vertices are used to give the proper lighting (vertex lighting). In other words, triangulate those two polys on both sides of the door from the top of the door to the bottom far side of the polys. The optimized version didn't triangulate those polys correctly for proper lighting. I would do something like this / \ with the door in the middle of those two lines.Hope you understand that...

Also something called T-Junctions are needed on order to give proper lighting. That is, vertices should not end in the middle of an edge of another poly like in the first pic, because lightning is based on the vertex location and gradually tappers off as it gets further away from the vertices. Older compilers usually make their own T-Junctions when the map is compiled and lightmapped using CSG (quake half/like, etc...), but when using an editor like DeleD, you might have to do that yourself.
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sat Jan 03, 2009 5:08 am    Post subject: Reply with quote

Like stated above, the reason for the odd shading is indeed normals. DeleD doesn't support direct editing of normals, so the B3D exporter does not include any information about them in the B3D file. Apparently, RealmCrafter always calculate "smooth" normals in that case ("smooth" means "as if all edges are rounded"), which creates shading artifacts on flat surfaces like the ones in your building.

Assuming you can't change the default normal generation of RealmCrafter (and I'm pretty sure you can't), the best solution would be to add flat normals to the B3D file. I've put this on the plugin todo list (other plugins use an automatic normal generation algorithm based on a threshold angle), but for now you can perhaps try and find a 3rd party tool to edit the B3D file and add the normal information. That is, if your "darker texture" visual workaround doesn't work out.
Back to top
View user's profile Send private message Visit poster's website
jwatte
DeleD PRO user


Joined: 26 Apr 2006
Posts: 513

PostPosted: Tue Jan 06, 2009 11:15 pm    Post subject: Reply with quote

In general, you would have a crease angle, where edges less than the crease angle are smooth, and greater than the crease angle are sharp. A typical value for games is 40 degrees. If you're going to change any exporter, then doing it the crease angle way seems to be the right solution. (I didn't for the .X exporter, and I regretted it).
Back to top
View user's profile Send private message
sdframpton
DeleD PRO user


Joined: 13 Jan 2008
Posts: 6
Location: Palmerston North, New Zealand

PostPosted: Tue Jan 06, 2009 11:50 pm    Post subject: Reply with quote

@Paul-Jan: Yeah, I'm pretty sure I can change the way the b3d's are loaded, but thanks for adding this to your to-do list for the plugin. I think I can get around it for the moment with a mixture of more manual triangulation and darker textures, but it will still be very welcome when the plugin can do away with these workarounds. I will carry on having a look around for a b3d tool that can change the normals, just in case.

Thanks everyone for all the help and guidance.
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Wed Jan 07, 2009 8:28 pm    Post subject: Reply with quote

jwatte: totally agreed, I think I've put crease angle normal generation in all the recently updated exporters (over the last 1.5 years or so).
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum