* refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: use new addChannel api * style: format code * feat: opt code * feat: merge gltf animation parser * feat: opt code * fix:opt code * refator: opt code * refactor: opt code * refactor: clear imports * refactor:fix bug * refactor: opt code * refactor: opt code * feat: fix tsc * feat: opt code * feat: opt crossfade performance * feat: opt crossfade performance * feat: opt crossfade * feat: opt crossfade * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * feat: opt mergedCurveIndexList * feat: opt mergedCurveIndexList * feat: add revert * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * feat: opt corssfade from pose * feat: resolve conflict from cm * refactor: opt code * feat: fix type * fix: fix additive * refactor: opt code * refactor: opt struct of Animation Node data * feat: fix comment * feat: clear import * refactor: add CM * refactor: opt code * refactor: opt crossFade code * refactor: opt code * refactor: opt code * refactor: opt Animator code * refactor: opt code * Delete package-lock.json delete package-lock * Merge main (#349) * refactor: opt code * refactor: opt code * refactor: improve play API * refactor: opt code * refactor: opt code * refactor: fix code * refactor: opt code * refactor: move internal class to internal folder * refactor: remove generic * refactor: save code * refactor: opt code * refactor: opt Layer update * refactor: opt code * refactor: reduce GC * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: remove playState * refactor: solve CM * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: add layer opt * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: opt interface design * refactor: opt code * refactor: opt code * refactor: clear imports * Animator (#337) * refactor: refactor animator #35 * refactor: sprite material add define USE_MODEL_MATRIX (#359) * refactor(2d): sprite material add define USE_MODEL_MATRIX * feat: add animator-event * feat: add animator-event * feat: opt event code * feat: add animator-event * feat: opt code * feat: merge oasis dev/0,5 * feat: opt code * refactor: opt code * refactor: opt code * refactor: opt code * refactor: clear imports * feat: add some commonly used methods for `Color`(#385) * test: add color test (#391) Co-authored-by: shensi.zxd <shensi.zxd@alibaba-inc.com> * feat: opt code * feat: opt code * feat: opt code * feat: opt code * feat: opt code * feat: opt code * feat: opt code * feat: opt code * refactor: opt code * refactor: opt code * Animator event (#372) * feat: add AnimatorEvent system #35 * Dev/0.5 (#397) * fix: fix Animator bug * Dev/0.5 (#399) * fix: fix Animator bug * Blend shape animation (#374) * feat: add BlendShape Animation * feat: add ObjectKeyframe for AnimationCurve (#403) * Refactor physics Ray-cast and Collision detection (#404) * feat: add trigger methods into Script and rewrite CollisionDetection * Update README.md * Fix Typos (#409) * fix: typos fixed * Add sprite atlas region offset (#407) * feat: add ObjectKeyframe * refactor: opt code * refactor: opt code * refactor: improve comments * Fix Typos (#410) * fix: fix typos * feat:Support atlas #197 (#402) * feat:Support atlas #197 Co-authored-by: azhan <zhanyingwei.zyw@antgroup.com> Co-authored-by: GuoLei1990 <gl3336563@163.com> * refactor: add tips for developers when use draco and BlendShape at the same time (#414) * refactor: new pbr interface (#418) * refactor: new pbr interface * Feat: support spherical harmonic (#392) * feat: support spherical harmonics * fix:opt atlas code. (#420) * fix:opt atlas code * fix: glTF vertexData parser error (#423) * fix: set interpolation with `linear` by default (#424) * fix: set interpolation with `linear` by default Co-authored-by: shensi.zxd <shensi.zxd@alibaba-inc.com> * Fix material clone (#426) * fix: fix material clone bug * fix:atlas support rotation (#428) * fix:atlas support rotation * ci: compile error (#429) Co-authored-by: shensi.zxd <shensi.zxd@alibaba-inc.com> * fix: `ModleMesh` destroy bug (#430) * Fix the comments of RenderState (#431) * fix: the comments of `RasterState` * feat: add sh in editor (#433) * Add Scene Background Texture (#427) * feat: add scene background texture * Background texture (#434) * refactor: opt code * Test/material (#422) * feat: add material test * v0.5.0-alpha.0 * Test: test for math (#437) * test: add test for math library * fix:Fixed sprite’s rect display error when packaged into an atlas and trimmed (#435) * fix:Fixed sprite’s rect display error when packaged into an atlas and trimmed * Fix BlendShape bug (#441) * fix: `ModleMesh` memory access bug * Add blendshape test (#442) * refactor: add `Blendshape` test * Fix blend shape add frame (#445) * refactor: fix addFrame() of BlendShape * Test for Background (#438) * test: test for background * Fix Background Texture Error (#446) * refactor: fix background texture bug * v0.5.1-alpha.0 * v0.5.2-alpha.0 * v0.5.3-alpha.0 * fix: temp fix type convert function (#449) * v0.5.3-0.5.0-alpha.1.0 * v0.5.3-alpha.0 * v0.5.3-alpha.1 * feat: support vertex color for Blinnphone (#450) * feat: support vertex color for Blinnphone * fix: BlendShape access bug (#451) * feat:Add the function of relative path loading. (#439) * feat:Add the function of relative path loading * fix: fix 2d renderer order error (#452) * fix: 2d renderer order error opt code * feat: adapt to editor * feat: adapt to editor * feat: adapt to editor * feat: adapt to editor * feat: adapt to editor * feat: adapt to editor * refactor: opt animator * v0.5.3-alpha.2 * refactor: opt code * feat: update * refactor: opt code * fix: gltf no animation bug * refactor: opt code * refactor: oopt code * refactor: opt code * refactor: opt code * feat: opt animator editor * feat: opt animator editor * fix: revert PHYSICALLY_CORRECT_LIGHTS * fix: revert PHYSICALLY_CORRECT_LIGHTS (#455) * v0.5.3-alpha.3 * refactor: revert gamma space * refactor: revert gamma space (#457) * v0.5.3-alpha.4 * Fix Caluculation Error in Background Size (#458) * refactor: fix background calculation * feat: opt animator editor * fix: bugfix * Animator editor (#454) * fix: bugfix * v0.5.3-alpha.5 * v0.5.3-alpha.6 * feat: remove log * feat: remove log * Animator editor (#463) * refactor: remove log * fix: check valid if sh is null (#464) Co-authored-by: shensi.zxd <shensi.zxd@alibaba-inc.com> * v0.5.3-alpha.7 * feat: add more interface for raycast (#462) * feat: add more interface for raycast * feat:SpriteAtlas Adaptation Editor Workflow (#461) * feat:SpriteAtlas Adaptation Editor Workflow * feat: 上传编辑器clip数据改为引用 * fix: bugfix * v0.5.3-alpha.8 * fix: code err (#467) * fix: ccompile err * v0.5.3-y.0 * v0.5.3-alpha.8 * v0.5.3-alpha.9 * fix(2d): spine texture uniform (#468) * v0.5.3-alpha.10 * fix(2d): fix mask uniform (#471) * fix: bugfix (#470) * v0.5.3-alpha.11 * Merge main to dev/0.5 (#472) * fix: ModelMesh destroy bug (#473) * fix: `ModelMesh` destroy() bug * v0.5.3-alpha.12 * v0.5.0 Co-authored-by: luzhuang <364439895@qq.com> Co-authored-by: shensi.zxd <shensi.zxd@alibaba-inc.com> Co-authored-by: singlecoder <z18511751272@gmail.com> Co-authored-by: zhuxudong <callzhuxudong@163.com> Co-authored-by: yangfengzzz <yangfengzzz@hotmail.com> Co-authored-by: AZhan <njktsmshh@163.com> Co-authored-by: azhan <zhanyingwei.zyw@antgroup.com> Co-authored-by: Hu Song <gz65555@gmail.com> Co-authored-by: Izzy Chen <czizzy@163.com> Co-authored-by: singlecoder <singlecoder2014@gmail.com>
3.4 KiB
Oasis Engine (Ant Graphics Engine)
Oasis is a web-first and mobile-first high-performance real-time development platform. Use component system design and pursue ease of use and light weight. This repository is the core engine of Oasis. Developers can independently use and write Typescript scripts to develop projects using pure code.
Features
- 🖥 Platform - Suppport HTML5 and Alipay miniprogram
- 🔮 Graphics - Advanced 2D + 3D graphics engine
- 🏃 Animation - Powerful animation system
- 📑 Scripts - Use TypeScript to write logic efficiently
Usage
// Create engine by passing in the HTMLCanvasElement id and adjust canvas size.
const engine = new WebGLEngine("canvas-id");
engine.canvas.resizeByClientSize();
// Get scene and create root entity.
const scene = engine.sceneManager.activeScene;
const rootEntity = scene.createRootEntity("Root");
// Create light.
const lightEntity = rootEntity.createChild("Light");
const directLight = lightEntity.addComponent(DirectLight);
lightEntity.transform.setRotation(-45, -45, 0);
directLight.intensity = 0.4;
// Create camera.
const cameraEntity = rootEntity.createChild("Camera");
cameraEntity.addComponent(Camera);
cameraEntity.transform.setPosition(0, 0, 12);
// Create sphere.
const meshEntity = rootEntity.createChild("Sphere");
const meshRenderer = meshEntity.addComponent(MeshRenderer);
const material = new BlinnPhongMaterial(engine);
meshRenderer.setMaterial(material);
meshRenderer.mesh = PrimitiveMesh.createSphere(engine, 1);
// Run engine.
engine.run();
npm
Oasis Engine are published on npm with full typing support. To install, use:
npm install oasis-engine
This will allow you to import Oasis Engine entirely using:
import * as OASIS from "oasis-engine";
or individual classes using:
import { Engine, Scene, Entity } from "oasis-engine";
Contributing
Everyone is welcome to join us! Whether you find a bug, have a great feature request or you fancy owning a task from the road map feel free to get in touch.
Make sure to read the Contributing Guide before submitting changes.
Build
If you don't already have Node.js and NPM, go install them. Then, in the folder where you have cloned the repository, install the build dependencies using npm:
npm run bootstrap
Then, to build the source, using npm:
npm run b:all
Links
License
The Oasis Engine is released under the MIT license. See LICENSE file.