文件 | 语言 | 大小 | 版本 | 开发者 | 最后更新 | |
lands/glaz production | JavaScript | 4.7KB | v1.0.0 | YB | 2024-10-21 | 查看 |
lands/glaz source code | JavaScript | 14.6KB | v1.0.0 | YB | 2024-10-21 | 查看 |
const glaz = await Lan.import('glaz');
const scene = glaz(canvas, {options...});
// add objects ...
Lan.loop(scene.render);
参见示例程序:Glass Candies。
import {glaz} from "https://ddzeb.com/lands/glaz";
const scene = glaz(canvas, {options...});
scene.render();
const {glaz} = await import("https://ddzeb.com/lands/glaz");
const scene = glaz(canvas, {options...});
scene.render();
这是一个二维光线追踪的实验项目。场景中所有物体都可以发光,采用蒙特卡洛 360 积分渲染,所以速度会比较慢。物体建模采用的是 SDF(Signed Distance Function),所以光线追踪也是采用的 Ray-marching 算法。