npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bubblejs/bubble

v0.0.1

Published

A 3D Rendering Engine based on WebGPU

Downloads

7

Readme

bubble

一个基于WebGPU的渲染引擎, 参考了Unity的Component和SRP设计。

仍然在开发中,没有实际渲染功能

功能

  • [ ] 内置集群前向渲染管线 (Clustered Forward Rendering)
  • [x] 类Unity Component组件系统 (Entity/Component)
  • [x] 可编程渲染管线 (SRP)
  • [ ] 基于Radiance Cascades的实时全局光照 (Realtime GI)
  • [ ] 动画系统 (Animation)
  • [x] PBR (Cook-Torrance BRDF)
  • [ ] 剔除 (Culling)
  • [ ] 阴影 (ShadowMap/Cascaded ShadowMap)
  • [ ] 灯光 (Point/Spot/Directional/Ambient Light)
  • [ ] 雾/体积雾 (Volumetric Fog)
  • [ ] 天空盒 (Skybox)
  • [ ] CubeMap IBL
  • [ ] PostProcessing (Bloom)
  • [ ] SSAO
  • [ ] 物理模拟 (Physics)

性能对比

TODO

使用

# 克隆项目
git clone

# 安装依赖
npm install # 安装项目依赖
npx playwright install # 安装浏览器驱动用于单元测试

# 运行
npm run dev

# 测试
npm run test:unit

项目结构

  • bubble: 渲染引擎
    • core: 定义一些核心的接口和类
    • pipeline: 类Unity的可编程渲染管线和渲染图
    • shader: 着色器定义和处理,遵循WebGPU着色器最佳实践
    • node: 场景中各种元素(例如Mesh, Material, Light...)的实现
    • math: 一些数学工具类
    • loader: 资源/模型加载器
    • helper: 一些辅助实现 (如Controller以及一些VisualHelper)
    • spec: 基于Vitest的测试用例

Shader

Shader编写遵循WebGPU着色器最佳实践, 使用JavaScript字符串 模板来动态生成Shader代码。

const shader = wgsl`
struct VertexInput {
  @location(0) position: vec3<f32>;
  @location(1) normal: vec3<f32>;
  @location(2) uv: vec2<f32>;
};

@vertex
fn vs(input: VertexInput) -> @builtin(position) vec4<f32> {
  #if ${表达式}
    return vec4<f32>(input.position, 1.0);
  #else
    return vec4<f32>(input.position, 1.0);
  #endif
}`;

三方库

  • Tweakpane: 数据驱动的UI,方便调试
  • wgsl_reflect: WGSL反射库,用于解析wgsl绑定信息用于绑定资源