Product Chat / If only GameGuru had OBJ support

Author
Message
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 21st Jan 2020 09:29 Edited at: 21st Jan 2020 11:00
Working on a program that reduces the number of vertices in models and so far works (with odd little issue, but will squash that shortly).
so far been able to reduce between 60 and 80 %.

The good thing is I can upload a character OBJ model into Mixamo and rig / animate works perfectly, output is FBX. Also works with static large or small objects which I'm more interested in (mainly large objects).
I am having a look at the Github source code and see if I can get OBJ formats to load in.

[edit-need to upload new pics as the vert counts got cut off-ugh]
[update-ok replaced pics so you can see the vertex counts (left pic is 60% reduction, right pic is original)-indices still have to be the same but they point to the unique vert and not the duplicate ones , odd issue with odd face missing due to slight program issue which I will correct later after work. Also, texturing issue but I know what that is and can fix]
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.

Attachments

Login to view attachments
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Jan 2020 18:33
do they not work as .fbx? nice job though
p.s. don't forget the LOD group
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 21st Jan 2020 18:58
Thanks smallg, at moment program takes any .dbo file and exports directly to OBJ format as a tester for now ,post vertex reduction. Will have a look at other formats also. Just a shame GG doesnt support ObJ for static objects. Will see where this goes.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Jan 2020 20:02 Edited at: 21st Jan 2020 20:04
Quote: "The good thing is I can upload a character OBJ model into Mixamo and rig / animate works perfectly, output is FBX."

ah i thought this meant you were converting it to FBX, i see you meant you can take the result to convert / animate with FBX later as an added step.. if there was a way to automate that process it might work with GG then
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Len the man
8
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 21st Jan 2020 20:38 Edited at: 21st Jan 2020 20:39
I was slightly curious why GG started to support FBX without supporting obj... Thanks for taking on this issue. It's greatly appreciated.
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 21st Jan 2020 20:39 Edited at: 21st Jan 2020 20:41
yes, thats correct, if a character DBO is processed, then the next step would be to upload to mixamo/rig and export to FBX, if it's a static object then it would be great to get the object in GG using the outputted OBJ file directly. Still doing further experimenting as I don't want to mess up the normals/UVs.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 22nd Jan 2020 01:42
@ BOTR
So, this tool will work as decimator?
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 22nd Jan 2020 07:31
@3Com- I guess in a way it's like a decimator although it doesn't at the moment reduce the number of faces/polys. This is just test code to see what happens when I reduce vertices that are duplicates and re-assigning indices that were associated with the duplictate verts with the original vertex. Some little issues at the moment due to some programming errors I need to correct.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 22nd Jan 2020 10:08
I looking forward to see what's going on.
Finally you'll end up with a suite of apps like MS office.

It looks like at present .obj file format being able to store animation info.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 22nd Jan 2020 11:07 Edited at: 22nd Jan 2020 11:09
so OBJ format doesn't support animation unfortunately (at least that I know of), I just picked OBJ format as it's an easy format than X to deal with and I can dump out a list of unique vertices and then associate the indices with the unique verts. at the moment I can convert a character to OBJ and then upload to the mixamo site / rig and then download the FBX and import into GG. I need to check whether the FBX format still retains the same number of verts/indices etc that I reduced the object to. I'm playing with code really and seeing what results, good or bad, I get and if it's useable or trash

I would like to also get some CSG cutting tools into the terrain but add that to the GG source code, whether I get the time I have no idea, but would be on my list of things to try and achieve.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 22nd Jan 2020 12:22
Quote: "OBJ format doesn't support animation unfortunately (at least that I know of)"

I am not sure about it either.

Quote: "I need to check whether the FBX format still retains the same number of verts/indices etc that I reduced the object to."

Every vertice of a face gets written here, the vertices gets split. A cube has 24 vertices in a FBX file. Interestingly Obj doesn`t split the vertices that way, but references the corresponding vertices by its index.
Here a cube just has 8 written vertices.That`s one of the reasons why a Obj file is much smaller compared to the same file written as FBX.

This makes the .obj format ideal for static objects, and honestly the .X format is becoming obsolete.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 22nd Jan 2020 15:16
I think with FBX when exported properly a cube will only have 8 physical vertices, but the file will reference the XYZ location on each each face a vertex is connected to, whereas obj just references each vertex XYZ position only.

OBj doesn't support animation as of itself, however using individual objects within the mesh and animation using key frames, you can animate OBJ models, but this would require an external control script in whatever software you want to animate in. I'm sure i read somewhere you can do it using scripts in Unity.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 22nd Jan 2020 15:26 Edited at: 22nd Jan 2020 15:28
thanks all for your feedback. interesting stuff. this may not lead to anywhere as in some cases, although there are duplicate verts, some of them have different uv coords but the normals are the same. oh well I've probably wasted some time in this maybe

I gotta update the HM2GG5.1 and then prob go back to doing some more of my model creation stuff I was doing before xmas. Not easy but fun.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 22nd Jan 2020 19:00
Am I being really dense here or what? Surely if you decrease the number of vertexes from 12,000 to 5,000 but your face count stays the same, you're just merging vertices from LOD meshes together? So really you end up with a mesh full of stacked faces and no LOD meshes.

Or is this tool literally just designed to convert .X to .Obj?

AE
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 23rd Jan 2020 07:22
I think me choosing the UBER soldier with LOD was a bad example in the first instance as at the moment my code just looks at all mesh vertices as a whole. But yes , for LOD models and models with multiple meshes , these will be grouped if I decide continue with this.
The idea really was to take static objects and see if I could optimise by reducing verts(I haven't looked at faces yet). I think it would be good to have OBJ support in GG.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 27th Jan 2020 09:42
ah yes, so I have explored OBJ animations and it is is possible as Belidos mentioned. Looking at the TGC forums it has been done using AGK so I will investigate further and knock up some code.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 28th Jan 2020 08:55
got it working for all LOD's, so will probably carry on with this.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 30th Jan 2020 16:58
Cool. I'm always impressed with this sort of stuff
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.

Login to post a reply

Server time is: 2024-04-27 03:50:23
Your offset time is: 2024-04-27 03:50:23