WebGL學習筆記1

來源:互聯網
上載者:User
  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。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.