Page 1 of 1

Lost on how I can define a custom texture

Posted: Sun Nov 02, 2014 8:22 pm
by MrChoke
First I want to say I have never done any graphics stuff. I am a coder, not a graphics guy. With that said though, I thought maybe I could test out creating a custom texture and putting it in a new object or maybe a tile... whatever I can do. I have read what I can here in the forum and I am not getting how to do it.

So I have a .dds file in the proper format (the no alpha one). I renamed it to .tga. From there, I have no idea where to go. I don't think I want to define a model because aren't those .fbx files? I just want to to see if I can get a new wall texture to render from my texture. Is something like this a material? Or is it a model? I did something like this in matrials.lua:

Code: Select all

defineMaterial{
  	name = "testMaterial",   
   	normalMap = "mod_assets/textures/test.tga",
   	doubleSided = false,
   	lighting = true,
   	alphaTest = false,
   	blendMode = "Opaque",
   	textureAddressMode = "Wrap",
   	glossiness = 15,
   	depthBias = 0,
 }   
Now how do I get that into something I can place in the editor? I tried many things to basically clone an existing item and can't get anything to work. One example, from items.lua:

Code: Select all

defineObject{
  	name = "testItem",
   	baseObject = "castle_wall_cloth",
	components = {
		{
			class = "Model",
			material = "testMaterial",
		},		
	}
 }  
In this one, the editor doesn't blow up but it doesn't do anything either. I am lost. :cry:

Re: Lost on how I can define a custom texture

Posted: Sun Nov 02, 2014 8:41 pm
by Prozail
The name of the material is coded into the .model file.
You can modify it with a hex-editor (its near the end of the file) but that's not for the feint of heart, otherwise you need to set it up before you export your model, or simply redefine the one already on the model-file.

Re: Lost on how I can define a custom texture

Posted: Sun Nov 02, 2014 8:44 pm
by MrChoke
I can fire up a hex editor I guess but do you know how to re-define one?

Re: Lost on how I can define a custom texture

Posted: Sun Nov 02, 2014 9:38 pm
by Prozail
i havn't tried redefining one myself, but it should theoretically work. You still need to know the name of the material used in the model.

Re: Lost on how I can define a custom texture

Posted: Mon Nov 03, 2014 12:51 am
by Leki
HERE: http://grimwiki.net/wiki/Model_Retexturing_Tutorial (it works as well for LoG2) but you need a model from asset pack (or your's own model) to edit it in GMT.