BVE-Reborn/rend3

Damaged mesh - preliminary report

John-Nagle opened this issue · 10 comments

Screenshot from 2023-03-25 21-50-07
Screenshot from 2023-03-25 21-18-47

New damaged mesh bug. This is preliminary. It might be my fault. I'm posting this in case it's been seen by someone else.

Notes:

  • Intermittent. Appeared twice yesterday, on different executions of the program. Did not appear again,even in the same scene.
  • In escalator image, both escalators are generated from the same MeshObject but with different textures. So the
    mesh object is corrupted somehow.
  • (The character on the right that's not fully assembled is normal. That's rigged mesh, without rigging implemented.)
  • On a rerun, the same mesh object is not corrupted, so the file contents are OK.
  • The mess of jaggy black triangles is supposed to be a two-sink bathroom vanity.
  • That one had large jagged triangles sticking way outside the building.
  • Some of those large jagged triangles disappeared as the viewpoint moved, suggesting a problem that happened after the culling sphere was computed.
  • Seen with Rend3 rev = "c2c2d3237"
  • Never seen in the past with Rend3 rev = "4d10795" or earlier, although that scene has been looked at for the past year.

Happened again. Still not repeatable.
Screenshot from 2023-03-26 19-29-23
Screenshot from 2023-03-26 19-28-23

Only one Mesh in the Rend3 sense is corrupted,

Progress! Got another failure. A picnic table is turning into a garbage mesh, much larger than the object is supposed to be. But frustum culling occurs based on the normal bounding volume of the garbaged object (a picnic table).

First. here's what the picnic table is supposed to look like, from a separate execution of the program.
Screenshot from 2023-03-27 20-02-09

Now, here are some views of the damaged mesh, from slightly different viewpoints.
Screenshot from 2023-03-27 19-57-39
Here's the damaged mesh. Note the bag of chips, which sits atop the picnic table, or where the picnic table was supposed to appear. So the picnic table is within the viewing frustum here.

Screenshot from 2023-03-27 19-57-43
Here's a slightly different camera angle. The picnic table is outside the viewing frustum, and the damaged mesh disappears.

I've tried this from many different viewpoints and directions, and it's consistent. If the real object is outside the viewing frustum, the damaged mesh does not appear. If it's inside the viewing frustrum, it does. Lots more screenshots available.

So the mesh corruption is happening after the bounding sphere is computed. That should narrow down the problem.

Screenshot from 2023-03-27 19-55-54
Damaged mesh, from further away. Note that the viewing frustum, at its left edge, reaches the picnic table area in the background.

Screenshot from 2023-03-27 19-55-52
A very slight turn of the camera, just enough to put the picnic table location outside the viewing frustum, and the damaged mesh is gone.

Distance doesn't matter. Direction of view doesn't matter. Only whether or not the damaged object is inside the viewing frustum seems to matter.

So far, I have not seen this problem in GPU culling Rend3. But it was rare, so I can't be sure.

The other big visual defect, occasional single frames of all white, seems to have disappeared. So far, so good. More info to follow.

I'm going to close this for now, if it re-appears, please let me know and I'll re-open.

Agree. I have not seen that problem at all post GPU-culling.

Sometimes, they come back.

garbagegeom4
garbagegeom3

This is intermittent. These misplaced triangles appear and disappear as the viewpoint changes. They do not move. They do not cast shadows. Hard to reproduce.

This test case is in a relatively simple scene which is nowhere near to filling up the GPU or hitting the 2GB limit.

Rend3 rev = "9065f1e", which is post GPU culling.

There were some pretty major issues fixed in #551, but as always, if it's still there, please lmk and I'll re-open.

Back again in rev c7c2d85.

junkrendering

Those lines across the sky are misplaced vertices. Moves in the viewpoint make them disappear or reapppear.