Open cjsjy123 opened 3 years ago
Interesting. A bit difficult to know what could be causing this, do you mind investigating a little bit deeper and see which function calls are most expensive?
Keep in mind that SPE is a different engine and while it may perform better, it also doesn't have the same feature set / API as Nebula so there may be trade offs here. Of course I want Nebula to be as performant as it can be so I am very interested in a possible solution.
One other thing to consider is that Nebula is a mixed solution. It uses the CPU for everything other than the render call when using the GPURenderer
. This has been done to make certain parts of the API much easier to deal with. I can't really remember what the architecture of SPE is, but it could be that because it is more heavily GPU focused for everything, it will perform better, but certain other features may be harder to implement.
Any thoughts on this @manthrax?
有趣。很难知道是什么原因造成的,您是否愿意进行更深入的研究,看看哪些函数调用最昂贵?
请记住,SPE是一个不同的引擎,尽管它可能会表现更好,但它也没有与Nebula相同的功能集/ API,因此这里可能需要权衡取舍。当然,我希望Nebula表现出色,因此我对可能的解决方案非常感兴趣。
要考虑的另一件事是星云是混合解决方案。使用时,它将CPU用作除render调用以外的所有功能
GPURenderer
。这样做是为了使API的某些部分更易于处理。我真的不记得SPE的体系结构是什么,但是可能是因为它更加专注于GPU的所有工作,它的性能会更好,但是某些其他功能可能很难实现。对这个@manthrax有什么想法吗?
profilerdata.zip I like Nebula's api very much, it gives me more possibilities, but SPE is not. I can't fully simulate Nebula's particle effects with SPE, but performance is also our concern. According to the sampling results, their update costs vary greatly. Update seems to be much more expensive than SPE
I understand that it might be more expensive, I'm really interested in making it as performant as possible so I'll try to investigate why.
I'd like to know if any of the recent changes have alleviated the issues you've experienced at all.
There's been a number of updates to the GPURenderer and there was some performance improvements.
spe CODE:
` var particleGroup = new SPE.Group({ texture: { value: Resources.Load("resource/img/star.png").data } });
Nebula GPURender code: ` private createNormalNebula(render: SceneRenderGroup, scene: Scene) {
` result:
SPE faster
Nebula![image](https://user-images.githubusercontent.com/7793438/89610313-c045dd00-d8ac-11ea-9222-00d63fe9e7bb.png)
SPE![image](https://user-images.githubusercontent.com/7793438/89610347-d6ec3400-d8ac-11ea-8b05-5eb9cbbe8295.png)
any idea to imporve it?