Author Topic: What is needed for a correct shield mesh ?  (Read 3408 times)

0 Members and 1 Guest are viewing this topic.

Offline Col. Fishguts

  • voodoo doll
  • 211
What is needed for a correct shield mesh ?
Ok, let's say I have a custom fighter with its own shield mesh.  Now the problem is that the shield hit effect behaves rather weird in some places. It seems that the effect gets mapped to some polys it's not supposed to, while omitting some polygons where it should be mapped instead (see picture). Or in some cases, when I shoot at one end of the shield some polygons on the other end of the shield light up slightly too. The shield itself works perfectly, no collision errors or somesuch, it's just the shield hit effect that's acting up.



Since I first suspected it was the Max exporters fault, I converted the shield mesh to 3DS and the COB via TrueSpace, and then converted it with both PCS1.x and PCS2, but the result is always the same. So it's not a conversion error, but rather an error in the way the mesh is constructed, I'm suspecting something with the vertice/edge order of the mesh.

So I'm asking anybody who ever succesfully created a fully working shield mesh, what's the trick to get it behave normally ? I know it has to be triangulated, which mine is. So, something else ?
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline maje

  • 28
Re: What is needed for a correct shield mesh ?
Ah, this looks like a fun problem.  I'm trying to think now, did you weld all the vertices?  Remember to assign smoothing groups? check the direction of normals?  Have you tried deleting the offending faces and just recreate them?

I've never worked on a shield before, so I could be wrong.  I have however ran into strange rendering errors like this before in Maya.  Sometimes it's a polygon that needs to be flipped or recreated because something got screwed up.  Another way to check is to do a SUB-D check on the mesh. 
If it smooths out fine with no disconnected areas or strange holes, you're okay.  If you do get holes, it has something to do with your normals orient ation for that face or group of faces.
Deuternomy 22:11 explained:

Well there are many different speculations going on about this law about not mixing fibers and at least one explanation claims that it was a symbolic gesture designed to keep a pure sense of culture, people, and religion.  Seperation of crop  in the vinyard, mentioned in Dt. 22:9 and 22:10 seem to reaffirm this idea, though there may be other reasons as well.

And now, an excerpt from the Prayer of Mordecai, the Book of Esther Chapter C (New American Bible Official Catholic version).

Est C:5  You know all things.  You know, O Lord, that it was not out of insolence or pride or desire for fame that I acted thus in not bowing down to the proud Haman.  6  Gladly would I have kissed the soles of his feet for the salvation of Israel.  7  But I acted as I did so as not to place the honor of man above that of God.  I will not bow down to anyone but you, my Lord.  It is not out of pride that I am acting thus.

 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
Re: What is needed for a correct shield mesh ?
That looks more like a UV mapping problem to me... :nervous:
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
...did you weld all the vertices?  Remember to assign smoothing groups? check the direction of normals?  Have you tried deleting the offending faces and just recreate them?

Yes, everything is welded. Smoothing has no influence on the shield mesh, neither does UV mapping. What I've observed is that if I do a mesh-smooth on the shield, all the newly inserted faces are causing problems, and when I delete them and weld the vertices the problem disappears on that face. That's why I suspect the vertex/edge order to be part of the problem.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
post a 3ds of just the shield.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
post a 3ds of just the shield.

Here: Clickety

This contains the original shield I wanted to use, as well as a slightly poly-reduced version, which behaves a bit better, but still not as it should.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
Some of the mesh wasn't connected to itself. - Don't know if this is is an issue for the Max plugin.
(modified mesh mirrored and welded)

[attachment deleted by ninja]
« Last Edit: February 08, 2008, 06:38:55 pm by Water »

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
Some of the mesh wasn't connected to itself. - Don't know if this is is an issue for the Max plugin.
(modified mesh mirrored and welded)

Hmm, I used PCS2 to convert your mesh, and while it looks better than my attempts, the rendering errors are still there. Can you produce a correct shield from the mesh you posted ?
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
Seemed ok - Although I put the shield on an Apollo  :nervous:  - (PCS2d)
« Last Edit: February 09, 2008, 06:30:29 am by Water »

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
Could you post the POF ? If yours works correctly I could import the shield to my POF in PCS  ;7
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
Let me know if it works. It was hard to test because the Apollo is totaly the wrong shape.
http://files.filefront.com/shield+fghtrzip/;9602219;/fileinfo.html

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
Sadly it's ridden with the same bugs as my version. Especially on the front part much weirdness is going on:



But thanks for you efforts anyway.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

  

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
Could you test this shield for the problem
http://files.filefront.com/shield+azip/;9611665;/fileinfo.html
It's basically going the other way -  down to 80 poly

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
That one works nicely, although it's a tad too small.
Did you make that from scratch ? If yes, with what program ? Maybe the problem is with 3ds Max itself.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
Aha, the plot thickens. I've also made a new one from scratch starting with GeoSphere of exactly 80 faces, and it also works.
Closer inspection of :v: fighter/bomber POFs reveals that they all have shield meshes of exactly 80 faces, coincidence ... I think not.
I'm suspecting that there's something hard-coded into the engine that assumes that the shield mesh has always 80 (or less) polygons, and that any excess polys are omitted from the shield effect rendering.

I also checked some other fan-made POFs, and one that I found with a shield mesh of more than 80 faces is Nico's HTL Ezechiel, and lo and behold: its shield also has rendering glitches when shot at. I think we need some insight from a coder.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Re: What is needed for a correct shield mesh ?
hmm

Code: [Select]
#define SHIELD_HIT_SCALE 0.15f // Doubled on 12/23/97 by MK.  Was overflowing.  See todo item #924.
//#define MAX_SHIELD_HITS 20
#define MAX_TRIS_PER_HIT 40 // Number of triangles per shield hit, maximum.
#define MAX_SHIELD_HITS 20 // Maximum number of active shield hits.
#define MAX_SHIELD_TRI_BUFFER (MAX_SHIELD_HITS*MAX_TRIS_PER_HIT) //(MAX_SHIELD_HITS*20) // Persistent buffer of triangle comprising all active shield hits.
#define SHIELD_HIT_DURATION (3*F1_0/4) // Duration, in milliseconds, of shield hit effect



[edit]
i don't see any reason why there should be an 80-polygon thing going on.. i don't see anything in the code that should be causing that
« Last Edit: February 11, 2008, 11:12:46 am by Kazan »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
#define   MAX_TRIS_PER_HIT   40   //   Number of triangles per shield hit, maximum.

Would this mean that only 40 triangles can be lit up at one time on a 500 poly shield mesh?

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
Code: [Select]
#define MAX_SHIELD_TRI_BUFFER (MAX_SHIELD_HITS*MAX_TRIS_PER_HIT) //(MAX_SHIELD_HITS*20) // Persistent buffer of triangle comprising all active shield hits.
This one also looks suspicous, especially since  "//#define   MAX_SHIELD_HITS   20" is commented out in the code bit above. Maybe MAX_SHIELD_HITS is defined somewhere else as 2, limiting the MAX_SHIELD_TRI_BUFFER to 80.

Alternatively, the problem could also lie in the part where the shield effect bitmap gets mapped to the shield mesh. I'm guessing that the engine dynamically generates UV coordinates for each hit effect. Maybe during this process, the engine assumes a maximum of 80 faces for the shield mesh.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Water

  • 210
Re: What is needed for a correct shield mesh ?
Have a quick look at  :v: freighter06
Shield 180 faces, bubble style - not form fitted to model.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: What is needed for a correct shield mesh ?
Hm, you're right. But all the FS1 freighter POFs have those 180 poly bubble shield meshes. But ingame the freighters have neither a shield nor shield hit effects, so I guess the idea of shielded freighters was dropped during the development of FS1. The newer FS2 freighters don't have a shield mesh.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea