Page 1 of 1

Image Texture problem (Solved)

Posted: Thu Feb 20, 2014 8:43 am
by Eightball
I have recolored textures before and had no problem applying them to existing models using GMT. But this time, my first time adding an image overlay to create a new texture effect, the model put the new texture on as if it were a big blanket rather than putting on the individual pieces. In other words, it's all goofed up.

See?
http://s271.photobucket.com/user/scotti ... 5.jpg.html

What am I doing wrong?

Re: Image Texture problem

Posted: Thu Feb 20, 2014 9:33 am
by BuzzJ
You could, in theory, post (or PM a link) your texture to a competent person, and they could adjust it for you.

Alternatively,

I believe you have accidentally erased the UVmap by converting the .model to .obj and back again. Try appying again to a default asset pack .model (this is what i'd do)

Are you sure your texture is a .dds in the correct DXT compression? If it has transparencies then it requires a diferent DXT compression (DXT/3 i think, check tutorials on these forums)

Other than that, no idea. Hope this helps.

Re: Image Texture problem

Posted: Thu Feb 20, 2014 11:45 am
by Eightball
The UVmap is the thing that tells the model where to put each piece of texture from the dds, right? I think that's got something to do with the problem too. I didn't mess with the model however. I took the goromorg dif and added a layer (in Paint.NET) on which to import the stars image. Then I isolated each piece of the goromorg robe (except sleeve ends and hood and tentacles) with the select tools, inverted the selection, and deleted all of the stars image that was outside those selections. Then I simply made the layer into "overlay", flattened it all together and saved it as a .dds (DXT1). After I then definedMaterial for the "star_robe" I tried adding it in the Grimrock Model Toolkit by replacing the default goromorg robe texture.

Here's how I defined it (I don't think this is where the error is, but just in case here it is:
SpoilerShow

Code: Select all

defineMaterial{
	name = "star_robe",
	diffuseMap = "mod_assets/textures/goromorg_stars_dif.tga",
	specularMap = "assets/textures/monsters/goromorg_spec.tga",
	normalMap = "assets/textures/monsters/goromorg_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = true,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 0,
	depthBias = 0,
}

Re: Image Texture problem

Posted: Thu Feb 20, 2014 2:19 pm
by BuzzJ
theres one issue I can think of based on that description:

1) go back to paint.net image; flatten the finished image (that SHOULDNT affect apearance at all) and save to .png. Then open up in Gimp and export it to DXT(whichever form is appropriate per the tutorial). You will need the .dds plugin for Gimp. Gimp's .dds plugin is far, far better than paint.net's. I use Paint.net and this is my procedure.

2) I don't think its the reason, (fairly positive) but consider renaming and moving and scripting appropriately the gomorong_spec and _normal to your file name.

But yeah, try (1) then reset everything in GMT just to be sure and let me know if that works.

If not, then OH BOY THAT SUCKS because you would be forced to export the .model to .obj, make your own custom UVmap, make a brand new texture to fit your custom UVmap, re-apply animations, re-apply all necessary position settings, and then save to .model again.
A TERRIFYING PROSPECT INDEED.

Re: Image Texture problem

Posted: Fri Feb 21, 2014 12:06 am
by germanny
Let me think your image has either an unequal size (1024x1024 = original) or you shifted parts of the texture.
You cant use as example a 1024x512 texture here.
Goromorgs UV map:
Notice that the brighter parts of the grid are overlay areas - there are two mesh parts
in place which use the same texture part!
Image

I attached here the original UV layout as png for DL:
DL:Goromorg_uv.7z

Use it as an reference layer for your image.

Re: Image Texture problem (Solved)

Posted: Fri Feb 21, 2014 1:19 am
by Eightball
Thanks, Germanny!
I was just coming to ask if resizing the image (the overlay of stars, not the original texture image) had anything to do with loosing the UVmap! So it's not just resizing but certain sizes of images that ruin it?
I'll try your DL.

EDIT: As I'm going through and doing it again, step by step, I'm being careful that the total texture's image size is not changed. I think what happened was I saved a slightly bigger image overlay on top of the default goromorog1 texture thus changing the UVmap drastically. So far in my redo (though I still have to resize the star image to fit over the robe pieces), the texture mapping is still in place.

EDIT: YuP! Happily, I can say that must have been the problem. I took the problematic texture that was garbled, simply resized "canvas size" in Paint.NET (it was off in width by some 200 pixels from having added the wide stars image without resizing it down exactly), and the robes fit as they should.

Re: Image Texture problem (Solved)

Posted: Fri Feb 21, 2014 3:56 pm
by germanny
What you can do is changing the overall size of the texture.
If base is: 1024x1024 px you can resize to 256x256, 512x512, 1024x1024, (maybe 1536x1536..) 2048x2048...
That depends on how the model´s UV was initialized - if it was build for rectangle maps as 1024x512 you can´t use
a quadratic 1024x1024 px texture with this model and vice versa.