EasyGame Lesson11 – Explosion Particle Effect

本文探讨了游戏开发中粒子效果的使用与优化策略,包括避免运行时加载、预加载、分离时间变化元素以及利用连续数据提高处理速度。文章还介绍了简单的爆炸粒子效果实现,并提供了源代码。

Particles are some kind of visual effect, such as explosion, gun shot spark,  or fountain, rain and so on. Usually, they are transparent meshes or planes. From my experience, you could not play too many particles effect in the view at the same time. This will cause some serious frame rate problem, and the situation will become worse when the particle material is very complicated. Because the transparent objects render overlap the solid objects, this will cause some large area covered and re-paint on the screen frame buffer. Of course, you may want to adopt a separate and small frame buffer to hold the transparent objects. But you need to provide a small depth buffer at the same time.

Another thing need to take care about particle is DO NOT load particle at the running time. You should pre-load them during the level loading.

When you want to design your own particle system, please separate the time varying vertex element from time constant vertex element. That means you read the data you want and update it, no more or less. With CPU data cache feature, continues data will be processed much faster than no-continues data. Although this way will break the Object-Oriented policy, but some evidence already proved this could improve the performance.

This sample shows us a simple explosion particle effect. This particle will update as time goes by, and disappear at last.
screen_shot 
The full source code could be found from here.

转载于:https://www.cnblogs.com/open-coder/archive/2012/12/30/2839540.html

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值