Modeling a new item - what am I doing wrong ?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Modeling a new item - what am I doing wrong ?

Post by Blichew »

Word of caution: this post is written from a perspective of modeling newb

So I've tried to add a new model (started with simple one: a coin). Here's what I've done already:

0. Prepared a 2D item icon
1. Created a model in blender
2. Textured the model in blender (along with material definition) using first .png file with 2 sides of the same coin I could find
3. Exported as .obj
4. Imported the .obj to Model Toolkit, created a .model file (checked the name of the material within model toolkit)
5. Saved the *.png as *_diff.dds (It's the texture, not the bumps/reflections right?)
6. Didn't create _spec.dds and _normal.dds (as I remember reading somewhere that the model would work without them and it'll just use the "normal" texture as the other two (forgot the parameters names)
7. Created material definition pointing to *_diff.dds file (full path)
8. Created an item in items.lua
9. Added the coin into my test dungeon.

Now what's I've got:
1. Coin takes about 1/4 of tile space :P - not so much an issue (can fix that)
2. Model is gray, untextured - there's the problem
3. Item icon is ok, except it's 4 of them in one square (again sizing issue or does it have something to do with mipmaps in .dds ?)

What do you think I did wrong ? I an upload/post every definitions I wrote in lua files aswell as blender model in the evening (gmt+2) as I'm at work now ;)
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Modeling a new item - what am I doing wrong ?

Post by Phitt »

I don't have the editor yet, thus I couldn't try myself to import models so far. But this is what comes to my mind:

1. Wall sets have a size of 3x3 units. Make sure your coin has an appropriate size. You could for example import a model of similar size, like a gem. Something like a diameter of 0.1 units could work for example (not tested, but it should be close).

2. The material definition in the lua script uses .tga format, even though the actual file is dds. So if your file is named *_diff.dds you need to put *_diff.tga into the lua definition. Don't rename the file itself though.

3. Icons have a size of 75x75 IIRC. Make sure your icons have that size.
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Modeling a new item - what am I doing wrong ?

Post by Blichew »

I don't have the editor yet
This may change rather sooner or later, AH released a release candidate today :)

Sorry, forgot to mention:

AD. 1: transforming and item in Model Toolkit should work, right ? Or will it lose the materials definition(aswell as textures)
AD. 2: In material definition I used *_diff.tga.
AD. 3: As for icon size (2d item): I have it in size 75x75 but I tried to resize it (only the layer with the coin icon) to something like 25x25 so it would fit gracefully in the middle. What I've got instead is 4 coins in a square, 2x2.
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Modeling a new item - what am I doing wrong ?

Post by Phitt »

Blichew wrote:
I don't have the editor yet
This may change rather sooner or later, AH released a release candidate today :)

Sorry, forgot to mention:

AD. 1: transforming and item in Model Toolkit should work, right ? Or will it lose the materials definition(aswell as textures)
AD. 2: In material definition I used *_diff.tga.
AD. 3: As for icon size (2d item): I have it in size 75x75 but I tried to resize it (only the layer with the coin icon) to something like 25x25 so it would fit gracefully in the middle. What I've got instead is 4 coins in a square, 2x2.
1. Yes, it will work. And no, it will not lose materials.

2. No idea then, sorry.

3. Don't think putting it in the middle is a good idea. Start in the upper left corner. And keep the size of 75x75 for the icon. No one cares what the texture looks like in Photoshop as long as it works flawlessly in game. Of course it's better to have more icons than just one to safe texture space (a single icon fits into a 128x128 texture, while 9 icons fit into a 256x256 texture).
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Modeling a new item - what am I doing wrong ?

Post by antti »

Blichew wrote:5. Saved the *.png as *_diff.dds (It's the texture, not the bumps/reflections right?)
You did actually save it in dds format instead of just saving a png that is renamed to dds, right?

I can't remember right now if it is absolutely required but we make all our textures for 3d meshes in power of 2 sizes like 64x64, 1024x1024, 128x32 and so on. Even if it's not required, it's a good idea regardless since some old display adapters cannot handle textures in non-power-of-2 sizes.
Steven Seagal of gaming industry
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Modeling a new item - what am I doing wrong ?

Post by Blichew »

Thanks Phitt, will try that when I get home later.
You did actually save it in dds format instead of just saving a png that is renamed to dds, right?
Of course :)
I can't remember right now if it is absolutely required but we make all our textures for 3d meshes in power of 2 sizes like 64x64, 1024x1024, 128x32 and so on. Even if it's not required, it's a good idea regardless since some old display adapters cannot handle textures in non-power-of-2 sizes.
So I should change the size of the texture before adding it onto model in blender, right ? (then change the file to dds via gimp or smth like that)
Btw. I'm using UV Mapping (using Unwrap function) when applying the texture - this shouldn't cause any problems, aye ?
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Modeling a new item - what am I doing wrong ?

Post by Phitt »

Blichew wrote:So I should change the size of the texture before adding it onto model in blender, right ? (then change the file to dds via gimp or smth like that)
Btw. I'm using UV Mapping (using Unwrap function) when applying the texture - this shouldn't cause any problems, aye ?
To uv map the model properly you need to have the correct size, so yes. Unless you scale the texture proportionally (eg scale down a 600x600 texture to 512x512), in that case you wouldn't absolutely have to do it, but it's still better to make sure the UV map perfectly matches the texture.

I'm not familiar with Blender, but how else would you apply a texture and UV map a model?
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Modeling a new item - what am I doing wrong ?

Post by antti »

You could also see if the material is assigned correctly by changing the material definition drastically. You could, for example, set lighting to false or blendMode to "Modulative"
Steven Seagal of gaming industry
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Modeling a new item - what am I doing wrong ?

Post by Blichew »

Phitt wrote:
Blichew wrote:I'm not familiar with Blender, but how else would you apply a texture and UV map a model?
I have absolutely no idea :)
I've created a coin using this tutorial:
https://www.youtube.com/watch?v=9ktuE2KRZfk
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Modeling a new item - what am I doing wrong ?

Post by JohnWordsworth »

Some suggestions of things to check/try;

1. The name of the material on the MainObject node in the Model Toolkit's "Material" window must match up EXACTLY (including lower/upper case characters) with the name of the material you have defined in materials.lua.

2. Make sure that you save your texture with BC3/DXT5 compression and have ticked "Generate Mipmaps". Other settings might work, but these settings definitely do!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Post Reply