Jump to content
The Dark Mod Forums

Blender Request


Springheel

Recommended Posts

Could someone with blender open up the following models and move the hinges a quarter grid or so away from the door? The z-fighting issue with those hinges has been floating around for at least a year. It would probably take 3 minutes tops to fix it, but I can't open .ASE files without losing the uv-map.

 

models/darkmod/architecture/doors/door96x48_2hinge.ase

 

models/darkmod/architecture/doors/door96x48_3hinge.ase

 

models/darkmod/architecture/doors/door104x56_2hinge.ase

 

models/darkmod/architecture/doors/door96x48_3hinge.ase

 

models/darkmod/architecture/doors/door128x56_2hinge.ase

 

models/darkmod/architecture/doors/door128x56_3hinge.ase

Link to comment
Share on other sites

I had a quick look in Blender, and noticed that the hinges already have a small offset away from the door. This could of course be increased, but that suggests it would only "postpone" the problem rather than solve it.

 

Also, although importing and adjusting the geometry is very quick and the UV map is preserved, the materials themselves would have to be manually re-assigned within Blender and then re-modified to point to the required Doom 3 shader after export, which would make it considerably more than a 3-minute process (although it could be done if there is no other option).

 

I had a look at the material definitions however, and noticed that on the ones I looked at (lockplate01 and bc_hinge01), there is no DECAL_MACRO, polygonOffset or anything else that would normally be used with decals to prevent z-fighting. Have you tried adding a DECAL_MACRO to the material definitions to see if it solves the problem?

Link to comment
Share on other sites

I'm pretty sure we tried all those things a year ago when this first came up. Let me see if I can find the thread.

 

This is all I can find at the moment: http://forums.thedarkmod.com/index.php?showt...hinges&st=0

 

I don't remember, but apparently: "Polygonoffset seems to be designed to address exactly this problem, but for some reason it doesn't work for me--it just turns the material black and the z-fighting is still there. I thought turning the texture into a decal might work, but it has the same result."

 

Seems like there were a few working options:

 

1. Move the hinges further out on existing doors.

 

2. Make new door models with fully modeled hinges.

 

3. Use a LOD system to swap between two different models

 

 

Maybe #2 is the way to go....would the extra polys be significant if they were non-shadowcasting?

-

the materials themselves would have to be manually re-assigned within Blender and then re-modified to point to the required Doom 3 shader after export, which would make it considerably more than a 3-minute process (although it could be done if there is no other option).

 

That's annoying. It would take me literally 15 seconds each if they were .lwo files.

Link to comment
Share on other sites

Seems like there were a few working options:

 

1. Move the hinges further out on existing doors.

 

2. Make new door models with fully modeled hinges.

 

3. Use a LOD system to swap between two different models

 

I would suggest making sure that every possible material-based approach is exhausted first; if ordinary decals work correctly at a distance, then there's no reason why these hinges shouldn't work the same way, and if ordinary decals don't work correctly then we have bigger problems than just these doors.

Link to comment
Share on other sites

Well, I tried several things but I am far from an expert at material shaders. Anyone want to volunteer to take a shot at this?

Link to comment
Share on other sites

I created a test map which reproduced the problem and went through every possible combination of material keywords I could think of, and have come to the conclusion that yes, these hinges are completely fucked.

 

Using an alphatest decal should work, and is used elsewhere (at least in Doom 3), but for some reason the decal-related keywords make the hinges go black as you observed (I even replaced the image with a bright purple one for testing, with the same result -- RGB channels are ignored), and the alphatest itself becomes unreliable at distance and allows the transparent area to show through.

 

I suggest just going with hinges as part of the door texture; this means that you can't swap out hinges so easily, but I suspect it is more important to have a variety of doors-with-hinges as a whole, rather than a variety of hinges on an otherwise identical door texture.

Link to comment
Share on other sites

Just for information (I don't want to get in the way if material changes would work even better), just want to clarify with the following image that while it is a quick-fix type of thing, it does a pretty good job. The 'fixed' photo is taken at a distance of 2400 units, which will be a rare viewing distance for a door in missions, most likely.

 

Post with image.

 

Anyway if there are better methods, by all means let's use 'em. But the adjusted hinge plates isn't so bad a fix. Unless I'm misunderstanding what's meant by replacing the shader names, it's just a matter of copy/pasting a line of text (from the former file) into a text file (the new file). So 3 mins becomes 4 mins.

 

Edit: is Baddcog gone, then?

Link to comment
Share on other sites

just want to clarify with the following image that while it is a quick-fix type of thing, it does a pretty good job. The 'fixed' photo is taken at a distance of 2400 units, which will be a rare viewing distance for a door in missions, most likely.

 

Is that the version with the hinges moved slightly out? I still think that's a good idea, even we eventually replace the textures. Building the hinges into the dozen+ textures is going to take a LOT longer than adjusting the hinges slightly.

 

is Baddcog gone, then?

 

I guess. I've asked him twice since January if he could modify them, but haven't heard back.

Link to comment
Share on other sites

Agreed. It might not be the perfect solution, but it's easy enough to warrant doing and works well enough. True it might need improving upon some day, but I think it's probably okay to do the job, short of remodeling, adding complexity, blah blah blah. I assume I might be able to do it, in fact (haven't checked).

 

Very sad if BC has left. First Pink, then him. Sigh.

Link to comment
Share on other sites

Okay from a prelim look, it appears the hinges on the originals were about 3 units (in blender) out from the door. In the fixed/test version he uploaded, the hinges were moves to about 26 units out from the door. That and four *bitmap lines to define the materials used. Unless I'm missing something, this shouldn't be too hard to do.

Link to comment
Share on other sites

That may present a problem if you try to export, because the Blender units will map 1:1 with Doom 3 units (they are just numerical coordinates, with no absolute reference or scale). Maybe the original modeller re-scaled the objects before exporting?

Link to comment
Share on other sites

That could be an issue I suppose. I personally won't be able to give it a full attempt for a bit, but I'm adding it to my growing list of may-never-finish mini-projects. Anyone can do it really, I'm not claiming it. I'll drop BC a PM and see if he has any input on the subject.

Link to comment
Share on other sites

I might just convert them to .lwos at this rate and redo the uvmap (it's basically working with squares anyway). Working with .ases seems to be a lot of hassle.

Link to comment
Share on other sites

What do you use to convert them greebo? If it's something that preserves the uvmap, then please do. Otherwise I can just use DeepExploration.

Link to comment
Share on other sites

Hm, well okay. I'm in the middle of trying it out with ASEs (I think I almost have it), but either way I guess.

 

I haven't done anything yet, so I can hold off if you're working with it. Your post above lead me to believe you wouldn't be able to tackle it for a while.

Link to comment
Share on other sites

Blender can certainly write LWOs with the UV map, so converting from ASE to LWO with Blender would be possible. However the final material assignment would have to be done in LightWave, since Blender's annoying 20-character limit on material names renders the LWOs useless for Doom 3 in many cases (it's OK if you write your own skins, but if you want to use textures/darkmod/stone/something then it won't be enough).

 

It's a pity really, because setting the shader name in Blender and then exporting directly into the models/ hierarchy would be a much quicker workflow than having to edit the material names afterwards.

Link to comment
Share on other sites

Well, it didn't really work out perfectly. See image. The process involved importing the door, creating a new material for each submodel, assigning a temp texture to each submodel, exporting the door as a whole, and then changing the *bitmap lines in the file by hand. So, a bit more than 3 minutes (each). While all of that did work, it did not preserve the UV map properly. For some reason, at least one of the triangles is inverted or borked in some way (you can see it if you look closely at the top left and top middle doors). I told both the import and export to use/preserve the UV but it didn't, so I assume there's some change somewhere along the line.

 

So anyway, if you wanna convert them to LWO, that's cool. It looks like we could still go with ASE too, but it would take a little longer to fix the UVs. I do prefer that as it is an open and free format, not limited to Lightwave, but it's just a rectangle, so... *shrug*

 

It's a pity really, because setting the shader name in Blender and then exporting directly into the models/ hierarchy would be a much quicker workflow than having to edit the material names afterwards.

Hm. Is it possible TDM compiles its own version of Blender, without the limitation? I'm sure the Doom community at least would love us for it.

post-58-1241556907_thumb.jpg

Link to comment
Share on other sites

Well, it didn't really work out perfectly. See image. The process involved importing the door, creating a new material for each submodel, assigning a temp texture to each submodel, exporting the door as a whole, and then changing the *bitmap lines in the file by hand. So, a bit more than 3 minutes (each).

 

My god. :blink: That's what I mean about .ase sounding like a huge hassle to work with. In lightwave, I'd load the model, select the hinge polys, move them a couple units out, and save it. Takes less than 30 seconds.

Link to comment
Share on other sites

Hm. Is it possible TDM compiles its own version of Blender, without the limitation? I'm sure the Doom community at least would love us for it.

 

From the searching I've done it sounds like the 20-char limitation would be quite difficult to change; I'm sure if it was a trivial fix they would have done it by now, but I believe Blender is an application based on C structs, and it's quite possible that there is a 20-byte char array in there somewhere which would require modification throughout the codebase.

 

However, Blender does have a text window which creates text objects which can be saved in the file, so I wonder if it would be possible to use a text object to map Blender materials to Doom 3 materials in a similar manner to my Python script, and have the ASE exporter automatically perform the replacements on export. This wouldn't have helped in this situation, but it would be useful if you have a Blender scene with objects that you want to repeatedly edit and then export.

Link to comment
Share on other sites

Sorry guys, I phail.

 

Got bored/ occupied with other stuff and kept meaning to get it done but just no motivation for some reason.

 

I'll devote some time to it this weekend. It doesn't take long to fix, but after export I gotta go through 5 materials and figure out the correct slots in the ase. and gotta close/open doom each time to test or whatever.

 

I'm probably not gonna do much else past this though, sorry. If I'm not feeling it I just can't force myself. And maybe I'm just bored with the whole Thief thing or something.

I kept thinking 'not today, tommorrow... next week...', eventually I'll get over it and back into it.

 

But I will do the hinges and fix that door frame this weekend.

Dark is the sway that mows like a harvest

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

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
×
×
  • Create New...