Open code-beans opened 6 years ago
code-beans,
I realize this is a bit late, but I ran into similar issues with this when I went to implement the SharpDXControl.
I was able to solve framerate issues by including a timer to artificially call my render (I have it in fact just call the OnCompositionTargetRendering method).
To combat threading issues, I had to wrap the render methods in the application dispatcher. This also allowed me to set a priority for the SharpDXControl by doing a BeginInvoke and setting the dispatcherpriority.
Hope this helps.
Hey, first of all thanks for that great wpf control. I had way to many problems using MS' Interop library.
I am currently looking into rendering performance. Consider a barebone wpf application using the WpfSharpDxControl with an empty
Render()
method. In my understanding the framerate is determined by the number of calls ofCompositionTarget.Rendering
invoked internally by wpf. I did a little bit of testing and found out, that the will be somewhere around ~20-60 fps even with HardwareAcceleration (RenderCapacity.Tier
2) enabled. Now when putting the render callOnCompositionTargetRendering
in a while(true) loop on a different thread I get framerates in >300 fps. Unfortunately I do get a ton of exceptions when the Resize event is raised.Did you try to implement a renderloop other than (un-)subscribing to the
CompositionTarget.Rendering
event. Or do you know any reason why rendering has to be done that way? Did you do some profiling on your end regarding framerates?Thanks.