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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...