Socket
Socket
Sign inDemoInstall

@fert/air

Package Overview
Dependencies
5
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fert/air

webgl 渲染库


Version published
Maintainers
1
Created

Readme

Source

air

webgl 渲染库

相关命令

yarn dev # 启动开发环境
yarn build # 打包dist
yarn pb # 发布npm包

痛点

  • shapematerial 分离, 组装匹配 uniform 时, 不易管理
  • 是否支持 overrideMtl
  • 是否支持图形不依赖场景树独立渲染, 支持图形独立渲染

设计思想

  • shapematerial 的概念, 将 shapematerial 强绑定, 用 primitive 类替代, 目的是方便顶点着色器和片段着色器 uniform 对齐
  • 不同材质, 会继承自 primitive, 如 blinnPrimitivePBRPrimitive
  • atom3 的子类, group, mesh, scene 构建的树, 尽量和 primitive 解耦, 只作为矩阵树
  • atom2 同理, 这样 air 既可以用于 3d 也能用于 2d
  • 若要实现 overrideMtl, 则传一个 override 的 graphcs 进去, 如 g.render(g2), 在 render 内部, 也方便比对两个 program 的 uniform 和 attribute 是否一致
  • primitive 可以认为是包含一套 顶点, 法线, 纹理 buffer 和 program 结合后的对象, 他是能独立绘制一个图形的最小对象

星辰大海!

FAQs

Last updated on 17 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc