简体   繁体   English

如何使用HelixViewport提高渲染3D场景的性能

[英]How to improve performance of rendering 3D scene using HelixViewport

I work on 3D project in C# and WPF I use Helix-Toolkit to show different 3D objects. 我在C#和WPF中处理3D项目,我使用Helix-Toolkit来显示不同的3D对象。 I use Spheres a lot and I have also 3D text in the scene. 我经常使用Sphere,而且场景中也有3D文字。 The problem is performance, for instance I on each mousemove I calculate the positions of each text in the scene but as the number of text increase the performance decrease. 问题是性能,例如,我在每次mousemove上都计算场景中每个文本的位置,但是随着文本数量的增加,性能会降低。 I also have a Slider control to change spheres radius for each slider value as the user moves slider, this is also a problem of performance. 我还具有一个Slider控件,可以在用户移动滑块时更改每个滑块值的球体半径,这也是性能问题。 I do not know what to do is there any way to render the scene when all visual objects are changed their values because I think now the problem is that for each changed text position the 3D scene renders automatically its content. 我不知道该如何更改所有视觉对象的值而呈现场景,因为我认为现在的问题是3D场景对于每个更改的文本位置都会自动呈现其内容。

First, Helixtoolkit.Wpf is using WPF internal 3D engine, all billboards/points/lines are drawn using CPU. 首先,Helixtoolkit.Wpf使用WPF内部3D引擎,所有广告牌/点/线均使用CPU绘制。 If you have many billboards, you will experience performance hit very quickly. 如果您有很多广告牌,您将很快遇到性能下降的情况。 Try to use Helixtoolkit.Wpf.SharpDX if possible. 如果可能,请尝试使用Helixtoolkit.Wpf.SharpDX。

Mouse move has 100Hz frequency in WPF, you can try to only calculate the position every 2 move event or 3 move event to decrease the update rate. 在WPF中,鼠标移动的频率为100Hz,您可以尝试仅每2个移动事件或3个移动事件计算一次位置,以降低更新率。

I am not sure how you update your sphere size, usually you need to only update the transform to scale your sphere instead of creating a new sphere mesh each time. 我不确定如何更新球体尺寸,通常您只需要更新变换即可缩放球体,而不必每次都创建新的球体网格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM