Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: esarai on December 10, 2010, 01:29:22 am

Title: Polies dropped on POF export
Post by: esarai on December 10, 2010, 01:29:22 am
Hi everyone,

I was just recently trying to export a new model.  Import went just fine, but when I try to save as a .pof, several polygons on the wingtips disappear.  The_E requested that I post this issue in here, so here it is.  I'm using the PCS2.1 Alpha from July 18, 14:39:17.  Here's the file I was trying to convert.  http://filesmelt.com/dl/GefjonDAE.7z (http://filesmelt.com/dl/GefjonDAE.7z)  The_E said this was definitely a problem with the pof exporter, so if there's anything more I can do to help, please let me know.
Title: Re: Polies dropped on POF export
Post by: FUBAR-BDHR on December 10, 2010, 01:31:19 am
Have you tried the latest version?  That's probably the best place to start. 
Title: Re: Polies dropped on POF export
Post by: esarai on December 10, 2010, 01:42:10 am
Just did.  No dice.
Title: Re: Polies dropped on POF export
Post by: Galemp on December 10, 2010, 06:26:34 am
Were they double polies? You would need some thickness to them or they might get merged.
Title: Re: Polies dropped on POF export
Post by: Vasudan Admiral on December 10, 2010, 07:26:20 am
Linky no worky. :(
Title: Re: Polies dropped on POF export
Post by: Droid803 on December 10, 2010, 12:45:55 pm
I also had this happen to me.
Lost some polies on the left engine of the Daegon.
Title: Re: Polies dropped on POF export
Post by: pecenipicek on December 10, 2010, 03:55:14 pm
could it be maybe because the shield mesh imported absurdly smallish?


wait. WHAT?

a lot of stuff is scaled down by at least 50% in the dae you linked us all to.
Title: Re: Polies dropped on POF export
Post by: esarai on December 10, 2010, 05:55:53 pm
Alright, update time. 

I checked the source file, and the faces in question were not doubled over with anything.  I noticed that in the version on my computer, everything was the correct size upon import to PCS2, but when I handed it to The_E, he reported odd scaling differences.  I checked source again and found detail0 to have been scaled up by a factor of 2.48.  I applied scale and rotation for the mesh (aka set it to 1,1,1) and attempted to import again.  This time everything worked fine. 

While it seems as if support for objects that have non-unity scale factors has been added, I surmise that something is going wrong in that section, as unity factors do not create this problem.
Title: Re: Polies dropped on POF export
Post by: FUBAR-BDHR on December 10, 2010, 07:27:04 pm
Actually I've seen similar issues even with 2.03.  Now for the great part it only happens on Nvida video cards and not even all of them.  Have not seen the issue even once on an ATI card.   
Title: Re: Polies dropped on POF export
Post by: Zacam on December 10, 2010, 07:49:54 pm
In working with the original DAE files from mjn's missiles, the Cyclops (tech and regular) is the one that seems to like dropping polies on me the most on final save to POF.

Even if I don't go through the trouble of smoothing and resizing. No double triangles. No mesh issues that I can discern with faces or vertexes having inversions. It'll just decide that it is going to give me a hole in the model.
Title: Re: Polies dropped on POF export
Post by: Droid803 on December 10, 2010, 07:54:29 pm
Yeah, saving to PMF or whatever is fine, its just the export to POF that decides to throw out random polies.
Title: Re: Polies dropped on POF export
Post by: mjn.mixael on December 11, 2010, 07:38:37 am
I was also having this issue, but I found a way to reliably fix it. I use 3ds Max, so I use OpenCollada to export to DAE. In its options there is a checkbox that says something about triangulation. I usually leave that checked. However on the few models I had that got random holes, simply unchecking that box on export solved the problem. It worked every single time. So I'm not sure exactly what is going on through all the conversions, but it seems to me that the export to POF gets real picky about its triangles.

I also noticed the holes I got in my models weren't hole polygones, but literally just a triangle. That's what led me to the solutions.
Title: Re: Polies dropped on POF export
Post by: chief1983 on December 11, 2010, 12:20:56 pm
Triangulation doesn't have to be done in advance of PCS2 right?  I thought it happened at some point automatically down the line.
Title: Re: Polies dropped on POF export
Post by: Droid803 on December 11, 2010, 01:03:38 pm
Thing is this doesn't happen on the older versions of PCS2, only the latest ones.
Title: Re: Polies dropped on POF export
Post by: Rga_Noris on December 11, 2010, 01:55:18 pm
When working on the Hatty in Blender, this happened a few times. The way I fixed it was selecting everything and pressing control + T to triangulate BEFORE any exporting was done, leaving no triangulation up to any exporter or PCS2.
Title: Re: Polies dropped on POF export
Post by: pecenipicek on December 12, 2010, 04:03:02 pm
most collada exporters triangulate on export.





the solution is pretty much what RgaNorris said, triangulate before export, and you should be good to go.
Title: Re: Polies dropped on POF export
Post by: esarai on December 12, 2010, 08:07:31 pm
Alright, I'll do that.  I just noticed this supposedly 'clean' model actually has parts missing from the guns.  They were so small I missed them until just now. 
Title: Re: Polies dropped on POF export
Post by: Spicious on December 13, 2010, 03:01:14 am
As far as I can tell it's losing the really thin triangles. Scaling up by a factor of 100 keeps everything. I still don't know exactly where they're getting lost though.
Title: Re: Polies dropped on POF export
Post by: Talon 1024 on February 25, 2011, 08:51:19 pm
This problem is still happening on the newest builds of PCS2.  Here's an example of a model that is affected by this problem.  There are some polygons missing on the rear left engine.

I tried converting some of the triangles into quads, triangulating the model before export, scaling it up and back down again, but nothing I tried helped.

[attachment deleted by ninja]
Title: Re: Polies dropped on POF export
Post by: Spicious on February 26, 2011, 01:17:18 am
Try this (http://www.cse.unsw.edu.au/~samm/pcs2-bsp.7z). Try it with other things too and let me know what it breaks.
Title: Re: Polies dropped on POF export
Post by: Talon 1024 on March 04, 2011, 12:39:07 am
Well, I tested that build with a model that was severely broken (it lost many polygons) if I tried to convert it with a regular PCS2 build.  The model didn't lose any polygons with the new BSP build.

I also tested that build with a model that was not broken.  None of the polygons were lost, and the model collided properly.

I haven't tested the BSP build with any other models, though...
Title: Re: Polies dropped on POF export
Post by: Rga_Noris on March 04, 2011, 11:57:24 am
I have tried the build and tried to break it by making some test models without triangulating, small triangles, etc. Works fine.
Title: Re: Polies dropped on POF export
Post by: Spicious on March 04, 2011, 05:51:04 pm
The new algorithm should never drop (or duplicate) polygons. My concern is whether anything breaks in-game.
Title: Re: Polies dropped on POF export
Post by: Rga_Noris on March 04, 2011, 07:56:05 pm
Yeah, I tested them in game. As far as I can tell, nothing seemed broken.
Title: Re: Polies dropped on POF export
Post by: Spicious on March 06, 2011, 03:45:25 am
BSP build updated.
Title: Re: Polies dropped on POF export
Post by: The E on March 26, 2011, 05:51:45 am
Tested. Definitely worked in so far as models that were previously dropping polies left and right now stop doing that.
Title: Re: Polies dropped on POF export
Post by: Col. Fishguts on April 17, 2011, 03:47:29 pm
*bump*

I've got this problem now on a missile I'm working on, even when using the Feb 19 2001 build from Spicious.
The weird thing is that it only happens on the "external" variant of the missile (the one with the pylon), the actual missile model alone converts fine (see PCS2 screenshot below). It makes no difference if I triangulate the model before exporting to DAE or not.

(https://share.ols.inode.at/QXORQKA9M3KCIPV698LYCVCRR35PGYD7V3XMM9U0)

*link removed, since it's no longer relevant*
Title: Re: Polies dropped on POF export
Post by: The E on April 17, 2011, 03:51:38 pm
Have you actually tried the build with the new BSP code found here (http://www.cse.unsw.edu.au/~samm/pcs2-bsp.7z)?
Title: Re: Polies dropped on POF export
Post by: Col. Fishguts on April 17, 2011, 04:03:54 pm
Ah, I missed that link on the previous page and just clicked on Spicious' signature.
Yes, with the newer build, everything works fine.

Sorry for the herp-derp moment.