WebGL学习笔记1

  1. Webgl介绍:WebGL is a cross-platform, royalty-free web standard for a low-level 3D graphics API based on OpenGL ES 2.0, exposed through the HTML5 Canvas element as Document Object Model interfaces. Developers familiar with OpenGL ES 2.0 will recognize WebGL as a Shader-based API using GLSL, with constructs that are semantically similar to those of the underlying OpenGL ES 2.0 API. It stays very close to the OpenGL ES 2.0 specification, with some concessions made for what developers expect out of memory-managed languages such as JavaScript.

    WebGL brings plugin-free 3D to the web, implemented right into the browser. Major browser vendors Apple (Safari), Google (Chrome), Mozilla (Firefox), and Opera (Opera) are members of the WebGL Working Group. (safari,chrome,firefox,opera浏览器都支持webgl技术,不用专门下插件)       

    • Firefox: WebGL works in the development nightly builds under Windows, Mac OS X, and Linux. Click here for instructions for installing Firefox with WebGL. If you’re on a Windows or Linux, I recommend using Firefox.
    • Safari: WebGL is supported by the WebKit core on which Safari depends, but for the Mac only, and only on Snow Leopard (OS X 10.6) (it used to work on 10.5, aka Leopard, but sadly no longer does). If you’re on Snow Leopard, I recommend you use this option; if you’re still using Leopard, I recommend Chromium or Minefield. Click here for instructions for installing Safari with WebGL.
    • Chrome: The best way of trying out WebGL in Chrome is to use one of the nightly builds of Chromium, the open source project that Chrome is based on. Click here to for instructions on getting WebGL running in Chromium.
  2. 一个很好的webgl教程的英文网站http://learningwebgl.com/blog/?p=11#examples

  3. 目前PC上能直接跑webgl程序的浏览器可以选用firefox,根据提示,下载安装后,firefox中webgl的支持是关闭的,需要手动打开。
  4. 一个很好的webgl的online IDE网址:用户可以修改左栏中的代码,并直接在右栏中看到修改后的3d效果。http://scenejs.org/ide.html?url=http://scenejs.org/library/v0.7/scenes/examples/seymour-plane/seymour-plane.js&title=Distributed%20Content%20-%20COLLADA%20Seymour%20Plane
  5. 下载修改运行第一个程序可能遇到的问题:如果直接拷贝实例程序运行,可能会出现无法显示的情况,查询源代码,看是不是需要用到对应的*.js文件,注意目录可能是“text/javascript”,但是,(注意!)下载这些js文件后直接放在和网页html文件同一目录下即可。
  6. 测试了一个webgl的demo程序,是载入一栋小别墅,发现速度很慢,而且检查系统内存时,发现内存已经满了。估计是目前webgl还没有优化的很好,传输数据时没有有效压缩,或者是这个demo本身的问题。不管怎么说,同成熟的web3d软件相比,目前webgl的性能还很差,有待进一步优化。
  7. 另一个好的教程网站http://learningwebgl.com/blog/?page_id=1217

你可能感兴趣的:(WebGL学习笔记1)