Skip to content

Fix #57 : huge re-entry effects from camera-attached helper meshes - #58

Open
RELMYMathieu wants to merge 1 commit into
M1rageDev:masterfrom
RELMYMathieu:fix/ignore-camera-children
Open

RELMYMathieu wants to merge 1 commit into
M1rageDev:masterfrom
RELMYMathieu:fix/ignore-camera-children

Conversation

@RELMYMathieu

Copy link
Copy Markdown

Fixes #57

What changed

  • Added Utils.IsCameraAttachment(). For a given renderer, it goes through its parents one by one until it reaches the part, and returns true if one of them is a Camera or the FlightCamera rig. Real part meshes are never children of a camera, so normal vessels aren't affected by this
  • CreatePartEnvelope and CalculateVesselBounds now skip renderers that are attached to a camera. In CalculateVesselBounds this check happens before the mesh is read, so Firefly doesn't clone other mods' meshes
  • ResetPartModelCache() now runs before CalculateVesselBounds, so the bounds and the envelopes always come from the same fresh renderer list, which also removes the "only sometimes" part of the bug

This PR has fixes, which aren't specific to Deferred as explained in the issue this patches. Anything a mod hangs under a camera (Deferred's quad, EVE's ScreenSpaceShadowsManager...) is skipped. The checks only run when the effects are built.

Testing

Used the same SEP booster re-entry in a quick save before entry threshold, as in the issue, with the fix:

  • JRTI feeds open and one recording, radius 23 m, length multiplier 4.1, everything looked fine.
  • Main view on the GridFin Hullcam, the Deferred and EVE quads are skipped, radius 23 m, length multiplier 4.1, all looked normal to me in terms of effects rendering
  • SEP ship with its envelopes was unchanged as per extra testing

Possible follow-up

Not in this PR, but a per-mesh size limit (around 1 km? whichever you deem reasonable) could be a nice addition, to guard from any future helper mesh with fake bounds that we might not catch, although I can't imagine such a case. I've also fell down a rabbit hole regarding issue #55 and have a few ideas on how to fix it, but I don't know if it's maybe too much, would like to hear from you.

Anyways, hope this helps! Don't hesitate to ask if you have any questions and edit anything at your own discretion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant