Epifire Posted July 25, 2015 Report Posted July 25, 2015 Hey all. Trying to get my newly finished chair into TDM. Finally figured out (or otherwise relearned) where the directories are that I need to use for the PK4s. Things I'm able to do so far... Export lwo files, and I get a correctly scaled model in Dark Radiant. However (not to my surprise) the model has a missing texture. So this brings me to my confusion with material files. I'm not entirely 100% sure where the mtr files go for models, but furthermore I'm trying to nail down exactly how to use them. Target paths within a material file seem extremely straight forward as the basic syntax to get a texture working properly is even more simple than a Source Engine vtf. Although unlike a vtf these material files seem to be able to hold multiple values as almost some sort compiled material index? My assumption was that multiple models could call up a material reference from the same file, but that brings confusion as to what exactly the model should be targeting? So my questions about the material files are... 1: What is an appropriate name for the model to target, in conjunction to mtr name or contained references? 2: What should be kept in mind for names/paths? Or in other words, should the texture paths in my Softimage modeling app mimic that of it's destination directory? Or is the target name the only thing of importance? 3: I am using lwo, and henceforth I don't seem to be able to edit anything in it after export (as I recall ase files being capable of) through notepad. Been going through the wiki about this and some areas don't seem entirely clear for this. I hope my questions make enough sense, as I'm pretty sure this is the last thing holding me back from getting the model in-game. Quote Modeler galore & co-authors literally everything
Springheel Posted July 25, 2015 Report Posted July 25, 2015 The model surface should be named the same name as the material shader. If you were using this shader below, your surface (or at least one of them) would be called "diningchair2_s". This material shader would either be located in your own .mtr file, saved in darkmod/materials (the file name is irrelevant), or added to one of the existing .mtr files. Everything that's in italics below isn't crucial for getting the model to show up in TDM. diningchair2_s{ wood diffusemap models/darkmod/props/textures/dchair2 bumpmap models/darkmod/props/textures/dchair2_local { if ( parm11 > 0 ) blend gl_dst_color, gl_one map _white rgb 0.40 * parm11 } { if ( parm11 > 0 ) blend add map models/darkmod/props/textures/dchair2 rgb 0.15 * parm11 } // TDM Ambient Method Related { if (global5 == 1) blend add map models/darkmod/props/textures/dchair2 scale 1, 1 red global2 green global3 blue global4 } } Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Epifire Posted July 25, 2015 Author Report Posted July 25, 2015 Well matched the names of the texture used in Softimage to the name on the shader. I also renamed the basic material just to try and be certain it wasn't just the object name. So far I've got nothing but at this point I'm looking for typos as that's usually what bugs my stuff at this point. Anyway here is what my mtr looks like atm... models/darkmod/props/textures/leather_chair_001{ wood qer_editorimage models/darkmod/props/textures/leather_chair_001_ed diffusemap models/darkmod/props/textures/leather_chair_001 bumpmap models/darkmod/props/textures/leather_chair_001_local { if ( parm11 > 0 ) blend gl_dst_color, gl_one map _white rgb 0.40 * parm11 } { if ( parm11 > 0 ) blend add map models/darkmod/props/textures/leather_chair_001 rgb 0.15 * parm11 } // TDM Ambient Method Related { if (global5 == 1) blend add map models/darkmod/props/textures/leather_chair_001 scale 1, 1 red global2 green global3 blue global4 } } The thing that gets me is in Dark Radiant, when selecting the model vs another like dchair2, the checkbox under material actually reads the shader name. Whereas with mine it just says Material, so I feel like somehow it's not receiving the mtr correctly? Also just to point out my paths I'm packing these into the pk4 files accordingly (can't remember if it's just the editor or the game that can't load from a normal folder). Also I was wondering if it was safe for the file integrity, to compress files directly into the pk4s rather than decompressing them first. I've just been switching them over to a zip file and using the default compress to file for overwrites, and then change the zip extension back to pk4 when finished (which seems overly cumbersome). The mtr resides in... D:\Games\The Dark Mod\tdm_textures_base01.pk4\materials\ The lwo... D:\Games\The Dark Mod\tdm_models01.pk4\models\darkmod\furniture\seating\ The diffuse dds... D:\Games\The Dark Mod\tdm_models02.pk4\dds\models\darkmod\props\textures\ And the ed/local in... D:\Games\The Dark Mod\tdm_models02.pk4\models\darkmod\props\textures\ I may be setting up my model incorrectly in Softimage before exporting. But I thought just naming the mesh the same as the shader (not the mtr) would do the trick. Hoping this is just some dumb mistake of mine and not compatibility issues with the newer version of Softimage that I use. Quote Modeler galore & co-authors literally everything
SteveL Posted July 25, 2015 Report Posted July 25, 2015 There's no need to put stuff into pk4 files while testing. Just put the uncompressed files into the folders, creating new folder paths in your darkmod folder as necessary. That'll work for both tdm and DR. I've no experience of working with models so the rest of this post isn't advice, I'm just playing spot-the-difference between your material and Springheel's. Your material name (first line of the definition) has a folder path in it while Springheel's doesn't. Unless you called your model surface "models/darkmod/props/textures/leather_chair_001" you could try cutting that down. Quote
Bikerdude Posted July 25, 2015 Report Posted July 25, 2015 The thing that gets me is in Dark Radiant, when selecting the model vs another like dchair2, the checkbox under material actually reads the shader name. Whereas with mine it just says Material, so I feel like somehow it's not receiving the mtr correctly? Drop me a PM with the all the required files and I will see whats what. Quote
Springheel Posted July 25, 2015 Report Posted July 25, 2015 Whereas with mine it just says Material, so I feel like somehow it's not receiving the mtr correctly? That's what it sounds like. Try a surface name that already is an existing, working texture, like the example I posted above. That way you can rule out your material shader as the issue. What modelling software are you using? Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Epifire Posted July 26, 2015 Author Report Posted July 26, 2015 (edited) There's no need to put stuff into pk4 files while testing. Just put the uncompressed files into the folders, creating new folder paths in your darkmod folder as necessary. That'll work for both tdm and DR. I've no experience of working with models so the rest of this post isn't advice, I'm just playing spot-the-difference between your material and Springheel's. Your material name (first line of the definition) has a folder path in it while Springheel's doesn't. Unless you called your model surface "models/darkmod/props/textures/leather_chair_001" you could try cutting that down. Really? Because whenever I try and use the folders uncompressed everything comes up missing in the editor. Are there settings that can alter what the editor looks for? Also I list the shader name as the full path just as another thing to try. I already had set the shader name to just leather_chair_001 before. Just saw some other mtr files do that so I thought there may have been something to it. Try a surface name that already is an existing, working texture, like the example I posted above. That way you can rule out your material shader as the issue. What modelling software are you using? Softimage 2015 (student version). I'll use the different shader out and see what that brings. EDIT: I think there is something up with my model. That or how I'm replacing the model by overwriting and compressing directly to file. Still trying to figure out how you folks use the pk4s uncompress, because when I turn them into a normal directory it just doesn't load in the editor. Edited July 26, 2015 by Epifire Quote Modeler galore & co-authors literally everything
Springheel Posted July 26, 2015 Report Posted July 26, 2015 You might want to look up how to point DR at your texture folder. There is a trick to that which I've forgotten. Though it should still work when you run the game, even if DR doesn't see it. Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Bikerdude Posted July 26, 2015 Report Posted July 26, 2015 Well I have created a pk4 of all the files Epifire needs to get thise models working in TDM - See Xcen's post below Quote
Xcen Posted July 26, 2015 Report Posted July 26, 2015 (edited) http://www.mediafire.com/download/kuzku9r5buk7ja5/tdm_epifire_models_2.zip - Moved leather_chair_001.dds from \dds\models\props\textures to \dds\models\darkmod\props\textures- Resaved dds. Something was wrong here.- Changed the material.- Moved leather_chair_001_ed.jpg and leather_chair_001_local.tga from \models\props\textures to \models\darkmod\props\textures- Resaved leather_chair_001_local.tga as 24 bit- Inverted green chanel in leather_chair_001_local.tga- Checked uv map. No problems found.- Smoothed model.- Fixed a nasty triangel on the top left.- Changed surface name from diningchair2_s to leather_chair_001 Edited July 26, 2015 by Xcen 2 Quote
Bikerdude Posted July 26, 2015 Report Posted July 26, 2015 Nice work Xcen, the chair is missing a specular - leather is partly shiny and the brass tack certainly will be. But what ever I try Im getting pixilation of one of the textures/stages, any idea's..? - mega Quote
Xcen Posted July 26, 2015 Report Posted July 26, 2015 (edited) Do you mean the blocky lines? That's the normal map. Everything else is caused by the compressed diffuse map. Edited July 27, 2015 by Xcen Quote
Bikerdude Posted July 26, 2015 Report Posted July 26, 2015 No I am seeing a difference issue, and I have just realise its to do with the interaction shader. Set it to defalt and we see the following image/texture corruption issue - And then I realised something I had been seeing on the grandfather clock might be caused by the same thing - And this now also reminds me of the issue we have had for a long time that has been bugging and annoying me, as in if we set the interaction shader ot simple a bunch of decals appear white. I dont know if this is an nVidia driver or hardware thing. I need some people to test the .PK4 above on an ATi/AMD card. Back to the model @Epifire, have you got all the original texture images? as the compression on all the ones you have included is very noticable. Quote
nbohr1more Posted July 26, 2015 Report Posted July 26, 2015 @Biker do you have image_downsize set in your Darkmod.cfg ? If so, that might also affect the image quality there. Also, check your Driver settings for texture quality to ensure it's not set to High Performance. As for the simple interaction shader issue, that's a very old bug. The texture based ambient doesn't blend with the GUI system for some reason (unlessyou are speaking about non-GUI based decals, but there can still be problems there too with the simple blend method used for ambient shading). Normalmap compression is mostly a no-no right now. If we get RGTC compression working then it will be much better but currently (unless there are bettercompressor programs out there) it is too prone to artifacts. It would be cool if someone made something like VBR compression for textures so you couldselectively preserve detail better. If anyone knows of a better RXGB compressor for normal maps it would be a life saver. Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...)
Epifire Posted July 27, 2015 Author Report Posted July 27, 2015 (edited) http://www.mediafire.com/download/kuzku9r5buk7ja5/tdm_epifire_models_2.zip - Moved leather_chair_001.dds from \dds\models\props\textures to \dds\models\darkmod\props\textures- Resaved dds. Something was wrong here.- Changed the material.- Moved leather_chair_001_ed.jpg and leather_chair_001_local.tga from \models\props\textures to \models\darkmod\props\textures- Resaved leather_chair_001_local.tga as 24 bit- Inverted green chanel in leather_chair_001_local.tga- Checked uv map. No problems found.- Smoothed model.- Fixed a nasty triangel on the top left.- Changed surface name from diningchair2_s to leather_chair_001 Hmm, I'm wondering why that much had to be edited for the actual mesh/textures? What exactly was wrong with the DDS (just curious?) because I'm wondering if that was the initial problem with the textures not loading. Also wondering about the normal map. If I open it in Ps it's already at 24 bit (which is really odd because that should be the same unaltered one you got) and I had no problems with it in my other software for rendering. See on my end there were no troubles in any of the other systems, unless something got corrupted from the export to lwo. EDIT: I do realize after checking into my folder that the normal map has an alpha channel I forgot to remove. Are normal maps even designed to be handled with alpha channels anyway? Nice work Xcen, the chair is missing a specular - leather is partly shiny and the brass tack certainly will be. But what ever I try Im getting pixilation of one of the textures/stages, any idea's..? - mega I was gonna work out a specular texture after getting the initial shader/material functional. Also the pixelation might be how my Ps plugin exported the DDS. Is it fine if we just try my source tga? Otherwise the only one compressed is the DDS, I didn't touch the normal map (and you saw how smooth the normals were in the marmoset render with that same map). The diffuse when exported to DDS did have a little bit of pixelation, but not near as much as I'm seeing in those screens. Kinda confused as to what caused all this after the initial exports, as the reasons are still unclear. Original source tgas. https://www.mediafire.com/?djfl7ubs81msa51 Edited July 27, 2015 by Epifire Quote Modeler galore & co-authors literally everything
Bikerdude Posted July 27, 2015 Report Posted July 27, 2015 @Biker do you have image_downsize set in your Darkmod.cfg ?If so, that might also affect the image quality there. Also, check your Driver settings for texture quality to ensure it's not set to High Performance.As for the simple interaction shader issue, that's a very old bug. The texture based ambient doesn't blend with the GUI system for some reason (unless you are speaking about non-GUI based decals, but there can still be problems there too with the simple blend method used for ambient shading).nuked and recreated the darkmod.config and no difference.Checked, nvidia settings at default and best qaulity no difference.Well hopefully someone will be able to come up with a fix. I was gonna work out a specular texture after getting the initial shader/material functional. Also the pixelation might be how my Ps plugin exported the DDS.Kinda confused as to what caused all this after the initial exports, as the reasons are still unclear. Original source tgas. https://www.mediafire.com/?djfl7ubs81msa51 Are normal maps even designed to be handled with alpha channels anyway?I made a specular from your normal as it was of clearer qaulity than the diffuse.Same here, someone will be along with an answer Im sure.Downloaded, but made no difference. So it is what it is.I dont beleive so, but Im sure someone will know for sure. Quote
nbohr1more Posted July 27, 2015 Report Posted July 27, 2015 Normal maps don't use alpha as far as I recall, in fact I'm pretty sure the blue channel is reconstructed in the shaderso they mostly use red and green. That's why red is set to 0 weight. It's swapped (swizzled) with green in the shaderbecause the red channel is given less bits to work with in the compressor so to preserve detail it's encoded reversedthen flipped back during render. The specular should mostly be a flat grey texture unless you want the shiny-ness to vary on the surface of the chair. Matching eitherthe diffuse or normals will just produce weird shiny patterns where the lighter areas are. Of course. if you wanna get fancy, I think Blender (etc) can isolate specular power from a raytracesimilar to gathering it from image captures for PBR. On consideration, the quickest way would probably be to generate a greyscale heightmap in blender or evenin njob (I think it can do heightmaps via normals as I recall). Then reduce the contrast and blur so you've gotspecular roughly aligned with AO and more physically accurate as specular is a form of reflectance and protrusionsare more reflective than recessions (naturally). This is probably why they refer to PBR specular methods as micro-facet\roughness approximations. You can probably simulate that to a degree just by treating micro protrusions as a roughaverage in specular. 1 Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...)
nbohr1more Posted July 27, 2015 Report Posted July 27, 2015 One more note on speculars if you haven't already gathered. They should be very dark unless you really want them to shinelike crazy. Our specular ramp goes from 0 to 1000 very quickly so be conservative with brightness. Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...)
Epifire Posted July 27, 2015 Author Report Posted July 27, 2015 nuked and recreated the darkmod.config and no difference.Checked, nvidia settings at default and best qaulity no difference.Well hopefully someone will be able to come up with a fix. I made a specular from your normal as it was of clearer qaulity than the diffuse.Same here, someone will be along with an answer Im sure.Downloaded, but made no difference. So it is what it is.I dont beleive so, but Im sure someone will know for sure. I know the original diffuse has some "segmented areas" to simulate brushed in dye to the leather, but I've seen the shots. It shouldn't be getting hacked up this badly during run time. I tweaked some settings in Ps, and I do know my original DDS was waaaay over compressed. I now cram it down to around 1mb vs 3 and it doesn't look too bad (at least in Ps). I don't think any of this has been added to the update, but is there anyway you could send me the files for what's there? Of course I'll be able to see what you guys changed but I also want to inspect this stuff in-game and see for myself. In any case I'll be able to do some more tests but maybe try some other stuff on my coming days off here. @Xcen I also was wondering, did you edit the mesh for the lwo or just use the OBJ? Because I realized now that OBJ (and maybe even lwo) doesn't retain a lot of the options especially hard points and smoothing options from XSI. So at least I know I'm not completely losing my mind here. Normal maps don't use alpha as far as I recall, in fact I'm pretty sure the blue channel is reconstructed in the shaderso they mostly use red and green. That's why red is set to 0 weight. It's swapped (swizzled) with green in the shaderbecause the red channel is given less bits to work with in the compressor so to preserve detail it's encoded reversedthen flipped back during render. The specular should mostly be a flat grey texture unless you want the shiny-ness to vary on the surface of the chair. Matching eitherthe diffuse or normals will just produce weird shiny patterns where the lighter areas are. Of course. if you wanna get fancy, I think Blender (etc) can isolate specular power from a raytracesimilar to gathering it from image captures for PBR. On consideration, the quickest way would probably be to generate a greyscale heightmap in blender or evenin njob (I think it can do heightmaps via normals as I recall). Then reduce the contrast and blur so you've gotspecular roughly aligned with AO and more physically accurate as specular is a form of reflectance and protrusionsare more reflective than recessions (naturally). This is probably why they refer to PBR specular methods as micro-facet\roughness approximations. You can probably simulate that to a degree just by treating micro protrusions as a roughaverage in specular. That's a great idea there. Softimage's Ultimapper can run off heightmaps just fine, so that should look better than stuff based off the diffuse any day. Also cool to see someone else here who's into PBR workflows now XD 1 Quote Modeler galore & co-authors literally everything
Gestas Posted July 27, 2015 Report Posted July 27, 2015 I always have a can of PBR handy when I'm working Quote
Epifire Posted July 28, 2015 Author Report Posted July 28, 2015 (edited) I always have a can of PBR handy when I'm working Indeed Gestas, one must always have a free can available. Also pardon my dumbness for missing the link from Xcen. *face palm* @ Xcen I'm gonna give this a look over and see what I can do different next time. I think I'm actually most concerned about having to need a normal map channel inverted. Because that was just that way from the bake, and as I've never really messed with the normal maps themselves, (beyond patching a couple artifacts) I didn't know how handy checking the channels would be. Curious what lead you to check that Xcen? Or if that's just a good habit of some kind? Because now that's gonna have me double checking all my channels, as that in and of itself is just a really easy thing I never thought to do. Also, did you intentionally name the model "group_leather_chair_001" for the OBJ you packed in that zip? Because I wasn't sure if group_ was needed as some sort or prefix for the naming of the mesh. Which would be a lot of sense as to why mine wasn't working to begin with. There's a ton of facepalming right now though as I look at this, since I've really been overthinking all of this. These directories work fine as well. See I was mimicking the pk4 layout except just having them uncompressed. For instance if someone was telling me put something in "models" I was automatically assuming that meant to put it in "tdm_models02\models\darkmod\props\textures" So yeah, I can't thank you guys enough for just pitching in and getting so involved. Edited July 28, 2015 by Epifire Quote Modeler galore & co-authors literally everything
Springheel Posted July 28, 2015 Report Posted July 28, 2015 Leather sofas? Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Xcen Posted July 28, 2015 Report Posted July 28, 2015 Made a comparison. In both the upper one is with the green channel inverted.If the green channel isn't inverted everything that should look like it bumps into the surface looks as if it would protrude from it.It's easier to see in this picture: http://wiki.thedarkmod.com/index.php?title=Inverse_NormalmapsThe stones protrude from the wall.If the lower half of the stones is cyan they protrude.They would bump into the wall when upper half is cyan. Blender named it "group_leather_chair_001". It doesn't matter. Opened your .lwo and converted it to .obj for better handling. Quote
Popular Post Epifire Posted July 28, 2015 Author Popular Post Report Posted July 28, 2015 (edited) So matching sofa next..? Leather sofas? Well this is deeply in consideration but I told Goldwell that I was going to originally make him an ottoman so I figure I'll get that done first. There's a very good chance I will try and get a complete set made though (since I am quite fond of Chesterfield). Made a comparison. In both the upper one is with the green channel inverted. darkmod_2015-07-28_15.31.47_kl.jpgleather_chair_001_local_comparison.jpgIf the green channel isn't inverted everything that should look like it bumps into the surface looks as if it would protrude from it. It's easier to see in this picture: http://wiki.thedarkmod.com/index.php?title=Inverse_Normalmaps The stones protrude from the wall.If the lower half of the stones is cyan they protrude.They would bump into the wall when upper half is cyan. Blender named it "group_leather_chair_001". It doesn't matter. Opened your .lwo and converted it to .obj for better handling. I guess I never saw the inversion in such an obvious manner before (which is whats really bugs me). Considering all the other models I've made on Source, UDK and UE4. It's just unsettling to think I very well may have had this on all my maps (being generated through the same system) and never have noticed any inversion. I mean it's much easier to miss I think when just looking at a map that's working in-engine so I never thought anything of it before. Least to say I'm extremely grateful to have someone point this out. As for the mesh naming I'm assuming that's what happened with Blender. Just checking every last thing I can to remain sure, but I'm pretty sure the DSS was my problem. I'm guessing you had this issue too given you stated there was something wrong with the original one I sent but the ones my Ps plugin is producing don't actually render out in TDM. So I'll have to hunt down whoever the guy was here who gave me this plugin on the forums and ask what settings he exports with. Otherwise, I think that's the only other problem I have to nail down here. EDIT: Oh yeah and I did add in the height based specular map last night... Tried to keep it very minimal as I know id 4's rendering explodes the specular power after a certain point. I may give the tacks a bit more yet, and test some other stuff with the lights. I was actually surprised this had shadows and collision when I didn't actually have any meshes that were working for that yet. I made some funky collision mesh that you may have seen in the OBJ, but I didn't know what I was supposed to name it so I was still waiting on that. Is it just using the whole mesh to calculate the shadows then? I know self shadows is toggled, which isn't too bad unless you get really close behind it with a candle or lamp. Edited July 28, 2015 by Epifire 6 Quote Modeler galore & co-authors literally everything
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.