SebLague / Solar-System

Simple solar system experiment
https://www.youtube.com/watch?v=7axImc1sxa0
MIT License
1.15k stars 315 forks source link

Atmosphere settings not updating when changing the celestial body settings of a planet. #49

Closed Panicat closed 2 years ago

Panicat commented 2 years ago

Atmosphere settings don't update when switching, for example, from Cyclops settings to Humble Abode settings.

I can still see the purple cyclops atmosphere. A way I found to fix this is changing any setting in the atmosphere settings (from wavelengths to simply the unticking and ticking the enabled bool in the inspector) however this doesn't work when done through script for whatever reason. Turning object off and on or unassigning and reassigning the atmosphere settings through script doesn't fix it even though I can see the change in the inspector.

How to force the shaders to use the updated settings?

Panicat commented 2 years ago

Even changing the variables of the atmosphere settings through script (WITHOUT switching the atmosphere setting file itself) does not work as a workaround.

Delofon commented 2 years ago

In AtmosphereSettings.cs make settingsUpToDate boolean public. Whenever you need to update an atmosphere, set that boolean to false. (if you've done zero change to post processing code, that should work)

Panicat commented 2 years ago

Appreciated, works great :)