WebGL样品与演示

自9月18日起,Firefox Nightly版支持WebGL。用户可通过调整设置启用此功能。通过WebGL,可以实现在浏览器中渲染3D模型,如Spore游戏中的生物创作。示例演示了如何使用WebGL展示3D模型,并提供了软件渲染解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<div class="itemtext">
<p>来源:http://blog.vlad1.com/2009/09/21/webgl-samples/</p>
<p>下载9月18日以后Firefox的Nightly版,在地址栏输入about:config,搜索“webgl”,双击“webgl.enabled_for_all_sites”,将其值从“false”改为“true”。</p>
<p>演示地址:<a href="http://people.mozilla.com/~vladimir/webgl/spore/sporeview.html" target="_blank">http://people.mozilla.com/~vladimir/webgl/spore/sporeview.html</a>
</p>
<p>然而,速度暂时确实慢的有点受不了,起码要等一分钟才能加载并渲染出来。</p>
<p>原文如下:</p>
<p>Since <a href="http://blog.vlad1.com/2009/09/18/webgl-in-firefox-nightly-builds/">my post on Friday</a>
,
we landed a few fixes to improve our WebGL implementation and to fix a
couple of bugs we discovered on Friday. I'm looking forward to seeing
what people do with WebGL, and how it can be useful on the web right
now. For example, EA/Maxis recently added COLLADA export of Creature
designs to their popular game <a href="http://www.spore.com/">Spore</a>
, and they have a <a href="http://www.spore.com/sporepedia">Sporepedia</a>
where players can see others' creations. Right now, those previews are
just as images. With WebGL, they could be fully 3D, even animated.</p>
<p><a href="http://blog.vlad1.com/wp-content/uploads/2009/09/spdemo.png"><img class="alignleft size-full wp-image-201" title="Spore Creature View (thumbnail)" src="http://blog.vlad1.com/wp-content/uploads/2009/09/spdemo-thumb.jpg" alt="Spore Creature View (thumbnail)" width="306" height="288"></a>
Over the weekend I've put together <a href="http://people.mozilla.com/%7Evladimir/webgl/spore/sporeview.html">this example</a>
,
which uses WebGL to render an exported Spore creature, and let the user
rotate the 3D model to view it from different angles. For those who
want to try it out, you'll need a recent Firefox nightly (one from
today, September 21, or newer), and with one preference flipped as
described in <a href="http://blog.vlad1.com/2009/09/18/webgl-in-firefox-nightly-builds/">this post</a>
.</p>
<p>I'll be working to update the very basic "<a href="http://people.mozilla.com/%7Evladimir/canvas3d/examples/gles2book/">getting started</a>
"
demos from the GL ES 2 book that I ported to Canvas 3D as well, so that
those who are interested in experimenting can have some good basic code
to look at. They're not updated yet, but they should be in the next
day or two.</p>
<p>For those of you on Windows who don't have an up to date OpenGL
driver, or don't have the possibility of getting one (e.g. many common
Intel graphics cards doesn't have OpenGL drivers), you can enable
software rendering by downloading a Windows build of the Mesa software
OpenGL implementation. It won't be fast, but it should be enough for
you to get an idea of what's going on, and to play with some of the
demos. To use it, download <a href="http://people.mozilla.com/%7Evladimir/webgl/webgl-mesa-751.zip">webgl-mesa-751.zip</a>
and extract it somewhere on your computer. It has a single file,
OSMESA32.DLL, that you need to tell Firefox where to find: open up
about:config, and set the preference <em>webgl.osmesalib</em>
to the
path of OSMESA32.DLL. If you extracted it to "C:/temp", you would put
in "C:/temp/osmesa32.dll" in the pref. Then, flip <em>webgl.software_rendering</em>
to true, and you should be good to go.</p>
<p>(Mac OS X users shouldn't need to bother with software rendering,
since Apple already provides a high quality OpenGL implementation, and
Linux users should be ok as long as they have recent OpenGL drivers
installed.)</p>
</div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值