Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I've been making animated flag and I've been disappointed that "twosided" keyword doesn't work on md5mesh. Is there no way to make a 2D plane visible from both sides?

It's only a model...

Posted

Most games don't do this. What you usually do is just duplicate the polys. If this sounds "bad" it's not, because if the game had the ability to draw two sided polys, it would be actually drawing the extra polys anyway :)

 

In max it's as simple as pressing W for the move tool, selecting the polys you want to duplicate, holding shift, clicking them once, this causes a clone, then with the cloned polys still selected, click "Flip" in the modifier panel to invert the polys. You need to also right click the object, properties, then check "Backface cull" to see what the game will see.

Posted

Are you sure that it doesn't work because its an md5mesh ? Maybe something isn't right with the material definition somewhere.

 

It just seems strange that the material system should make a difference between the polygons of an md5mesh and the ones loaded from a different format :o

Posted

There are lots of things that md5meshes don't like that are ok with regular meshes, like verts that exist in more than one place on a uvmap, or merged polys that have a angle of less than 90 degrees.

 

I've run into the problem with double-sided polys as well in md5meshes. In my case it was the hair on the werebeast, so I was able to just copy and flip it since they didn't have to line up exactly. In your case I think you'll have to just make the flag 3d.

Posted
There will need to be a gap between polys to avoid the z-fighting.

Are you sure? I mean, I can see why it might happen, but I would hope that the backfacing poly would get culled completely before z-fighting ever became an issue. Might be worth testing to make sure.

 

Then again, it might be hardware/driver-dependent.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Posted

Even if it worked (and I have no evidence to the contrary) you'd still get those black areas along the edge the way we used to get them on the citywatch tunic. That was essentially the same situation as this one.

Posted

I could be wrong, but wasn't that due to screwed-up normals? i.e. The vertices at the bottom of the tunic were shared between both polygons (the one facing forward and the one facing back). Like taking a piece of paper and folding it in half to make a "V" shape. The vertices along the fold (the bottom of the V) are shared between both sides of the folded paper. So the normals of those vertices were some kind of freaky average which ended up pointing downwards. Thus, as the model's normals were interpolated over the surface of those polygons, they'd shade from their correct colour down to black or near-black (since there was no light coming up from the floor, vertices with normals "facing the floor" would not get lit very much).

 

If the polygons facing each way didn't share vertices (like cutting the piece of paper in half and thus separating its halves instead of leaving them joined by a crease), presumably the normals wouldn't be screwed up and everything would be OK. Which is, I thought, essentially what you did to fix the citywatch; cut the "join" between those polygons, or add a line of polygons so that the tunic doesn't taper to a point, and the black areas go away.

 

Thus, the flag would look fine as long as the two 2D planes weren't joined together in any way. I think.

 

I may be totally off-base here, this is mostly guesswork. :)

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Posted
If the polygons facing each way didn't share vertices (like cutting the piece of paper in half and thus separating its halves instead of leaving them joined by a crease), presumably the normals wouldn't be screwed up and everything would be OK.

 

I didn't think that message through very well. :blush: You're right, the problem was that exporting to a md5mesh automatically welds the verts unless they are separate meshes. If the two planes are on separate layers then that shadow problem should be avoided. Don't know about the z-fighting, but I'd be interested in seeing whether that happens or not.

Posted

Ah, OK, didn't know that about the md5mesh exporter. That's definitely something to watch out for then.

 

Don't know about the z-fighting, but I'd be interested in seeing whether that happens or not.

Yeah, me too.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Posted

Yes, there's no z-fight if I put the planes on separate submeshes. By the way, does anyone know what happened to models/darkmod/props/textures/flag_pirate1.tga?

It's only a model...

Posted

There is z-fighting if polys are on the same sub-mesh (or whatever it's called). Each side needs to be separate with it's own material definition in md5mesh.

I put flag_pirate1.tga and flag_pirate1_local files some time ago. Now there's only _local and editor images. I don't see what happened in the log.

It's only a model...

Posted
There is z-fighting if polys are on the same sub-mesh (or whatever it's called). Each side needs to be separate with it's own material definition in md5mesh.

 

So you've checked from a distance away? I'm a little surprised that there isn't a problem, as I've done the same thing (cloned and flipped meshes) on regular static meshes, and there WAS z-fighting at a distance.

 

Though, now that I think of it, I probably didn't put them on different layers. Maybe that would work for static meshes as well.

Posted

Yes, it's rendered properly. But each side has to be on diffderent layer in file e.g.:

 

mesh {
 // meshes: flag
shader "flag_pirate"

 numverts 21
 vert 0 ( 0.250000 0.000003 ) 0 2
 vert 1 ( 0.000003 0.000000 ) 2 1
}

mesh {
 // meshes: flag_back
shader "flag_pirate"

 numverts 21
 vert 0 ( 0.250000 0.000003 ) 0 2
 vert 1 ( 0.000001 0.499996 ) 2 2
}

It's only a model...

Posted

I put the flag on the mast in test/galleon.map. Iron rings are made using textures with alpha channel. They look good, only inaccurate shadow looks bad:

rings.jpg

 

I wanted to use as small amount of polys as possible. I think it's ok for this type of model. What do you think?

It's only a model...

  • 15 years later...
Posted

Last month I replaced the animation of the md5.mesh flag, as the original was horrible. It's still not very realistic, for a better looking flag I suggest using this one:

I would like to add another animation and blend the two randomly for a variation.

flag_no_wind.thumb.jpg.df326deb5503169c046c279ea2eda73b.jpg

I thought it would be easy, but I don't know how to do it.

//waving flag

model flag_pirate_01 {
    mesh        models/md5/props/flag/flag01.md5mesh
    anim idle    models/md5/props/flag/idle01.md5anim
    anim idle_01    models/md5/props/flag/idle_no_wind.md5anim
    
    {
    random_cycle_start
    }
}

entityDef atdm:flag_waving_pirate
{
    "editor_displayFolder"    "Animated Props"
    "spawnclass"            "idAnimated"
    "model"                    "flag_pirate_01"
    "start_anim"            "idle"
}

random_cycle_start does absolutely nothing.

  • Like 3

It's only a model...

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!
      · 5 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
      link and server depricated, lack of activity
       
      · 0 replies
×
×
  • Create New...