Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DragCubeGeneration] Fix for in editor detached parts can cause incorrect drag cubes with modded shaders #150

Closed
gotmachine opened this issue May 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gotmachine
Copy link
Contributor

gotmachine commented May 31, 2023

Stock rules for drag cube generation is to ignore any renderer on layer 1 (TransparentFX).
But when a part is detached in the editor, all renderers are set to this layer, resulting in no drag cube being generated at all. To fix that, KSPCF uses the underlying stock logic to determine what was the original layer, which is that a renderer whose shader name contain the substring "Translucent" should be on the TransparentFX layer.

But not following that arcane and fragile stock rule doesn't have much side effects in practice, and consequently there are mods using shaders with the "Translucent" substring on renderers that are on the regular 0 layer. In combination with the KSPCF fix, this result in those renderers to always be ignored, causing wrong drag cubes to be generated.

As of writing, this notably result in parachutes and solar panels having wholly incorrect drag cubes when the Shaddy + TU mods are installed.

I can't think of any reliable way to both fix the in editor issue and prevent the deviation from the stock drag cube generation rules. Given that the editor issue is pretty minor while the fix has much more dramatic consequences, reverting to the stock behavior seems the best course of action.

This being said, it is possible to keep the stock behavior while adding some partial mitigation for the stock bug, ignoring the stock "ignore stuff on TransparentFX" rule when the Part.frozen flag is true. This is imperfect because :

  • The frozen flag isn't set until the part has been dropped, while the layer is set as soon as it is grabbed
  • Any renderer that would have been ignored by being on the TransparentFX layer won't be ignored, resulting in an incorrect drag cube to be generated.
@gotmachine gotmachine added the bug Something isn't working label May 31, 2023
@gotmachine gotmachine changed the title [DragCubeGeneration] Fix for in editor detached parts drag can cause incorrect drag cubes with modded shaders [DragCubeGeneration] Fix for in editor detached parts can cause incorrect drag cubes with modded shaders May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant