Author Topic: G3dHack - alpha9  (Read 15085 times)

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
G3dHack - alpha9
« on: 7 May 2011, 13:20:08 »
Greetings.

  In light of the fact that exported animations export the same number of key-frames for every mesh in a model, including completely static ones; most meshes have lots of duplicate vertices; and, perhaps worst of all, all meshes are marked as two-sided, this new tool may be of interest to modders.

G3dHack & G3dScan - Alpha9

This is a .NET app, windows folks should be able to run it 'out of the box' (if not, make sure .NET is up to date). People on linux need mono and mono.winforms, it runs fine on linux, and should also do so on mac, but does suffer some GUI issues.
« Last Edit: 29 June 2011, 00:35:58 by silnarm »
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Psychedelic_hands

  • Guest
Re: G3dHack - alpha3
« Reply #1 on: 7 May 2011, 13:53:25 »
When I try to start the hack I get this message. Though it still starts, I am unable to load nuthin'.
Quote
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
GlestLib
    Assembly Version: 0.2.1.5
    Win32 Version: 0.2.1.5
    CodeBase: file:///C:/Documents%20and%20Settings/Liam2.STUPID/My%20Documents/G3dHack/GlestLib.DLL
----------------------------------------
OpenTK
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.278.44921
    CodeBase: file:///C:/Documents%20and%20Settings/Liam2.STUPID/My%20Documents/G3dHack/OpenTK.DLL
----------------------------------------
OpenTK.GLControl
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.278.44921
    CodeBase: file:///C:/Documents%20and%20Settings/Liam2.STUPID/My%20Documents/G3dHack/OpenTK.GLControl.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
:scared:

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: G3dHack - alpha3
« Reply #2 on: 7 May 2011, 15:06:31 »
I'd just like to say, whatever version you gave me silnarm, it worked as well as you said it would!
Egypt Remastered!

Proof: Owner of glest@mail.com

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3dHack - alpha3
« Reply #3 on: 7 May 2011, 17:33:49 »
Works like a charm! Nice work!
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: G3dHack - alpha3
« Reply #4 on: 7 May 2011, 18:10:00 »
Does not work for me !

(click to show/hide)
« Last Edit: 8 May 2011, 00:45:01 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: G3dHack - alpha3
« Reply #5 on: 8 May 2011, 08:42:14 »
I've had people struggling to run what I write in python too.

How about making tools in javascript - host on github using gh-pages.

Drag and drop wand then download to save works great clientside.

Chrome native client is also promising.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: G3dHack - alpha3
« Reply #6 on: 8 May 2011, 09:23:26 »
I uploaded an alpha4, then saw wciows error... same as the one John got on linux, and hailstone on linux-in-a-window. Don't know why I didn't think of it then, but I have replaced the seemingly offending function calls with ones that do the same thing, but have a different name (?!) Fingers crossed this solves the EntryPointNotFoundException.

http://sourceforge.net/projects/glestae/files/tools/G3dHack-alpha5.7z/download

How about making tools in javascript - host on github using gh-pages.

... it seems completely crazy, but with what can be done these days, may just be a good idea.

Somehow I don't see being quite so easy as using the VS form designer though  :P
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Psychedelic_hands

  • Guest
Re: G3dHack - alpha5
« Reply #7 on: 8 May 2011, 10:40:28 »
Wow, this is awesome! It's so much better, thanks!
Alpha 5 is working, but on a diffferent computer. I will test again on my other computer later.

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: G3dHack - alpha5
« Reply #8 on: 8 May 2011, 11:12:14 »
Alpha 5 works for me as well  :thumbup: This is like G3DViewer 2.0.  :O

Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Psychedelic_hands

  • Guest
Re: G3dHack - alpha5
« Reply #9 on: 8 May 2011, 11:16:13 »
I think the word viewer doesn't do it justice  :P.  G3D editor?

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: G3dHack - alpha5
« Reply #10 on: 8 May 2011, 14:40:26 »
Worked for me in ubuntu when run from a prompt - silently didn't show a window when doubleclicked from a file manager

(installed the winforms debs in the package manager)

What kind of features did you have in mind for the optimisation?

Does merging near vertices cope with the impact on normals that might result?

An auto-normal tool would be most useful if incorporated.

Also, by using colour picking and a lot of rendering and picking passes, you could perhaps determine which faces are never visible (as models are never drawn from the bottom) and that would prehaps remove the most faces from a mesh.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3dHack - alpha5
« Reply #11 on: 8 May 2011, 18:56:46 »
Also a very minor bug: the animation menu does not work, though the stop and play buttons in the main window do.

Also, if you set a specific mesh to look like something else, eg: wireframe, they aren't rendered until you move the model.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: G3dHack - alpha5
« Reply #12 on: 8 May 2011, 21:43:16 »
An option to flip the normals on a mesh would be useful.  There are a few in Woodsmen that have to be double-sided because otherwise they'd be inside-out.  Ditto for Dwarves, but presumably someone still has the source files and can fix those, as opposed to Woodsmen which are apparently lost forever. :(

Oh, and PS: The program works for me now.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: G3dHack - alpha6
« Reply #13 on: 9 May 2011, 11:16:17 »
Alpha6 - adds 'view normals' and 'flip faces' function.

What kind of features did you have in mind for the optimisation?

Whatever's there now :P With anything else that needs fixing that might come to light. Mostly the redundant animation frames you first brought to our attention, duplicate vertices which seem rather common, and the ability to turn off the two-sided flag.

The last one is fairly big, because it effects every blender exported model. It doubles the number of triangles send down the pipe, in a best case scenario the front faces will have been rendered first and the fragment processing for the back faces on the other side of the model will be averted by a depth test failure, in the worst case all the back facing ones come first and the fragments are all processed, only to be overwritten when the front faces are rendered.

On average, for a(n opaque) blender exported model, there is 50% more fragment processing than is needed.

Quote
Does merging near vertices cope with the impact on normals that might result?

An auto-normal tool would be most useful if incorporated.

If you use a non-zero tolerance for normals when welding, the 'merged' normal will be the average of the unique normals merged. I went with this policy because if you are using non-zero tolerances it is because you were sloppy with your modelling, and this seemed the most sensible (ie, if 4 vertices were merged but two were really just the same vertex, then the normal wouldn't be skewed because of the double).

Quote
Also, by using colour picking and a lot of rendering and picking passes, you could perhaps determine which faces are never visible (as models are never drawn from the bottom) and that would prehaps remove the most faces from a mesh.

Interesting idea, I would hope the artist removes such faces in the first place though, while the brute force solution you propose would work nicely, it would take some work to get running.

Just checking the face normal could eliminate blatantly downward facing ones, but your idea would get any hidden geometry too...

Also a very minor bug: the animation menu does not work, though the stop and play buttons in the main window do.

Also, if you set a specific mesh to look like something else, eg: wireframe, they aren't rendered until you move the model.

The animation menu was actually a relic, from before when the Animation control in the main window was built. Removed it.

The refresh bug should be fixed now.

An option to flip the normals on a mesh would be useful.  There are a few in Woodsmen that have to be double-sided because otherwise they'd be inside-out.

Done, you can't actually see any effect from normals atm though ;) No lights yet. Front facing Vs Back facing is determined by the 'winding order' of the triangles, I've added a 'show normals' like the g3d has to the RenderMode menu, and 'Flip faces' to the Mesh menu.

If the faces are pointing the wrong way after turning off the two sided flag, they need their winding reversed. If they need this, then the normals are almost certainly pointing the wrong way too, so both reversing the winding and flipping normals is the default and probably correct thing to do, but I made the seperate options just in case.

Quote
Oh, and PS: The program works for me now.

 :thumbup:
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
Re: G3dHack - alpha6
« Reply #14 on: 10 May 2011, 19:57:48 »
I am just curious, why is it no option to load the g3ds in blender and correct those things?
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: G3dHack - alpha6
« Reply #15 on: 10 May 2011, 20:04:42 »
Yes, fixing the blender export script and also incorporating level-of-detail filtering and such at source in blender seems a good approach rather than this post-production band-aid?

(Not that I don't see the appeal in writing code to play with models; have fallen into that trap myself several times, most recently here (please upvote, someone at google might eventually read: http://news.ycombinator.com/item?id=2533069 )

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3dHack - alpha6
« Reply #16 on: 10 May 2011, 21:41:30 »
Got an error when setting G3D Scan to Military's path:
Code: [Select]
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.set_Item(Int32 index, T value)
   at Glest.Graphics.Mesh.FindUnrefedVerts() in D:\gae\Glest#\GlestLib\Graphics\Mesh.Optomise.cs:line 166
   at G3dScan.ScanDirectoryForm.EvaluateG3D(String fullPath, String relPath, StringBuilder sb) in D:\gae\Glest#\G3dScan\ScanDirectoryForm.cs:line 40
   at G3dScan.ScanDirectoryForm.btnEval_Click(Object sender, EventArgs e) in D:\gae\Glest#\G3dScan\ScanDirectoryForm.cs:line 111
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5444 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
G3dScan
    Assembly Version: 0.1.1.2
    Win32 Version: 0.1.1.2
    CodeBase: file:///C:/Users/user/Desktop/G3dHack/G3dScan.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
GlestLib
    Assembly Version: 0.2.1.7
    Win32 Version: 0.2.1.7
    CodeBase: file:///C:/Users/user/Desktop/G3dHack/GlestLib.DLL
----------------------------------------
OpenTK
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.278.44921
    CodeBase: file:///C:/Users/user/Desktop/G3dHack/OpenTK.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

As well, the refresh bug still seems to be in Alpha 6.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: G3dHack - alpha6
« Reply #17 on: 21 May 2011, 22:12:49 »
Awesome! Wish it had particle,  screenshots, and gif support though. Or maybe you've already added that. Who knows? :P

ChupaReaper

  • Guest
Re: G3dHack - alpha6
« Reply #18 on: 23 May 2011, 12:04:42 »
This tool is excellent though it would be really useful for my mod if it could scale animations frames (adding new frames from interpolation or reducing the amount of frames whilst trying to maintain the animation). Also some batch options (load a group of models, open one, edit it and apply the edits to all other models).
Also I see that the texture can be changed, if batch options where to be implemented could an option to change all texture extensions be added too (so I can get rid of all my tgas for pngs).
A lot of features asked for here lol but this tool is excellent and definitely replaces my G3D Viewer.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3dHack - alpha6
« Reply #19 on: 24 May 2011, 00:34:16 »
if batch options where to be implemented could an option to change all texture extensions be added too (so I can get rid of all my tgas for pngs).
And while we're at it, resizing textures (and possibly fixing the texture coords, not sure if they are stored relatively or using an absolute pixel amount). The textures take up a huge amount of memory (TGA or PNG).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: G3dHack - alpha6
« Reply #20 on: 24 May 2011, 01:09:59 »
And while we're at it, resizing textures
Isn't that what (among many other things) ImageMagick is for?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3dHack - alpha6
« Reply #21 on: 24 May 2011, 02:20:23 »
Except image magick can't change the G3Ds themselves, so if anything needs to be changed in the texture coords, it can't. Plus, by scanning all the G3Ds and loading only the images that are used in G3Ds, it could be easier for modders.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: G3dHack - alpha6
« Reply #22 on: 25 May 2011, 01:57:45 »
I am just curious, why is it no option to load the g3ds in blender and correct those things?

If you have the original blends, and the export script isn't defective (which it seems to be) then go for it. I think a new non-defective export script might be needed first.

Got an error when setting G3D Scan to Military's path:
...
As well, the refresh bug still seems to be in Alpha 6.

I scanned 2.4 without issue (though it took some time to get through those howitzer models... hint, hint), could you check G3dScan.log and see what file it balked on... must be something new, I need that g3d!

Refresh bug definitely seems to be gone for me, anyone else still get this?

Awesome! Wish it had particle,  screenshots, and gif support though. Or maybe you've already added that. Who knows? :P

I was planning to make a shader studio before a particle studio, but may have recently changed my mind, we'll see.

Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: G3dHack - alpha6
« Reply #23 on: 25 May 2011, 02:21:40 »
Some things cannot be fixed in Blender given the current export script.  For example, all meshes are exported as double-sided, regardless of how it is set in Blender.  The script (wrongly) uses sidedness as an indication of alpha behavior, instead of this button, and then disregards the actual sidedness.  Hence, nearly every mesh ever exported to Glest from Blender is broken and cannot be fixed using Blender.  Last I checked, this includes everything in the Megapack that isn't only a retexture.  The original Magitech models don't have this problem, as the 3DS exporter actually works.

PS: An export script that automatically converts quads into triangles and applies mirror modifiers would be great, as quads and mirrors make editing much more powerful, and this would result in more files being kept in a more-editable setup.
« Last Edit: 25 May 2011, 02:23:45 by John.d.h »

ChupaReaper

  • Guest
Re: G3dHack - alpha6
« Reply #24 on: 25 May 2011, 08:54:36 »
An exporter for Max 2010/11 would be awesome though not many people have it, I would make one myself but wouldn't really know where to begin, would be really useful if anyone could set one up though. Also, if there's plans for a new skeletal format (such as md5) maybe a conversion tool from skeletal format to g3d could be implemented? An export to obj would be really useful too as that is like the ultimate compatible format minus animations.

 

anything