Closed assertivist closed 4 years ago
This may be related to why the inside of missiles look weird. I noticed it's difficult to see incoming missiles because I think the inner red part is either only partially displayed or gone (or maybe not red at all). You can also clearly see a difference when a missile is loaded. Compare:
To:
@shrizza I think those are two separate issues actually. The inside color of the missile not being correct is related to issues #2, #3, and possibly #9. Issue #2 has the most helpful information on the problem, but the short explanation is that CBSPPart::ReplaceColor
is not implemented correctly.
The other contributing problem is the way OpenGL draws polygons that intersect with the camera. As far as I understand it, at least.
@shrizza This isn't really the place to talk about this, I suppose, but the issue with fired missiles not lighting up has been resolved by #14.
I'm adding this here because the converter is in the process of being merged into our repo's scripts directory instead of its own directory.
The missile shape stems from a larger issue during shape conversion for avara--there are self intersecting edges in that shape so the converter has to reorganize the shape to account for new verts added during triangulation to compensate for these self intersecting edges.
Beyond that, from doing experiments with lighting, it seems that some of the models (at least including but not limited to the head model) have improper normals causing lighting to be incorrect:
This shows the hector head lit from above, where both sides of the main hull shape should be lit in equal amounts. Clearly the normal is flipped here and is giving the lighting value for the wrong side of the shape.
Updates on this: The normals being wrong are a side effect of the double-sided face thing. So I'm no longer as worried about that.
The self-intersecting shapes are still a problem. The way I have this set up, each polygon of a BSP is flattened into a 2d plane for the Triangle library to operate on, and give a list of triangles to fill out of the edge/vertices. With these self-intersecting shapes, the library adds new vertices to make the shape regular.
However, it does this in the 2-space of the flat face and not 3-space of the BSP as a whole, so I can't just add the new vertices to the shape, without converting them back into 3-space. This is proving very difficult to do correctly so that the vertices end up in the right places.
What I do currently is take an arbitrary pair of vertices from the face and use that as a vector in the plane of the shape to project all vertices on to a 2d plane. But it seems that the length of that vector has an effect on the scale/position of the resulting projection. I'm gonna try to reach out to some folks to see if there's a better way of making sure that these projections (and their reverse) end up the same every time.
The normals and stuff look much better now. I haven't seen any graphical bugs with the new converter code.
see avaraline/avara-level-converter#1 - this is a self intersecting shape