SSTU - Shadow Space Technologies Unlimited

SSTU - Shadow Space Technologies Unlimited

98.5k Downloads

Part Highlighting resets Cabin Lights on mouseover

Theysen opened this issue ยท 3 comments

commented
  • toggle cabin lights
  • move mouse over parts with cabin lights enabled
  • part highlighter gets active
    -> cabin lights turn off but remain active for the toggle (if activated with action group)
  • tested against a "stock" SSTU install, recreation rate success 100%
  • KSP.log: https://www.dropbox.com/s/2mirho31hmjrz70/KSP.log?dl=0
commented

Hmm... thought this might be an issue with the new lights handling.

Sadly I'm not sure of any way that it can really be fixed -- KSP does some asinine stuff with other peoples' parts shader setups, especially when part-highlighting is in play.

Will do some investigation.

Basically it comes down to the use of Unity's MaterialPropertyBlock -- I set the light animation up to use one, it sets up the properties when the light changes state, but then stock comes along behind it and overwrites the properties.

I suppose I could force re-seat the properties on every rendered frame, but that is an absolutely terrible way to do things and could result in substantial performance hit.

The other options are ?? (none that I'm aware of).

commented

-Hopefully- fixed in dev.

During each tick I now retrieve the current properties from the renderer, update the emissive color, and re-seat/update the properties.

May need to examine if I can just retrieve and update, as the 'set' call generates garbage as far as I know (gets copied). Sadly the only other methods to handle this create even -more- garbage per frame.

commented

Fixed in dev, available with the next update release.