Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: Vasudan Admiral on February 17, 2011, 08:13:08 pm

Title: Ghost polygons caused by a model being smoothed!
Post by: Vasudan Admiral on February 17, 2011, 08:13:08 pm
Kazan tells me the PCS2 mantis has basically retired - but he's willing to set anyone currently supporting it as developers and an admin -> http://ferrium.org/mantis/view.php?id=94

After hours of crazy debugging I've finally found the cause of some massive collision errors I've been having lately. When it came down to it, if I set a model as faceted then it would collide correctly, but if it was set as smoothed then it would not. Here's a test pack which includes a smoothed and faceted DAE, then everything you'd need to see it in-game. (Simply load the mission and fly around inside the cylinders trying to run into the walls. The smoothed one has holes everywhere while the faceted one is rock solid)

http://www.mediafire.com/?7x2wt8j9jjacpps

This is a bit of a block to 2 models, one of which is rather...major! :(
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: z64555 on February 17, 2011, 09:37:30 pm
1. The thing is non-manifold
2. Uhhh... when I imported it to .Max, I did not see any smoothing groups at all, but it appeared smooth on the veiwer  :confused:


Which program are you using and how are you applying smoothing?



Edit:

Um... Are you sure you exported it as an OpenCOLLADA .DAE? I tried importing it into Max as an OpenCOLLADA and got weird smoothing errors, but when I imported it as an AutoDesk .DAE it showed up just fine.
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: Vasudan Admiral on February 17, 2011, 10:56:03 pm
Neatly done open-manifold should not be a problem. Both are non-manifold but only the smoothed one has collision problems. To check though I made a smoothed closed-manifold version (attached) and tested that. Same issue.

I'm using blender and it's export script for DAE- and it does smoothgroups at the most base level - by splitting the 'smooth groups' off into separate groups of polygons. (It's actually more powerful than defining smoothgroups but must be applied before exporting which often gets forgotten!).

The issue here is either going to be: how this kind of DAE stores smoothed data as opposed to faceted data, and/or how PCS2 interprets that. I can't find any pattern to what specific smoothed geometry generates the error. :(

[attachment deleted by ninja]
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: z64555 on February 17, 2011, 11:21:20 pm
There is... just, something seriously messed up with your exports...

I managed to fix the smoothing it by converting it to an editable patch and then back to a mesh, and then re-applying auto-smooth to all of the faces.
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: FUBAR-BDHR on February 18, 2011, 12:00:14 am
That seems to happen to a lot of models (especially older ones) when imported from .dae in max.  Smoothing and even UVs look bad until you convert from poly to mesh and sometimes back in max.  Heck I've had a few that were even fixed by doing a multires with no changes and collapsing.  No idea why it happens but I have not seen it on any newer models. 
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: z64555 on February 18, 2011, 12:15:33 am
I've been making the assumption that, if I can't import the .DAE into Max correctly, then importing the same .DAE into the POFCS2 will result in the collision errors that VA is experiencing...
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: Spicious on February 18, 2011, 02:19:36 am
Try a new build.
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: Vasudan Admiral on February 18, 2011, 06:03:59 am
Duuude! :O

Spicious strikes again! Bugs beware! :D

Yeah that solved the issue perfectly - what did you change?
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: Spicious on February 18, 2011, 06:57:10 am
Calculate polygon normals from the perpendicular of two sides instead of averaging vertex normals.
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: Dragon on February 25, 2011, 05:16:06 pm
Could this issue be related to missing polies in resmoothed Steve-O's fighters?
Title: Re: Ghost polygons caused by a model being smoothed!
Post by: Spicious on February 25, 2011, 06:39:17 pm
I doubt it. I think that was pretty much a BSP generation issue.