优化WPF 3D性能
2021-07-14 00:14
If you must use a VisualBrush or a DrawingBrush in a 3D scene because the brush’s content is not static, try caching the brush (setting the attached property CachingHint to Cache). Set the minimum and maximum scale invalidation thresholds (with the attached properties CacheInvalidationThresholdMinimum and CacheInvalidationThresholdMaximum) so that the cached brushes won’t be regenerated too frequently, while still maintaining your desired level of quality. By default, DrawingBrush and VisualBrush are not cached, meaning that every time something painted with the brush has to be re-rendered, the entire content of the brush must first be re-rendered to an intermediate surface.