Closed GasimGasimzada closed 4 years ago
You're right that roughnessGain is being modified, but it should not really have any effects in subsequent renders, as it is calculated every time. I don't see any other instance where any other property is being modified. Maybe I missed something.
So, I'm not sure this will fix your problem.
Can you elaborate more what exact issue you're running into?
Not needed anymore. roughnessGain has been removed from options and is not mutated
There are some parts in the renderer where the options object is being mutated by some functions (e.g _line function in renderer). If you are using custom parameters, because default parameters and the custom parameters are merged, the resulting object is a cloned object that we can work on. However, if custom parameters are not passed to these functions, the original value of the default parameters will be used. As a result, any custom object that doesn't specify a value will be overridden by the changing default value.
By cloning default options we can always preserve the original default values, which will stop bleeding of parameters between rendered elements.