asysbang

 找回密码
 立即注册
查看: 7292|回复: 1
打印 上一主题 下一主题

Renderscript

[复制链接]

520

主题

2

好友

6551

积分

管理员

Rank: 80Rank: 80Rank: 80Rank: 80Rank: 80

最佳新人 活跃会员 热心会员 推广达人 宣传达人 灌水之王 突出贡献 优秀版主 荣誉管理 论坛元老

跳转到指定楼层
楼主
发表于 2013-4-23 17:52:08 |只看该作者 |倒序浏览
官方介绍
http://developer.android.com/guide/topics/renderscript/index.html
Renderscript provides a platform-independent computation engine that operates at the native level. Use it to accelerate your apps that require extensive computational horsepower.

对于需要大量计算的应用来说,采用Renderscript无疑是最好的选择

首先看下Renderscript的实例,
动态壁纸:水面落叶、线性光幕效果、黑洞,都是用Renderscript实现的

源代码中提供了2个例子:
development/samples/RenderScript/
       HelloCompute/                 ----     (Eclipse可以找到)
       Levels/                             ----     (只能在源代码下找到)
       Balls/                                ----     (android4.0)
       Fountain/                          ----     (android4.0)
       MiscSamples/                   ----     (android4.0)


此外,packages/wallpapers/    下面有“水面落叶、线性光幕效果、黑洞”这些动态壁纸的源代码

下面是从Basic里面提取的Fall部分的例子 (需要android3.0以上版本运行)
主要修改内容是解决编译错误和 完善activity运行
原始的代码service那边是正常运行的,但是activity是不能运行的,所以把service里面的surfaceCreated  和surfaceChanged 拿到FallView 里面



PS :  下面是一个根据水面落叶写的水波纹效果 ,写的比较详细
      http://download.csdn.net/download/singleton1900/4975456




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|aSys-帮 ( 京ICP备13033689号 )

GMT+8, 2026-1-28 23:01 , Processed in 0.048115 second(s), 19 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部