Jump to content
The Dark Mod Forums

Couple Modeling Questions


Epifire

Recommended Posts

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.

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

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
}


}

Link to comment
Share on other sites

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.

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by Epifire

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Xcen
  • Like 2
Link to comment
Share on other sites

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 -

 

post-496-0-17220100-1437945266_thumb.jpg

 

And then I realised something I had been seeing on the grandfather clock might be caused by the same thing -

 

post-496-0-17340800-1437945277_thumb.jpg

 

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.

Link to comment
Share on other sites

@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).

 

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 better

compressor programs out there) it is too prone to artifacts. It would be cool if someone made something like VBR compression for textures so you could

selectively preserve detail better. If anyone knows of a better RXGB compressor for normal maps it would be a life saver.

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...)

Link to comment
Share on other sites

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. :unsure:

 

Original source tgas. https://www.mediafire.com/?djfl7ubs81msa51

Edited by Epifire

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

  • @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. :unsure:
  • 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.
Link to comment
Share on other sites

Normal maps don't use alpha as far as I recall, in fact I'm pretty sure the blue channel is reconstructed in the shader

so they mostly use red and green. That's why red is set to 0 weight. It's swapped (swizzled) with green in the shader

because the red channel is given less bits to work with in the compressor so to preserve detail it's encoded reversed

then 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 either

the 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 raytrace

similar to gathering it from image captures for PBR.

 

On consideration, the quickest way would probably be to generate a greyscale heightmap in blender or even

in njob (I think it can do heightmaps via normals as I recall). Then reduce the contrast and blur so you've got

specular roughly aligned with AO and more physically accurate as specular is a form of reflectance and protrusions

are 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 rough

average in specular.

  • Like 1

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...)

Link to comment
Share on other sites

One more note on speculars if you haven't already gathered. They should be very dark unless you really want them to shine

like crazy. Our specular ramp goes from 0 to 1000 very quickly so be conservative with brightness.

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...)

Link to comment
Share on other sites

 

  • 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 shader

so they mostly use red and green. That's why red is set to 0 weight. It's swapped (swizzled) with green in the shader

because the red channel is given less bits to work with in the compressor so to preserve detail it's encoded reversed

then 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 either

the 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 raytrace

similar to gathering it from image captures for PBR.

 

On consideration, the quickest way would probably be to generate a greyscale heightmap in blender or even

in njob (I think it can do heightmaps via normals as I recall). Then reduce the contrast and blur so you've got

specular roughly aligned with AO and more physically accurate as specular is a form of reflectance and protrusions

are 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 rough

average 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

  • Like 1

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

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. :D

Edited by Epifire

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

Made a comparison. In both the upper one is with the green channel inverted.

post-3833-0-25715200-1438090868_thumb.jpg
post-3833-0-70502200-1438090879_thumb.jpg
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_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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 1 reply
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...