Jump to content
The Dark Mod Forums

Recommended Posts

  • 2 weeks later...
Posted (edited)

Hey chedap, I love the .ase exporter, it defaults to sensible options and gets the material right and outputs smaller files. I exported a new sword model I made, its not that small (around 4k) and it handled that beautifully. However, when I tried bringing in other models I was working on, I got this error while dmapping: "unknown token. 'MESH_FACE10000:' while parsing MESH_FACE_LIST". Obs pointed out it should be something with the exporter, and indeed, changing back to the previous one I was using, the models load in game without problems. Check out his post: http://forums.thedarkmod.com/topic/9082-newbie-darkradiant-questions/page-328?do=findComment&comment=422955 .

If it makes a difference, the models I was importing were on the heavy side, each had several separate meshes and the tris count ranged from around 5k to 15k (they are groups of trees).

 

Hopefully this isnt difficult to fix? Thanks for this, its great work.

Edited by RPGista
  • Like 1
  • 3 weeks later...
Posted

Hi guys - I'm getting my feet wet with modeling, and was hoping maybe someone could help with a couple of questions.

 

I was starting with some base models from D3 to experiment. I was originally using one of the default blender .lwo export scripts, which did not seem to ever set smoothing on export, so unless i edited the materials to use the renderbump command, the models were faceted in game. I switched to the script referenced earlier in this post, and smoothing is definitely now set in the exported .lwo ( Yeah! ), but now I'm having a different issue - I can't seem to set a hard edge. Even if I select a portion of the model and split it off ( select faces then 'Y' to split ), the engine still smooths across that edge. The only way I could find to stop the behaviour was to assign the same material with a different name to the split portion of the mesh. Anyone experience this before? Using Blender 2.77 fwiw. Remove doubles is NOT set on the export script - just the smoothing option is set.

 

My second question is about baking normals ( which is turning out to be a pretty interesting rabbit hole ). I was trying to model a simple cup - ( styrofoam coffee cup ). I made high and low poly models, and baked the normal from the high to the low, and it generally seems to work. The issue I'm having is the seam where the normal map wraps around the cup. Where the halves of the map meet, the normals look obviously inverted on the model in game. I tried splitting the model in half, unwrapping the UV's for half the model to the full texture space, mirroring the half to complete the model, welding the halves together, moving the mirrored UVs off the 0-1 UV map, baking the normal map, then moving the mirrored UVs back. This looks better, but the normals still seem to be wrong when looking at the model from different angles in game. I feel like I'm missing something here, any ideas would be appreciated. Thanks!

Posted

Even if I select a portion of the model and split it off ( select faces then 'Y' to split ), the engine still smooths across that edge.

That would happen if you forgot to remove renderbump command from your material definition.

The issue I'm having is the seam where the normal map wraps around the cup. Where the halves of the map meet, the normals look obviously inverted on the model in game. I tried splitting the model in half, unwrapping the UV's for half the model to the full texture space, mirroring the half to complete the model, welding the halves together, moving the mirrored UVs off the 0-1 UV map, baking the normal map, then moving the mirrored UVs back. This looks better, but the normals still seem to be wrong when looking at the model from different angles in game.

TDM uses DirectX normal maps (Y-). So if you had Blender bake Y+ ones you could see weirdness at the seams, while at a glance it would seem the map is doing its job.

Other than that, could be different things, hard to guess without pictures. Try on a simple sphere: does the issue persist?

Posted

That would happen if you forgot to remove renderbump command from your material definition.

 

You know, when I first read this comment, I thought to myself 'man, what kind of idiot does this guy think I am? I checked the material def a bunch of times!'. Turns out you know exactly what kind of idiot I am - I was editing the wrong material def. :) Fixed it and problem resolved.

 

 

TDM uses DirectX normal maps (Y-). So if you had Blender bake Y+ ones you could see weirdness at the seams, while at a glance it would seem the map is doing its job.

So in blender is it as simple as switching +Y to -Y under bake/swizzle? ( does D3 also use -Y?)

 

Thanks a ton for the help - saved me lots of frustration!

Posted (edited)

Glad it helped, both were guesses on my part.

So in blender is it as simple as switching +Y to -Y under bake/swizzle?

Yes, but you don't even have to re-bake the whole thing, just inverting the green channel on an exported image gives the same result (e.g. in IrfanView "Image>Negative>Green channel").

And yes, Doom 3 also uses Y-.

Edited by chedap
Posted

Hey, another quick question - does anyone have a link to the current/appropriate .ase import/export script for blender/TDM/D3? Did a quick search but maybe I missed it.

 

Thanks again!

Posted (edited)

Look through the thread, I've modified an existing exporter.

Haven't had the time to dig into importers yet (there are at least 3 out there). Haven't properly tested them either, but I don't think either works with Blender 2.7+

Edited by chedap
  • 1 month later...
Posted

Alright, so I've checked out the four existing .ase importers, and they all could probably work with minimal tweaking, but they're all fairly basic. So this time I decided to write one from scratch.

Download Blender .ASE importer

Supports:
- Transformed meshes (position, rotation, scale)
- Multi-materials / sub-materials
- Smoothing groups (correctly converts to sharp edges)
- Split vertex-per-face normals
- Vertex colors
- UV coordinates, multiple UV channels
- Can turn tris to quads without disturbing split normals
- Can import multiple files at once, grouping meshes per-file
- Can look up textures if the path is the exact match
- Adds image nodes for Cycles (if it's the current renderer)

Limitations:
- Static triangulated meshes only
- Only imports diffuse and specular colors, not transparency, emission, etc.
- Slow when importing hundreds of files with "to quads" and "group objects" checked

- Doesn't use Blender's validate method on meshes, to avoid deleting two-sided surfaces

This is a beta release of sorts. It seems to run smoothly on TDM models and synthetic tests, as well as vanilla D3 & Q4, but I want to run some more tests still. Specifically, I might add quad support and change some material import logic if needed.
In the meantime I'd appreciate any reports of import failures. These would spit out some traceback info to Blender's info bar. I mean this thing (not "system console" or "Python console") - which will also print some non-critical errors encountered while parsing the file. Let me know if you can't explain some of those too.

  • Like 4
Posted

Alright, so I've checked out the four existing .ase importers, and they all could probably work with minimal tweaking, but they're all fairly basic. So this time I decided to write one from scratch.

Can I ask if the .ASE export file size is as efficient as .LWO..?

Posted (edited)

Alright, so I've checked out the four existing .ase importers, and they all could probably work with minimal tweaking, but they're all fairly basic. So this time I decided to write one from scratch.

 

TDM gets its very own ASE exporter? Thats absoutely amazing, man. Youve become our resident file formats expert in no time. I will be sure to check this guy out, as Ive been working with vertex blends and Ive been having difficulties making them work on the lwos Im exprting. Those new features and improvements sound incredible, specially al the attention to normals, which are the most troublesome part of game modelling for me. And the efficiency gains... Huge kudos.

Edited by RPGista
Posted

Actually I also have a question about your lwo exporter. Ive been using it flawlessly and getting consistent results. But I am getting problems with vertex alpha blends using lwos. The model with materials show up but there doesnt seem to be any blending occuring (each section only shows one material). Maybe Im making some simple mistake somewhere along the line, but looking for options inside blender I noticed this function at the botton of the material windows, and thought it would be a good idea to select the vertex map for each mesh before exporting but the button is simply non selectable. You cant change the "none" option. Is this a problem? Or am I missing something?

 

post-8474-0-09311700-1536244025_thumb.jpg

Posted (edited)

TDM gets its very own ASE exporter?

Exporter's on the previous page, this one's an importer.

Actually I also have a question about your lwo exporter. Ive been using it flawlessly and getting consistent results. But I am getting problems with vertex alpha blends using lwos.

I only changed a couple of lines in the lwo exporter, it isn't mine.

That said, you should be able to select any of your vertex color layers, like so. Make sure you have some data to export, I guess? I don't really know if the option works, I haven't tested it in lwo's personally (might test it later today)

 

Edit: imported blend_ground.ase from "A House of Locked Secrets", selected vertex color layer, exported it back out as .lwo, seems to be working as expected. Keep in mind that your blend won't show up in DR, only in-game.

Edit of edit: or not. what's up with the bricks showing through where they shouldn't? Will look into it.

Edited by chedap
Posted (edited)

Preliminary stuff on lwo vertex colors: you have to export as "idtech-compatible" to have any blending show up in TDM. But it only seems to export boundaries between colors? Or something with the alpha? I don't know, it's weird, and the exporter has a bunch of vertex color-related code commented out. I'll get around to it by the end of the week, but it's not immediately obvious.

Would you be interested in assisting with this issue:

 

http://bugs.thedarkmod.com/view.php?id=4825

Please elaborate on what needs to be done (I don't have access to the referenced thread btw).

I've seen the issue and exchanged some PMs with @stgatilov, although I thought the issue was the same as this one. I've since learned the latter is called the "shadow terminator" problem and is a common occurence in a lot of engines. Maybe it is the same as the one on the tracker, maybe not.

Edited by chedap
Posted (edited)

Edit of edit: or not. what's up with the bricks showing through where they shouldn't? Will look into it.

 

Thing is, I cant click on the dropdown at all, it simply wont respond, so I cant choose the vertex color map. The "none" is fixed. I am using version 2.79b (or was it c?), so maybe its some sort of incompatibility... Good to hear you are on the major issue, though.

Edited by RPGista
Posted

What other games even use .lwo? This whole idtech-compatible thing is a bit baffling to me. The "incompatible" files seem pretty compatible with TDM, meanwhile the Blender importer (that ships with it) chokes on them.

So yeah, anyway, I just removed a couple lines and it works, with the added bonus of now being able to export "sharp" vert-per-face colors, like so. Another headscratcher. Downoad here for now, but I guess I'll probably eventually rewrite this one as well.

The "none" is fixed.

I'm on 2.79b, can't reproduce. Are you saying it's actually inactive or that "none" is the only choice in the drop-down selection? Can you try it on another version (or same but fresh)? Just download a zip version, unpack and run, no installation required, won't ruin your configs.

  • Like 1
Posted (edited)

You can export those using the modified .ase exporter. With regards to lwo, I don't see vertex normals in the spec. Here's how TDM source code describes handling them:

Calculate the vertex normals. For each polygon vertex, sum the normals of the polygons that share the point. If the normals of the current and adjacent polygons form an angle greater than the max smoothing angle for the current polygon's surface, the normal of the adjacent polygon is excluded from the sum. It's also excluded if the polygons aren't in the same smoothing group.

This seems to confirm what I assumed about lwo smoothing previously: with quads triangulated, smoothing gets skewed at the surface boundaries, since one of adjacent quads is counted twice.

Edited by chedap
  • 1 month later...
Posted (edited)

Perhaps it might be useful to keep links for the latest versions of the scripts in the first post. Someone looking for that might have to re-read the whole thread. Or like me, someone who hasn't yet read the whole thread might be wasting time downloading one of the previous ones.

 

I've tried using your ase exporter, but something's wrong. The exported model isn't textured. I'm using R Soul's Material Manager, but it doesn't seem to make a difference.

Nevermind that. Seems like the problem was that I had several UV layers.

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

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

    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 3 replies
    • Goblin of Akenash

      My mapping discord if anyone is interested, its more of a general modding thing rather than just for TDM 
      https://discord.gg/T4Jt4DdmUb

       
      · 0 replies
×
×
  • Create New...