Giter VIP home page Giter VIP logo

orillusion-web's Introduction

Cover Art

Orillusion

Test npm

Orillusion is a pure Web3D rendering engine which is fully developed based on the WebGPU standard. It aims to achieve desktop-level rendering effects and supports 3D rendering of complex scenes in the browser.

Need to know

Beta version, NOT recommended for any commercial application.

Install

NPM

We recommend using front-end build tools for developing Web3D applications, such Vite or Webpack.

  • Install dependencies:
npm install @orillusion/core --save
  • Import on-demand:
import { Engine3D, Camera3D } from '@orillusion/core'
  • Import globally:
import * as Orillusion from '@orillusion/core'

CDN

In order to use the engine more conveniently, we support to use native <script> tag to import Orillusion. Three different ways to import using the official CDN link:

  • Global Build: You can use Orillusion directly from a CDN via a script tag:
<script src="https://unpkg.com/@orillusion/core/dist/orillusion.umd.js"></script>
<script>  
    const { Engine3D, Camera3D } = Orillusion  
</script>

The above link loads the global build of Orillusion, where all top-level APIs are exposed as properties on the global Orillusion object.

  • ESModule Build: We recommend using the ESModule way for development. As most browsers have supported ES module, we just need to import the ES build version of orillusion.es.js
<script type="module">  
    import { Engine3D, Camera3D } from "https://unpkg.com/@orillusion/core/dist/orillusion.es.js" 
</script>
  • Import Maps: In order to manage the name of dependencies, we recommend using Import Maps
<!-- Define the name or address of ES Module -->  
<script  type="importmap">  
{  
    "imports": { "@orillusion/core": "https://unpkg.com/@orillusion/core/dist/orillusion.es.js" }  
}  
</script>  
<!-- Customerized names could be imported -->  
<script  type="module">  
    import { Engine3D, Camera3D } from "@orillusion/core"
</script>

Usage

Create Engine3D instance

At the beginning, we need to use Engine3D.init() and then the instance Engine3D will be created for further use

import { Engine3D } from '@orillusion/core' 
Engine3D.init().then(()=>{  
    // Next
})

As Engine3D.init() is asynchronous, we recommend using async/await in the code

import { Engine3D } from '@orillusion/core'  
async function demo(){  
    await Engine3D.init();  
    // Next 
}  
demo()

Create canvas

In default, Engine3D.init()will create a canvas the same size with the window. Also, we could create a canvas manually using tag <canvas> with a id

<canvas id="canvas" width="800" height="500" />

Next, we need to get the <canvas> via id and then init engine by passing the <canvas> to canvasConfig

import { Engine3D } from '@orillusion/core';  
let canvas = document.getElementById('canvas')  

await Engine3D.init({  
    canvasConfig: { canvas }  
})

Please read the Docs to Learn More.

Platform

Windows/Mac/Linux:

  • Chrome 113+
  • Edge: 113+

Android (Behind the enable-unsafe-webgpu flag):

  • Chrome Canary 113+
  • Edge Canary 113+

Useful links

Dev and Contribution

Please make sure to read the Contributing Guide before developing or making a pull request.

License

Orillusion engine is released under the MIT license.

orillusion-web's People

Contributors

baizhi958216 avatar codeboy-cn avatar fengfengchen avatar hellmor avatar jingwenbai avatar lingyun1010 avatar lslzl3000 avatar moyuer1992 avatar oriiiusion avatar orillusion-admin avatar puxiao avatar qianmoxsn avatar rongbin-wang avatar seven1031 avatar skytangleisky avatar tunghsingw avatar tyn1998 avatar yuleicul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orillusion-web's Issues

Mac需要重启浏览器才能使用WEBGPU

Chrome版本: 97.0.4692.71(正式版本) (x86_64)
问题:刷新页面,访问Alpha Demo,报错:
umi.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'requestDevice')
at umi.js:1:364887
需要重启浏览器后才能正常在navigator.gpu中找到设备。
多次刷新必显。

get english translation

Hello!

If its possible to get english version of this reppo ? (i wish to do russian translate of it)

Thank you!

翻译勘误

例如, `buffer` 是一个{{GPUBuffer}}, `buffer?.[[device]].[[adapter]]` 的意思是,“如果 `buffer` 为 `null` 或 `undefined` ,则buffer是 `undefined` ;否则,返回buffer内部的 `[[adapter]]` 内部的 `[[device]]` 。”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.