flash转html5工具LavaH特性介绍(一)矢量图形高效率无损缩放

小李的飞刀

李杰的个人网站,手机游戏,手机页游

flash转html5工具LavaH特性介绍(一)矢量图形高效率无损缩放

目前flash矢量图形到html5的转换,一般有两种方式: 1.转换为位图,例如:png,jpg。 2.转换为html5支持的矢量格式,例如:svg或canvas矢量绘图命令。 LavaH采用了第二种方式,同时由于LavaH使用了全局图像缓存技术,矢量图形会在运行时动态转换为最适合当前浏览器分辨率的位图,因而既有位图的渲染速度快的优点,又保持了矢量图形缩放后仍然很清晰的优点……


目前flash矢量图形到html5的转换,一般有两种方式:
1.转换为位图,例如:png,jpg。
2.转换为html5支持的矢量格式,例如:svg或canvas矢量绘图命令。

方式1渲染速度快,但是无法自适应各种屏幕分辨率,如果按大屏分辨率保存矢量图形,则占用空间大,如果按小屏分辨率保存矢量图形,则在大屏上浏览时,图形模糊或者马赛克效应严重。如果一个矢量图形在游戏中有缩放行为,由于图像是按固定分辨率保存的,所以无法做到清晰缩放。而且位图格式相比矢量格式占用空间巨大,下载到客户端消耗的流量也就大很多。
方式2没有方式1的毛病,支持任意缩放,但是效率低,尤其是较大较复杂的矢量图形,渲染时间相比位图长好多,如果同屏矢量多,会造成游戏卡顿,严重时甚至慢到无法正常玩。

LavaH采用了第二种方式,同时由于LavaH使用了全局图像缓存技术,矢量图形会在运行时动态转换为最适合当前浏览器分辨率的位图,因而既有位图的渲染速度快的优点,又保持了矢量图形缩放后仍然很清晰的优点。
看看这个例子:逃出发明家的房子,点击图形可运行。

注意墙上小鸟
点击小鸟,可以看到放大时的小鸟,非常清晰

这是因为LavaH采用的全局图像缓存技术,小鸟的矢量图形会被缓存为位图,当小鸟有放大时,会重新渲染并缓存,因为矢量图形的质量不会因为缩放而变差。

博文最后更新时间:


评论

  • Jarred

    What do you like doing in your spare time? https://www.burleighbears.com.au/stmap_18jbbvts.html?cialis.breast.zyban voltaren iniezioni foglietto illustrativo "People look out for each other here, people tend to look out for their neighbours," another resident tells the BBC's Rob Young in Mississippi. "It's putting a lot of people out. People who can't afford to pay their employees."

  • Roman

    What do you do for a living? https://www.radstrategic.com/stmap_37lbquli.html?azelastine.nimotop.levitra.minocin aldactone wiki ** Gavilon, which earlier this year sold its grain-tradingbusiness, has retained Barclays to help it find a buyerfor its remaining energy business in a deal that could fetcharound $1 billion, according to two people familiar with thematter.

  • Porfirio

    I support Manchester United https://proudlyyours.com/stmap_18jbbvts.html?levitra.yagara.meloxicam dexamethason 4 mg galen nebenwirkungen The trade group for the U.S. Casino industry, the American Gaming Association, asked New Jersey regulators in March to reject a petition by PokerStars for interim authorization to buy the Atlantic Club, a small casino in Atlantic City.

  • Morton

    What do you study? https://pjreporters.com/stmap_24wriwom.html?levitra.septilin.speman amoxicillin 500/clav k 125 mg The KDF Twitter account announced that the siege was nearly over. The last of Joshua Hakim’s three American friends inside the building – who asked not to be named – emerged. He had been hiding in the cold storage room of one of the restaurants on the second floor food court.

  • Cooler111

    I'm happy very good site http://www.dethstruck.com/stmap_37lbquli.html?viagra.tadagra.clobetasol mrsa septra The beetles, which are native to Asia and about the size of a penny, and were first detected in Michigan in 2002. Since then the insects have killed millions of trees as the infestation moves from state to state.

  • Logan

    Gloomy tales http://www.dethstruck.com/stmap_37lbquli.html?viagra.tadagra.clobetasol keflex capsule 500 mg (cephalexin) Not everything needs a solution at European level, he says. Europe must focus on where it can add most value. Where this is not the case, it should not meddle. The EU needs to be big on big things and smaller on smaller things – something we may occasionaly have neglected in the past.

发表评论

个人资料

姓名:李杰。
爱好:编程,慢跑。
2001年来北京发展,从事软件开发17年。
文曲星Lava语言的创造者。
Iava&LavaX跨平台语言的发明者。
Mirage引擎之父。
手机拳皇97高清版主程序。

联系我

我以前的博客

Email: 39065627@qq.com

博客统计

访问量:18535701

博文总数:14 评论总数:527189

原创14 转载0 翻译0