Jump to content
The Dark Mod Forums

flag


Arcturus

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

I'm surprised there is z fighting in this situation. Must be something unique to the Doom 3 engine. When I model like this for games at work, the whole reason z fighting will never happen between 2 polys back to back, is because only one poly can be visible at a time, due to the very nature of the arrangement.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

I think it looks fine. Maybe just set it to noshadows if the shadow bothers you.

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

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
    • The Black Arrow

      Hope everyone has the blessing of undying motivation for "The Dark Mod 15th Anniversary Contest". Can't wait to see the many magnificent missions you all may have planned. Good luck, with an Ace!
      · 0 replies
×
×
  • Create New...