Applying a texture to a custom model (SUCCESS)
Re: Applying a texture to a custom model
I think I'm getting the mapping right, but obviously I am messing something up somewhere. I end up at least with a image file with the faces spread flat. I've sent my model, my texture .dds, and the relevant grimrock scripts. Based on what you said, I think it's material connections with the GMT that's my sticking point - I haven't been able to get textures to come up, even with standard grimrock objects.
Re: Applying a texture to a custom model
In your settings, have you told the GMT where you current dungeon is and where your asset pack is?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Applying a texture to a custom model
yes, it's got both of those.
Re: Applying a texture to a custom model
Can you send me the files you have? I'll see if I can correct them.
Sorry, I hadn't checked my email this morning. I'll look at them after work.
Sorry, I hadn't checked my email this morning. I'll look at them after work.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Applying a texture to a custom model
Did you reload the material before exporting it back out to .dds from GIMP? Are you able to see your new UV on whatever it is your texturing while its inside the GMT?
Go to Tools > material find/replace> then you have to replace with your new material and then do tools>reload material library or hit CTRL-R. Should show your texture on your model then you just export it back into your mods_assets folder.
You also have to define your new material in your mod_assets materials.lua... like this maybe.
defineMaterial{
name = "carrion_lizard",
diffuseMap = "mod_assets/textures/carrion_lizard_dif.tga",
specularMap = "assets/textures/monsters/ice_lizard_spec.tga",
normalMap = "assets/textures/monsters/ice_lizard_normal.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 65,
depthBias = 0,
}
Hope it helps you, I may not be the best one to explain this sort of thing but it seems like your not loading in your new material through the GMT to me. Good luck!
Go to Tools > material find/replace> then you have to replace with your new material and then do tools>reload material library or hit CTRL-R. Should show your texture on your model then you just export it back into your mods_assets folder.
You also have to define your new material in your mod_assets materials.lua... like this maybe.
defineMaterial{
name = "carrion_lizard",
diffuseMap = "mod_assets/textures/carrion_lizard_dif.tga",
specularMap = "assets/textures/monsters/ice_lizard_spec.tga",
normalMap = "assets/textures/monsters/ice_lizard_normal.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 65,
depthBias = 0,
}
Hope it helps you, I may not be the best one to explain this sort of thing but it seems like your not loading in your new material through the GMT to me. Good luck!
My slow going projects...
viewtopic.php?f=14&t=4538&p=59753#p59753
viewtopic.php?f=14&t=4538&p=59753#p59753
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Applying a texture to a custom model
Hi Vorebane,
I know you're probably near the end of the process now, but I wanted to print what I believe to be a complete list of steps required for getting a brand new model into Grimrock with a custom texture.
Sample Material Definition
Note that your paths for diffuseMap, specularMap and normalMap must start with mod_assets and must end with .tga, even though the actual files are .dds files. It's also advisable to name everything lowercase - it doesn't matter in the dungeon editor, but it does matter in the game. It will possibly also matter when the OSX version arrives!
Good luck!
I know you're probably near the end of the process now, but I wanted to print what I believe to be a complete list of steps required for getting a brand new model into Grimrock with a custom texture.
- Create model in 3D modelling software.
- Unwrap UV coordinates from model in 3D modelling software.
- Preview the diffuse texture on the model in 3D modelling software to ensure the UV mapping is correct.
- Export object in OBJ format (Y-up, -Z Forward I think. Ensure 'export UVs' and 'export Normals' are checked).
- Load the Grimrock Model Toolkit
- Go to Tools -> Settings, set your Asset Pack directory (<Asset Pack Directory>/assets), and your dungeon directory (<Dungeons>/<Dungeon Name>). Note one should end with assets/ but the other should NOT end with mod_assets. This is confusing and will be fixed at some point!
- Import into Grimrock Model Toolkit using OBJ Import or Assimp Import Option (some work better with one or the other).
- If the model is the wrong size, you can scale it using the 'Node' panel on the right hand size. The floor grid is '1 space'.
- If you have a normal map for your model, you will need to click 'Model -> Recalculate Tangents' as OBJ format does not support this data so we regenerate it.
- In the model nodes dropdown, select the node which represents your mesh, when you select it your model should go red in the 3D view (if Hightlight nodes is on).
- In the 'node segments' dropdown, select the first node segment (I will assume you only have one, but might have more if you have 2x textures for a single object).
- Enter a material name (say 'my_object' - this will later relate to a material in materials.lua, but we will next setup a temporary material for testing.
- Go to the Materials tab (Mats), and click 'Add' to add a temporary testing material - this only exists in the GMT but is good for testing.
- Give this temporary material the same name as the material name you entered two steps ago ('my_object').
- Click on the '...' button to find the material. It can be a PNG, DDS or JPG at this point (but must be DDS for the final model).
- Click 'Update Material' and then Tools -> Reload Material Library. You should now see your new texture on the Grimrock version of your model. If not, either your texture is broken or the UVs didn't import correctly.
- Now Remove the temporary material again (the model will go grey).
- Convert your texture to DDS format using GIMP. Make sure you have exported your diffuse and specular textures with BC1/DXT1 format and your normal map (if you have one) with BC3/DXT5 format. You will ALWAYS need to Generate Mipmaps - otherwise the texture won't appear in game.
- In your dungeon/mod folder, add the script at the bottom of this list to your materials.lua. Make sure the material's name is the same you used earlier and the paths all start with mod_assets.
- Reload your materials in the GMT - you should now see the texture on your model again.
- Save your .model file from the GMT into <Dungeon>/mod_assets/models/. And proceed to make an object definition for your new object in object.lua!
Sample Material Definition
SpoilerShow
Code: Select all
defineMaterial{
name = "my_object",
diffuseMap = "mod_assets/textures/my_object_dif.tga",
specularMap = "mod_assets/textures/my_object_spec.tga",
normalMap = "mod_assets/textures/my_object_norm.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 15,
depthBias = 0,
}
Good luck!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Applying a texture to a custom model
Very nice Wordsworth, this should be useful to many people. I myself will likely be referring to this a few times as get more into my modeling. Cheers!
My slow going projects...
viewtopic.php?f=14&t=4538&p=59753#p59753
viewtopic.php?f=14&t=4538&p=59753#p59753
Re: Applying a texture to a custom model
Hmm. I'm having a look at your files now. Is the image supposed to be a series of gray boxes?
Also, unless you've made a normal map properly, you should avoid defining it in your material definition.
Unfortunately, currently altars do not support custom item positions. (Petri tells us it's in the next patch)
You cannot add lines to definitions that won't be recognized.
For a complete list of what can and cannot be added to a definition of something, check here: http://www.grimrock.net/modding/asset-d ... reference/
@John. That seems like so many more steps than I use since a lot of it has just become instinct to me now lol.
EDIT: Did a little trouble shooting, and your model does indeed have uvmapping.
It looks to be skewed though.
(I loaded my custom Ancient Axe Texture onto it)
-Continues tinkering-
I got your own texture working. I think you may have exported it incorrectly. (Did not generate mipmaps, perhaps?)
You've got a few too many transparent parts I think.
Here it is in game, using the ingame rock_wall_tile as place holder.
Also, unless you've made a normal map properly, you should avoid defining it in your material definition.
Unfortunately, currently altars do not support custom item positions. (Petri tells us it's in the next patch)
You cannot add lines to definitions that won't be recognized.
For a complete list of what can and cannot be added to a definition of something, check here: http://www.grimrock.net/modding/asset-d ... reference/
@John. That seems like so many more steps than I use since a lot of it has just become instinct to me now lol.
EDIT: Did a little trouble shooting, and your model does indeed have uvmapping.
SpoilerShow
(I loaded my custom Ancient Axe Texture onto it)
-Continues tinkering-
I got your own texture working. I think you may have exported it incorrectly. (Did not generate mipmaps, perhaps?)
SpoilerShow
Here it is in game, using the ingame rock_wall_tile as place holder.
SpoilerShow
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Applying a texture to a custom model
Ok, we are approaching this asymptotically, but that just means I'm very close!
John, I want to second the thanks for the very detailed written instructions. I did have the asset pack wrong, it was in /grimmodels without the /assets to hold all the disparate parts. I am currently struggling on step update material and reload material library, I have a red anvil with many invisible or reflected polygons, so I'm sure I've done something catastophically wrong.
Neikun, you guessed right, I hadn't looked up mipmaps and realized I needed them, and I also had transparency between each polygon face on the texture. My texture was just grey mostly on account of I was hoping to keep things easy and simple. I also did skew my map in Blender in hopes of getting it to fit on the square, messing with smart uv project settings solved that though. What you've managed looks great , and I want to figure out where I've strayed from the shining trail you've blazed!
Thank you, everyone who's pitched in here at all!
John, I want to second the thanks for the very detailed written instructions. I did have the asset pack wrong, it was in /grimmodels without the /assets to hold all the disparate parts. I am currently struggling on step update material and reload material library, I have a red anvil with many invisible or reflected polygons, so I'm sure I've done something catastophically wrong.
Neikun, you guessed right, I hadn't looked up mipmaps and realized I needed them, and I also had transparency between each polygon face on the texture. My texture was just grey mostly on account of I was hoping to keep things easy and simple. I also did skew my map in Blender in hopes of getting it to fit on the square, messing with smart uv project settings solved that though. What you've managed looks great , and I want to figure out where I've strayed from the shining trail you've blazed!
Thank you, everyone who's pitched in here at all!
Re: Applying a texture to a custom model
It seems like the biggest reason you couldn't at least check your own progress was due to a lack of mipmaps generated.
I'm trying to work on making a normal map of the rock_wall_tile texture that helps cut down on the amount of darkness at the ended.
A list of my trouble shooting process:
1. Clean up your definitions, add all files to my own dungeon folder.
2. Check if it works normally. (It did not. No surprise, you said it didn't lol)
3. Check if other materials can be loaded. (This showed me that the model at least has been successfully exported with it's uvmapping intact)
4. Test for best looking material I have on hand. (Personal curiousity)
5. Export your .dds file with correct settings to check if it is truly in the right format.
Issue found, next fix is to improve the texture.
I did notice that the model you sent me, in it's material find/replace window, it's existing texture was called Material_NONE.
I'm trying to work on making a normal map of the rock_wall_tile texture that helps cut down on the amount of darkness at the ended.
A list of my trouble shooting process:
1. Clean up your definitions, add all files to my own dungeon folder.
2. Check if it works normally. (It did not. No surprise, you said it didn't lol)
3. Check if other materials can be loaded. (This showed me that the model at least has been successfully exported with it's uvmapping intact)
4. Test for best looking material I have on hand. (Personal curiousity)
5. Export your .dds file with correct settings to check if it is truly in the right format.
Issue found, next fix is to improve the texture.
I did notice that the model you sent me, in it's material find/replace window, it's existing texture was called Material_NONE.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!