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

    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...