Subscribing to CompositionTarget.Rendering is sometimes useful or even needed but should be used wisely because it forces WPF to constantly render window. For this reason, starting from Eyeshot 12, we introduced the NativeExperimental renderer to stop using this event for rendering.
When I should use the NativeExperimental renderer?
If you experience a performance issue in your WPF application with other graphical control, that's time to switch to the NativeExperimental renderer.
Here below, a simple demo that shows an external control drawing a custom cursor (pink) near to the mouse pointer.
Using the NativeExperimental render make drawing follows mouse pointer with almost no lag but when Eyeshot uses the Native renderer the lag increases.
Beware when the Renderer is set to NativeExperimental, the Invalidate() method of Eyeshot performs the same operations than the Refresh() method.
A more technical discussion can be found on threads below:
- https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/optimizing-performance-other-recommendations
- https://stackoverflow.com/questions/7733990/constant-framerate-in-wpf-for-game
- https://stackoverflow.com/questions/5812384/why-is-frame-rate-in-wpf-irregular-and-not-limited-to-monitor-refresh
Comments
When I set Entity.Visible=true/false, Invalidate There is an entity that is not reflected when you call ().
When I hover the mouse cursor over the viewport, it is reflected correctly.
Also, when I set the Renderer to rendererType.Native, it is properly reflected immediately. It is reflected.
When the Renderer is rendererType.NativeExperimental
How do I make sure all Entity Visible is reflected?
Hi Yamamoto,
That's weird, please open a support ticket for this, providing a small VStudio sample that reproduces the issue. Thanks.
Please sign in to leave a comment.