![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#76 | |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]() Quote:
The first subobject (on material) is: - 7517 vertices - 7517 vertex normals - 7017 texture coordinates - 5496 faces In privateers export however it is: - 351977 vertices - 351977 vertex normals - 351977 texture coordinates - 5496 faces What?? Why export a massive array of which you only use 2% of data? For the next subobject, he exports the same vertices, the same texture coordinates, the same normals, only the face-assignment obviously differ... That's roughly 30MB of extra data, for each next subobject, data you don't need because it's already written once in the file. I don't want to stomp on privateer's work, but not reusing the vertex, normal and texture arrays is bad coding. No wonder the file is so big. It should be not much more than 1/9th that size for this entire OBJ-file (and that's just an estimate, it might be even smaller). Here's an image: ![]() To import this I cut off all subobjects trailing the first. The resulting OBJ-file was 30 MB. After import I got the above. Exporting it again from S3D resulted in an OBJ-file of 856KB !! That's 97% less bytes. Then there's the subject of S3D failing on this file reporting 350K vertices, but that makes sense since DAT-files can't hold models larger than 65K vertex indices and 65K-texture indices. Splitting the object up removes the problem as an object of 7517 vertices as per example above clearly is not a problem for S3D/DAT. Anyway, I've looked into GR2 files myself and have written code for it in april too (to analyze), so it was an honest suggestion that it can be done and is much easier. It doesn't matter in the end, it's privateer's project, and I appreciate his work (glad he does so), and if he continues on the OBJ-path I hope he can improve it further (also based on the above analysis) or perhaps he already knows. In the end it does not matter, even if he does not improve on the above, you can break the model up in a 3D studio, or by hand in notepad like I did, and after import in S3D it will drop any unused data (Pack3D won't). Regards, skwas
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO Last edited by skwasjer; 08-15-10 at 06:47 PM. |
|
![]() |
![]() |
![]() |
#77 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
Nice post skwasjer,
![]() Yes I am aware of the exporter doing that. It's the old code I'm building off of that's looping garbage. It will get corrected in a later release. That's why I said this is only a teaser release. I'm not a super programmer by any means. I'm more a stumble through it and get lucky programmer. ![]() |
![]() |
![]() |
#78 |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]()
I didn't mean to put you down on the coding end, but as Anvart posted this info of an OBJ file of 600MB and S3D throwing an (obvious) error I scratched my head and had to take a look, because that big didnt make any sense. We'd be dealing with models of 50 to 100 million vertices.
You're doing ok sofar. ![]()
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO |
![]() |
![]() |
![]() |
#79 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
I didn't take it that way at all Mate.
![]() I did fix the bad loop and that 600 meg file comes out at just over 51 megs now. If I dropped the normals it would be smaller. Around 38+ megs. |
![]() |
![]() |
#80 | |
Admiral
![]() Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
|
![]() Quote:
![]() At last i have seen the constructive answer... I suspected not optimised creation of obj-file too... but i wanted to see your answer. ![]() ... ![]() ... and Granny Viewer's info about... ![]()
__________________
Alex ® ![]() Moses said: "Don't create yourself an idol"... Last edited by Anvart; 12-26-12 at 03:12 AM. |
|
![]() |
![]() |
![]() |
#81 |
The Old Man
![]() Join Date: Aug 2006
Location: Mountain Ash, Wales, U.K.
Posts: 1,548
Downloads: 179
Uploads: 3
|
![]()
I can't understand a word you guys are talking about in this thread, but it looks important
![]()
__________________
***THE GENERAL*** |
![]() |
![]() |
![]() |
#82 | ||
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]() Quote:
![]() Quote:
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO Last edited by skwasjer; 08-16-10 at 04:17 AM. |
||
![]() |
![]() |
![]() |
#83 | |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]() Quote:
![]()
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO |
|
![]() |
![]() |
![]() |
#84 |
Admiral
![]() Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
|
![]()
Why you have supposed it?
![]() ... My EN is difficultly understood (or not is understood completely)...?
__________________
Alex ® ![]() Moses said: "Don't create yourself an idol"... Last edited by Anvart; 08-16-10 at 11:15 AM. |
![]() |
![]() |
![]() |
#85 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
Dropping the loop puts all objects in one mesh again.
But I'm looking at a function to make the loop optional, to break the objects up, then filter out the unused verts. The VGC library is what I'm looking at to do the filtering. I've found no good way yet to do it differently. There's no pointer I have found to break them up without the extra garbage. ![]() |
![]() |
![]() |
#86 |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]()
You do not need to filter the vertex/uv/normal list yourself, just drop it in the first section of the file like you already have, and then you can break up the file in subobjects with an g-token... Then you can use the same vertex/uv/normal list, still all in one big file. This is equaly valid as putting shorter lists of vertex/uv/normals before each face list (although the latter would be a little better to read visually).
v x,y,z .. .. vn x,y,z .. .. vt u,v(,w) .. .. g object1 (usemtl) f vi/vti/vni etc... .. .. g object2 (usemtl) f vi/vti/vni etc... .. ..
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO Last edited by skwasjer; 08-16-10 at 06:26 AM. |
![]() |
![]() |
![]() |
#87 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
I understand the 'g object' command.
What I have not found is a way to break the list down in the GR2 files. They are packed as one long list. (That's why the loop) I've not found a pointer as to where to break this list. ![]() |
![]() |
![]() |
#88 |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]()
You don't have to is what I am saying. You just write them all out only once at the top of the file, and then loop all subobjects and write them out. That should do, afaik. Did you already try this, and/or does this give specific problems?
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO |
![]() |
![]() |
![]() |
#89 |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]()
Or do you mean there are no subobjects in that one big mesh? In that case you could do a split on material (I think Anvart suggested this too). This is also what I did in my example above.
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO |
![]() |
![]() |
![]() |
#90 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
I can split the Tri-Groups as there are pointers as to where to break them.
The materials are then linked to those. But I've found no link to the Verts, Normals, Textures listing. It's one long chain. So no sub objects. If it's in the Extended Data? I have not spotted it yet. I've also not extracted any data from the extended section yet. It's not placed in the GR2 like everything else. ![]() Now I have to go to my real job. ![]() That gives me all day to ponder on things. ![]() |
![]() |
![]() |
Tags |
edit the gr2 |
|
|