Page 64 of 74
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 08, 2014 3:44 am
by germanny
Isaac wrote:I thought the recent versions had assimp32 built in. What version are you using?
By default Windows searches the application path ~(unless they changed it in Win7?)
John has a variant assimp32.dll IRRC. I'll mention your post to him.
Thx Isaac, i used the latest, 0.5.1.
I copied the assimp32 to other places and tried Gmt 'run as Admin..' too. Nope^^
JohnWordsworth wrote:Hi Germanny, there is some issue with the absolute latest version ..
Thanks John, i will try to extract and use the prev. versions assimp32 with 0.5.1 and test the whole older ver. too!
i migrated from xp to win7 x64 in october last year, so i have to check it out.
Could it be that it has to do with 64bit or the w7 Uac?
Anyway, thx for your work!
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 08, 2014 5:21 am
by BuzzJ
I run Windows 7. GM 0.5.1.0
my directory for GMT is C:\Program Files (x86)\John Wordsworth\Grimrock Model Toolkit
put assimp32.dll into that folder.
Mine works. See below screen of my folder.
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 08, 2014 7:25 pm
by germanny
Bombastisch! - thanks @Buzzj.
That worked fine with
GMT 0.5.1.0
For all who have similar probs:
I copied
Assimp32.dll and
AssimpNet.dll from:
Code: Select all
c:\Program Files (x86)\John Wordsworth\Grimrock Model Toolkit\Libs\AssimpNet-3.0.0\x86\
to:
Code: Select all
c:\Program Files (x86)\John Wordsworth\Grimrock Model Toolkit\
overwriting the existing ones.
Now Testing import..
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 08, 2014 7:54 pm
by JohnWordsworth
Glad you got it working. None of this silly wrapping in the GMT 2 when LoG 2 comes out - it will all be C++ (and cross-platform) so no need for .Net wrappers :p.
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 15, 2014 12:16 am
by BuzzJ
Hey John, do you know, or could you tell us how exactly your recalculate normals function works? I get the impression that it both automatically smoothes/hardens edges as well as recalculates normals. It works quite well in most instances, but not in all. Particularly when dealing with beveled cylindrical extrusions and cylindars in general.
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 15, 2014 3:41 am
by JohnWordsworth
Hey BuzzJ. Nothing special going on with the Normal Generation function. I simply iterate over every triangle, calculate the normal for that face and remember that for each vertex on that triangle. If a vertex is used by more than one triangle, I simply use an average of the normal for each connected triangle. Basically, this means that it assumes smoothing on every face. It's done on a per-segment basis, so theoretically, with some cunning use of duplicate vertices and mesh segments you might be able to trick it into generating something more specific.
However, you really are best off generating vertex normals in the 3D modelling application and importing them with the mesh. The normal generation functions in professional software has probably had a lot more time spent on it than the few minutes I put into mine.
The tangent/bi-tangent generation routines are of a better quality however - as I figured it is harder to generate those in all 3D software and export/import them into the GMT. So I put a bit more effort into those methods. Plus, there are better 'one-size-fits-all' solutions for tangent generation!
Hope this helps.
Re: [WIP] Grimrock Model Tookit
Posted: Wed Jan 15, 2014 6:31 am
by BuzzJ
Yes, it does, thanks you for the reply.
Re: [WIP] Grimrock Model Tookit (help)
Posted: Fri Feb 07, 2014 4:28 pm
by Eightball
I was quite happy with my GMT and Paint.NET. I even retextured a goromorg on my first go-round, but the next day I loaded it up and tried to apply a texture I had just saved (in Paint.NET) to an existing model (in GMT) and GMT couldn't even find my new texture in the Tools>Material Find/Replace>"new material name" dropdown menu! It just wasn't in the long list of textures. I've tried everything I can think of repeatedly (including adjusting Paint.NET save settings) and no change. It can find the texture I did that first day for the goromorg, but nothing I've made since. The Tools>Settings seem correct (asset pack and, more importantly, current dungeon, to which I'm saving my new textures, are plugged in).
These are my current save settings when creating a .dds texture in Paint.NET:
DXT1(opaque/ 1 bit alpha)
Clusterfit (slow/HQ)
Perceptual
Generate MipMaps
Bilenear
I see on the forums elsewhere that these settings have worked for others, so there must be something else I'm missing.
Can anyone help me before I waste a few more hours chasing the wind? Thanks in advance!
Re: [WIP] Grimrock Model Tookit (help)
Posted: Fri Feb 07, 2014 4:36 pm
by Isaac
Eightball wrote:...
Technically the materials don't have to work in GMT to work in the game. As I understand it, the GMT looks at the current project's materials list (as defined in the GMT settings menu). In my case they never show up anyway, but in my case, my PC has an interesting file system. Normally they should show up. This list will be different between different projects... at least as far as I understand it.
First, you should set the path to your current LoG project folder.
Additionally, the GMT also offers the use of temporary textures (in the materials panel; 'MATLS'. All one has to do is give it the same name as defined in the model, give the path to you DDS file, click the 'Update Node' button; and the GMT should display it on the model.
*Of course, you could always name the new material anything you want, and replace the ones defined in the model with the name of your new one, and it would work.
Temp materials are only in GMT; to use them in-game, just define them in the materials lua script.
Re: [WIP] Grimrock Model Tookit
Posted: Fri Feb 07, 2014 10:24 pm
by JohnWordsworth
Just to expand a little on Isaac's explanation, textures are loaded by the following means in the GMT.
1. Before this will work, you are expected to go to 'Tools -> Settings' and set the two directories there.
a. Asset Pack: This should point to the extracted files from the Grimrock asset pack. This should look something like: "D:\Modding\Grimrock\asset_pack_v2\assets".
b. Current Dungeon: This should point to the folder in which you are creating the mod. This is so that we can load textures from your mod that you've added too. This should be something like... "D:\Users\John\Dropbox\Grimrock\Dungeons\Helios IV". Note that this directory should contain the mod_assets folder.
2. Now that this is setup, you will want to hit "Save" on the settings dialog and then go to "Tools -> Reload Material Library" (or hit Ctrl-R). This does the following;
a. Scans through the lua files in the asset_pack for all material definitions and generates a material in the GMT.
b. It then scans through your mod_assets folder for any lua scripts and loads materials from that too. If any materials have the same name as ones from the asset pack, they will be overridden by these (the same as the game does).
c. Finally, it appends any temporary materials you have made in the GMT. These are made on the MATLs tab as Isaac describes. Note that these are temporary however - they have no connection to the mod/game and are just in the GMT so that you can test out materials without having to go into a lua script and make a material straight away. You will need to do so afterwards however.
3. Now that all of the materials are loaded, you just need to understand how the models and the materials are linked together. When you have loaded a model, you can go to the "Nodes" tab. Select a node that you know has a mesh (model) attached and you can see "Node Segments" at the bottom. A single mesh can be split into one or more segments (although most simple items will just have 1 segment). Each segment had a material name. Select a material from the dropdown box and hit "Set Material" to set the material for a segment. This is useful when you import a model and it has weird material names on the segments from your 3D modellers export.
Don't forget to save the .model file if you change anything - otherwise the material link will be lost the next time you open the file!