播放带有许多动画的粒子的视频 [英] Playing video with many particles animated on top

查看:86
本文介绍了播放带有许多动画的粒子的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AVPlayer播放电影,并在顶部设置了500个掉落的粒子动画.我试图简单地添加500个动画CALAyers.我对此进行了多种尝试,但性能始终是一个问题.只要我获得的收益超过100 CALayers,视频就会变得断断续续.这样做的正确方法是什么?我以为也许应该使用OpenGL完成此操作,但我从未使用过它,也找不到如何在OpenGL中播放视频.我可以将背景视频作为单独的帧png来获取,但是在全屏模式下,内容大小变得相当快.

I am playing a movie using an AVPlayer and animating 500 falling particles on top. I tried to simply add 500 animated CALAyers. I tried several variations on that but performance is always a problem. As soon as I get more then around 100 CALayers, the video gets choppy. What would be the proper way to do this? I thought maybe this should be done using OpenGL, but I never used it and can't find how to have a video played in OpenGL. I can get the background videos as separate frame pngs, but being fullscreen, the content size gets quite big quite fast.

推荐答案

我们最终在视频动画上使用Cocos2D运行了OpenGL层.性能受到了一些影响,但是出于我们的需要,还可以.

We ended up running an OpenGL layer using Cocos2D over our video animation. The performance was impacted a little but for our need, it was alright.

这篇关于播放带有许多动画的粒子的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆