xander2077 80 Posted June 2, 2016 I have read about this before in some forum somewhere, but cant remember the exact content. basically i need to know for comparison sake what photoshop users do in order to generate the proper format for TGA in their output. if it is a native feature within the settings of photoshop, or if it is also related to any plugins installed later. I think there is a plugin for generating bumpmaps for kotor that is for photoshop and that would also be useful information to put away for later. The reason i am asking is because i would like to put my head together with some other gimp guys here so we can have a plugin that enables us to generate the same output in gimp, like reflection in the alpha layer. But to do that we have to figure out what the coding says, what the output in the tga data says, and compare that to all the plugins data, vanilla tga data etc. if it can be recreated in gimp, then we will have another tool for modders to benefit from. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 2, 2016 You don't require anything special for PS. It natively outputs in the correct format. There was some discussion of Gimp's odd ways with TGAs here - http://deadlystream.com/forum/topic/3726-help-installing-texture-mods Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 2, 2016 Well that does highlight some of the problems, so it would be a plugin that simplifies the output from gimp to resemble a more PS style of output. I know what you were talking about with the coordinates. A popup window appears during TGA export for the first time for that image, to ask you those kinds of specifics and other weird non essentials for TGA files. But the reality is that gimp is probably more advanced with the format variables, and PS and kotor tga formats just keep things simple. Not saying those variables are really necessary at all, but gimp does that. perhaps for another game format that i am not aware of. but these are the kinds of things you encounter with gimp. It is mainly geared toward graphic arts, web diesgn for banners, and buttons, and the occaisional linux icon, but leaves a lot to be desired for texture editing. they just dont see it as important, or if they do it is something really awkward or obscure. like this weird TGA micromanagement for no reason. As far as dds goes I am not sure what to think, but I would probably rather use ps for those if I ever did any. Im still trying to master the tga format first in gimp though so that will come later. Quote Share this post Link to post Share on other sites
Malkior 476 Posted June 2, 2016 I regularly use a DDS plugin when using Photoshop provided by my GPU company, if that helps. To my knowledge it has no native support. However, in my current experience, the output is surprisingly easy to run, and I've been editing DDS textures which run fine in their respective games. (My current area of ignorance is how to edit Unreal files, but that's another topic, entirely EDIT-- It looks like Unreal uses tga as well.. Interesting..) Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 2, 2016 PS doesn't handle DDS natively, but even with the nVidia DDS plugin it's of no use for KOTOR, as Bioware rolled their own custom implementation. You need this tool - http://deadlystream.com/forum/topic/3709-bioware-tga-to-dds-converter/ You need a TGA input for that, you just have to figure out how to get Gimp to export in the required format. Does the export/save dialogue for TGA in Gimp have any options for RLE compression? In that other thread I mentioned it seemed like the TGA in question was type 10, which has RLE. PS TGAs are type 2, with no compression. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted June 2, 2016 If it would be any help, I can post up a simplified read-out of the code KSE uses to generate .tga files for the icons. I use the same code in the Toolset and I believe KT uses the same "format" of code for it's saving as TGA. There is no RLE compression though and I've heard in the past that VP had issues with a texture because it had RLE Compression turned on (but I think that was when he was converting it to DDS with the tool that DP mentioned). Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 2, 2016 Let me check it out with a dummy tga and see what the dialogue says, i usually just speed past it and dont pay much attention to it. yes it does have a check box for RLE compression, so i guess unchecking it would help make it a better match for any conversion utility. That i guess will have to be seen. However the other issue is proper alpha channels, which seems to be an issue as well. I did try the suggested method SS told me about, which was trying to invert the colors in a separate layer, and desaturate and some other steps to make a layer friendly to the transparency and reflection, but i keep doing that wrong. @ FS any help is appreciated, and that would be the kind of things i would need to hand over to ndix for dissection. as you can see the options also allow you to place the origin in either top left or bottom left, and i have no idea how that will confuse the format, but it is present. I suppose in the conversion to DDS compression would need to be off and the origin would have to be in the top left. DDs usually has its mip maps done that way from what i can tell. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 2, 2016 Save two copies of an RGB image out, one without RLE, the other with RLE, and attach them. Doesn't have to be anything fancy. Just some 256x256 images with blocks of a couple of colours is sufficient. Regarding alpha channels, what are you trying to do? A transparency mask should be fairly straightforward. Are you having trouble with an envmap mask? Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 2, 2016 Save two copies of an RGB image out, one without RLE, the other with RLE, and attach them. Doesn't have to be anything fancy. Just some 256x256 images with blocks of a couple of colours is sufficient. Regarding alpha channels, what are you trying to do? A transparency mask should be fairly straightforward. Are you having trouble with an envmap mask? yes it is the envmap mask i am having trouble with. i want to learn that so i can get the circlet of saresh and teteas royal band to reflect like metal. seems more appropriate. it may also help in other masks in some of the details but not the whole texture. the two tga files are in the 7zip, i was not sure how you wanted the plain rgb file so i generated that qbist pic with normal settings and saved it as a png. Tga.7z Quote Share this post Link to post Share on other sites
Malkior 476 Posted June 2, 2016 Would not a txi file be all it takes to change a transparency into an envmap? Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 2, 2016 Would not a txi file be all it takes to change a transparency into an envmap? no, the transparency of the texture portion that is to reflect has to be a certain way. say for instance the bra on the new ds underwear for bastila. the shinay parts are really transparent, like maybe a 10 or 20 percent alpha transparency. and this has to be tweaked for whatever layer you want to be shiny or island of the texture. when i try to make the layer transparent, and i have to do that to the whole texture, it has the txi and points to the cm_baremetal, but instead of being shiny, it looks like a ghost texture. the problem is trying to get the areas that are shiny to be black first and then turn down the transparency so the engine knows that is the shiny part. it is really difficult for me to figure out. i suppose i have to think about it and approach it differently for it to work. maybe using some simple shapes in the pattern to overlay the texture and then try it out, but they have to be transparent all the way through, and this can also destroy details, so i may have to overlay the shadows and details on top of a black layer and then make the background transparent black. i have to toy with it more and figure out the science of it until i get something that works. Quote Share this post Link to post Share on other sites
Malkior 476 Posted June 2, 2016 Ah, I sometimes forget that I am used to Photoshop automatically setting up the alpha data properly.. So, there's actually a setting behind the scenes that controls the pixels assigned to envmap data? /musing/ Do you think this could also (theoretically, mind you) create some way to have transparency and metallic textures on the same texture? (metal texture for the skin and transparency for the hair on Atton as a possible example) EDIT What I did in Gimp when the Alpha failed was to delete the old Alpha layer and create a new one. It generally worked. Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 2, 2016 hmmm, well i usually create a new one anyway. one of the first things i do is to semi flatten it, or flatten the layer on a vanilla texture and then i can see the details better to make them higher resolution. what i noticed for the masks retextures was that when i put the transparent bits on the texture, like for instance on the verpine headband, and then exported it, the visor part automatically started to be reflective like glass, but the black color was still very visible so it did not shine like metal. however on underwear or some armor, that part that shines is almost always mostly transparent. very low opacity. so then it picks up the reflection map and shines a lot. so it is not just the alpha layer, but what the game interprets as opaque by color. lighter usually means it wont reflect, but darker like black, and then opacity turned low, will usually reflect the cm_baremetal. i am just not sure how to get it right yet. like i said it also has to do with what i mark as the alpha layer, usually by color, and then the details that have to be that color to work right. for something like the circlet of saresh i will have to make almost all the details besides the shadows transparent or delete them and then replace those with a color that the game will automatically interpret as the alpha reflection. Quote Share this post Link to post Share on other sites
Malkior 476 Posted June 2, 2016 Ah... My apologies for the oversimplification.:/ Well, I am interested in how you manage to get this working. Gimp was impossible for me to texture with for essentially this one reason.. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 3, 2016 The problem is that Bioware's envmap system is a piss-poor way to fake specular and reflections. It's never going to look good, especially in comparison to modern graphics, no matter how much you tweak it. It's cheap from a GPU/memory overhead standpoint, which is why they went with it. My suggestion would be to minimise the use of it wherever possible, and just accept that you will generally never get anything that looks remotely like a real reflective surface, outside of a few edge cases. One thing you could try is using some of the custom envmaps by Darth_Sapiens and/or try making your own. The vanilla ones are all pretty garbage. Regarding transparency and envmaps, you can't do both with a single map, seeing as both utilise the alpha channel. If you want shiny bits on your verpine visor, you'll need to break the visor out to its own separate texture (which could be tiny, like 64x64, seeing as it would just be a solid RGB colour and a solid alpha). Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 3, 2016 The problem is that Bioware's envmap system is a piss-poor way to fake specular and reflections. It's never going to look good, especially in comparison to modern graphics, no matter how much you tweak it. It's cheap from a GPU/memory overhead standpoint, which is why they went with it. My suggestion would be to minimise the use of it wherever possible, and just accept that you will generally never get anything that looks remotely like a real reflective surface, outside of a few edge cases. One thing you could try is using some of the custom envmaps by Darth_Sapiens and/or try making your own. The vanilla ones are all pretty garbage. Regarding transparency and envmaps, you can't do both with a single map, seeing as both utilise the alpha channel. If you want shiny bits on your verpine visor, you'll need to break the visor out to its own separate texture (which could be tiny, like 64x64, seeing as it would just be a solid RGB colour and a solid alpha). Well it is already broken to its own object, and used to have its UV on a very small part of the texture, probably 64x64. And for some reason it already reflects when I was not going for that. So I don’t need that to reflect. I would rather it did not really. It needs to have a dull glow instead on the blue holographic parts. But what I want to reflect are the Circlet of Saresh, and Teta's Royal Band restored since they are metal. How to do that with the texture is the issue. Most of the body models use transparency on the alpha layer in the same texture to get the game to interpret that as the reflective bits. Several of Juhani's player made skins and Bastila's all have that feature and it is in the same texture as the rest of the body. for instance if you look at the texture that Redrob41 made for Bastila's new DS underwear, it is evident in that texture how it will appear in the game. The bra ends up being like some shiny silk and in blender it is see through so you can see inside the model on those parts. I have most of my reflection maps replaced by higher quality ones, and I bet the author is Darth Sapiens (LOL). And usually anything referencing those with the TXI works pretty well. So I’m not wondering how the cubemap is done, but how to get the texture bits that are supposed to reflect to do so. SS tried to explain it to me but I must be doing it wrong or there is something about the way gimp handles the alpha layer differently that is messing it all up. Hence why I have reflection on the Verpine visor already. Now as far as the differences between the two outputs from gimp of the TGA, I would really be interested to know what you found comparing them. Since that may be part of the reason I am failing badly (LOL). Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 3, 2016 It's all just transparency. All the envmap is doing is underlaying the diffuse. That's why you can only have one or the other. Either you have pure transparency, or you have an envmap. Like I said, if you want a transparent visor and the rest of the headgear shiny, that will require 2 separate textures. You cannot do both in a single texture. Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 3, 2016 ok makes sense, but i dont want transparency and that is what i am getting. for instance, i want the circlet of saresh to be shiny or at least somewhat reflective compared to the flat image it has now. i do not want transparency. but what i get is a see through piece of headgear even with a txi pointing to the cube map. it refuses to reflect. the closest i got to it maybe starting to act right was when i inverted the colors and made the black the alpha layer but even then it was black and not transparent or shiny. so that wont do. for the verpine headband i do not want reflection at all, but i have both reflection and transparency somehow on the visor with the blue holo art on it and did not even try. it just ends up that way in the game. the rest of the model is flat, but i guess the visor has a cube map already from a previous mod i installed. i have no idea how it is transparent and reflective but there it is, kind of like the pvc mods out there. and i did not change anything but the shape of the model and redo the texture. it is just a modified vanilla asset. the visor is a few different parts. there is two or three parts to the ear muffs and the glass on the front is its own object, so technically it can point to another texture if i want, but i chose not to do that this time in case i screwed up. i will probably do that later. and give it a better texture on a separate map from the main body of the verpine headband, maybe animated. but i would like to know what i am doing wrong there so i can get rid of the reflection, i only want transparency on that and some glow maps, i do not want reflection on the visor. instead it has both. it is some kind of fluke. i cant explain it, but you can see it clearly in the downoad page screens. it has both reflection and transparency. like i said weird... the circlet of saresh has two objects, the round circles on the muffs are one, and the rest is another object, so i assume they intended for the circle to glow with light, which it may still be doing, but it is hard to tell. the main body is what i want to reflect and i will leave the round circles part on the muffs the way it is. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 3, 2016 Ahah, I see why. I've never noticed this before, but they set the alpha in the trimesh. Sneaky, sneaky. So in the case of something like the verpine haadband: node trimesh Mesh02 parent VerpineHeadBand position 0 0 0 orientation 0 0 0 0 scale 1 alpha 0.699999988079071 selfillumcolor 0 0 0 diffuse 1 1 1 ambient 1 1 1 render 1 shadow 0 specular 0.000000 0.000000 0.000000 shininess 0.000000 wirecolor 1 1 1 bitmap I_VerpHBndNotice the "alpha" value. So even if you remove the alpha channel of the texture altogether, the visor will still be transparent. I guess this means you can have both transparency and an envmap in a single texture, at least on a per-mesh chunk basis. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted June 3, 2016 Ahah, I see why. I've never noticed this before, but they set the alpha in the trimesh. Sneaky, sneaky. So in the case of something like the verpine haadband: node trimesh Mesh02 parent VerpineHeadBand position 0 0 0 orientation 0 0 0 0 scale 1 alpha 0.699999988079071 selfillumcolor 0 0 0 diffuse 1 1 1 ambient 1 1 1 render 1 shadow 0 specular 0.000000 0.000000 0.000000 shininess 0.000000 wirecolor 1 1 1 bitmap I_VerpHBndNotice the "alpha" value. So even if you remove the alpha channel of the texture altogether, the visor will still be transparent. I guess this means you can have both transparency and an envmap in a single texture, at least on a per-mesh chunk basis. This is also why the lightsaber textures are so picky on coloring. The alpha value in the trimesh, from what I can tell, skews the 0.0 - 1.0 scale of the alpha layer's strength. I think the lightsaber blades have an alpha of 1.0, which means that black is transparent in the base texture regardless of the alpha channel's settings. Kind of why it's so hard to have a black lightsaber. I'm not sure if we can change the alpha value (outside of hex-editing), but we can't make our own sabers from scratch because we don't know the scalekey's last three numbers, so no power-on and power-off animations. Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 3, 2016 sooo, i can have the holo texture, and just change the txi to point to a glow texture then instead of the envmap? that is promising. i will have to learn more, since the transparency can probably be tweaked in the trimesh setting to higher or lower. now i wonder if the alpha was set on the two other masks (circlet of saresh, and tetas band) and if so can it be removed or is that a part of the reason models reflect? if any other things can be set in the trimeshes, then that will help expand the rendering capabilities or fine tune them a bit. i am noticing there is a shininess value which may be another way to make the two models i want to reflect do something. is that correct? Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 3, 2016 The verpine headband visor mesh has a trimesh alpha value of 0.7. Here are the changes, going left to right, from a texture alpha channel colour of black, mid-grey (127,127,127), and white (diffuse colour was changed from red to green to confirm it was the right texture): It seems to me like it is affecting the diffuse more than the actual level of transparency. I think the lightsaber blades have an alpha of 1.0, which means that black is transparent in the base texture regardless of the alpha channel's settings. Kind of why it's so hard to have a black lightsaber. All normal meshes have a trimesh alpha of 1. My understanding is that a saber's blade shenanigans is mostly from the texture semantics. Blending additive is presumably the culprit with black issues. Although the blade glow is presumably from a special shader. It doesn't use the trimesh self-illumination. now i wonder if the alpha was set on the two other masks (circlet of saresh, and tetas band) For TSL at least, only two mask models have meshes with a non-1 alpha: I_Mask_005 (Bothan Sensory Visor) trimesh Object02 - alpha 0.920000016689301 I_Mask_011 (Verpine Headband) trimesh Mesh02 - alpha 0.699999988079071 I haven't decompiled the K1 models, but I don't think TSL made any changes to the masks/goggles. and if so can it be removed or is that a part of the reason models reflect? Notionally there shouldn't be any faked reflection if there is no TXI specifying an envmap. I wonder if it is being forced elsewhere? I couldn't see anything obvious in baseitems.2da. That would explain why they need to force transparency via the trimesh though. i am noticing there is a shininess value which may be another way to make the two models i want to reflect do something. is that correct? There is both a shininess and specular value. I don't know if anything actually uses them. Possibly water meshes? Quote Share this post Link to post Share on other sites
xander2077 80 Posted June 3, 2016 it would be fun to experiment with those and see what happens. it may just open up a lot of modding possibilities that were not evident before or someone never told everyone elses lol. im sure some of the really old time modders first delving into the trimeshes data were aware of some of these things. i am seeing all kinds of possibilites with this. maybe the black lightsaber can be fine tuned as a result? Quote Share this post Link to post Share on other sites