{"id":19616072,"url":"https://github.com/but0n/ashes","last_synced_at":"2025-04-05T14:04:25.923Z","repository":{"id":33974090,"uuid":"154073402","full_name":"but0n/Ashes","owner":"but0n","description":"WebGL2.0 3D Engine - Global Illumination - RayTracing","archived":false,"fork":false,"pushed_at":"2022-11-03T12:51:59.000Z","size":16469,"stargazers_count":339,"open_issues_count":9,"forks_count":15,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-29T13:05:37.668Z","etag":null,"topics":["bvh","ecs","game-engine","global-illumination","gltf","monte-carlo","path-tracing","pbr-shading","raytracer","raytracing","webgl","webgl2"],"latest_commit_sha":null,"homepage":"https://codepen.io/but0n/pen/jddYoX","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/but0n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-22T01:54:05.000Z","updated_at":"2025-03-14T08:35:26.000Z","dependencies_parsed_at":"2023-01-15T03:46:06.716Z","dependency_job_id":null,"html_url":"https://github.com/but0n/Ashes","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/but0n%2FAshes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/but0n%2FAshes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/but0n%2FAshes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/but0n%2FAshes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/but0n","download_url":"https://codeload.github.com/but0n/Ashes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345850,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bvh","ecs","game-engine","global-illumination","gltf","monte-carlo","path-tracing","pbr-shading","raytracer","raytracing","webgl","webgl2"],"created_at":"2024-11-11T10:59:35.795Z","updated_at":"2025-04-05T14:04:25.903Z","avatar_url":"https://github.com/but0n.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/7625588/53308816-3041ec80-38df-11e9-9c3a-fb515eb4d404.png\"\u003e\n\u003c/h1\u003e\n\n![image](https://user-images.githubusercontent.com/7625588/101237212-04e26780-372b-11eb-81ee-c45f34aa3031.png)\n\n\n[![Build Status](https://travis-ci.org/but0n/Ashes.svg?branch=master)](https://travis-ci.org/but0n/Ashes)\n[![](https://badgen.net/bundlephobia/minzip/ashes3d)](https://bundlephobia.com/result?p=ashes3d)\n[![](https://data.jsdelivr.com/v1/package/npm/ashes3d/badge)](https://www.jsdelivr.com/package/npm/ashes3d)\n\n## [Dynamic GI](https://but0n.github.io/webgl-gi/)\n![](https://user-images.githubusercontent.com/7625588/199723977-931991c0-88ca-479c-9c7a-abe6c2af3ab3.jpg)\n![](https://user-images.githubusercontent.com/7625588/199723996-919da83c-5898-45b7-b6e6-74aefd062201.jpg)\n\n## [Ray Tracing demo](https://but0n.github.io/Ashes/bvh.html)\n![](https://user-images.githubusercontent.com/7625588/121191833-b0719d80-c8af-11eb-97c4-9eac6f8e3e8e.png)\n\n - Press `k` to toggle render mode\n - Press `q` and `e` to adjust aperture (depth of field)\n - Press `a` and `d` to focal length\n - Press `[` andd `]` to adjust exposure\n\n## [glTF Example](https://but0n.github.io/Ashes/demo.html)\n![](https://user-images.githubusercontent.com/7625588/87917315-231b3400-cab8-11ea-9742-afe57859490d.png)\n\n\n![](https://user-images.githubusercontent.com/7625588/78468675-6f3aa680-775d-11ea-99e0-195d446d6798.png)\n![](https://user-images.githubusercontent.com/7625588/67295473-c0d9d680-f519-11e9-96b8-72422af0a547.png)\n\n# Examples\n - [glTF test](https://cx20.github.io/gltf-test/?engines=Ashes)\n - [Examples](https://cx20.github.io/jsdo.it-archives/tag/ashes/)\n - [Examples](https://jsfiddle.net/user/cx20/fiddles/)\n\n\n# Features\n![ezgif-4-e4c6f3cb3183](https://user-images.githubusercontent.com/7625588/58366099-db266e80-7eff-11e9-9d24-396a98895d7c.gif)\n\n - Entity–component–system (ECS) architectural\n - glTF support\n - Physically based rendering (PBR)\n - Post effects (WIP)\n - Skeleton animation\n - Keyframe animation\n - HDR\n\n# Getting Started\n\n- via CDN\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/ashes3d/build/ashes.main.js\"\u003e\u003c/script\u003e\n```\n- via npm\n```\nnpm i ashes3d\n```\n\n# Usage\n\n[Try it](https://codepen.io/but0n/pen/daERdd)\n\n```js\n\nlet { Asset, EntityMgr, Camera, vec3, quat, Screen, OrbitControl, MeshRenderer, Filter, Shader, Material, QuadMesh } = Ashes;\n\nlet CDN = 'https://but0n.github.io/Ashes/'\nMaterial.SHADER_PATH = CDN + Material.SHADER_PATH;\n\n\n// DamagedHelmet\nlet gltf = CDN + 'gltfsamples/DamagedHelmet.glb';\n\n\nasync function main() {\n\n    let screen = new Screen('#screen');\n\n    screen.bgColor = [0.2,0.2,0.2,1];\n\n\n    let skybox = await Asset.loadCubemap(CDN + 'res/envmap/GoldenGateBridge2/');\n\n    let scene = EntityMgr.create('root - (Click each bar which has yellow border to toggle visible)');\n\n    // Camera\n    let mainCamera = EntityMgr.create('camera');\n    let cam = mainCamera.addComponent(new Camera(screen.width / screen.height));\n\n    // Set default position\n    let cameraTrans = mainCamera.components.Transform;\n    vec3.set(cameraTrans.translate, 0, 10, 10);\n\n    // Add it to scene\n    scene.appendChild(mainCamera);\n\n    // Attach controler\n    mainCamera.addComponent(new OrbitControl(screen, mainCamera));\n\n    document.querySelector('body').appendChild(scene);\n\n    // Load a gltf model\n    let gltfroot = await Asset.loadGLTF(gltf, screen, skybox);\n    scene.appendChild(gltfroot);\n\n}\n\nmain();\n\n```\n\n## Create a quad with texture\n\n```js\n    // Create an entity\n    let quad = scene.appendChild(EntityMgr.create('quad'));\n\n    // Load a material\n    let quadMat = await Asset.LoadMaterial('stylize'); // PBR material\n\n    // Load a texture\n    let floor = await Asset.loadTexture(CDN + 'res/textures/floor.png', { minFilter: screen.gl.NEAREST_MIPMAP_NEAREST });\n    floor.flipY = true;\n\n    // Attach texture to material we created\n    Material.setTexture(quadMat, 'baseColorTexture', floor);\n    quadMat.shader.macros['HAS_BASECOLOR_MAP'] = '';\n\n    // Create a renderer component\n    let quadMR = new MeshRenderer(screen, new QuadMesh(), quadMat);\n\n    // Attach renderer to entity\n    quad.addComponent(quadMR);\n\n    // Set local translate [x, y, z]\n    quad.components.Transform.translate[1] = -1;\n\n    // Set euler angle x, y, z\n    quat.fromEuler(quad.components.Transform.quaternion, -90, 0, 0);\n\n    // The original size of quad is 2x2\n    vec3.scale(quad.components.Transform.scale, quad.components.Transform.scale, 9);\n\n```\n\n# Deployment\n\n```sh\ngit clone --recursive https://github.com/but0n/Ashes.git\ncd Ashes\n\n# if you don't have yarn installed\nnpm install -g yarn\n\nyarn\n\nyarn dev\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbut0n%2Fashes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbut0n%2Fashes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbut0n%2Fashes/lists"}