Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed Jun 16, 2023
1 parent a518c3f commit 20cc132
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 6 deletions.
36 changes: 36 additions & 0 deletions babylonjs/component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Component

Babylon的特征之一就是是ECS(Entity-Component-System实体-组件-系统),其核心是遵循组合优于继承原则。
以scene场景为单元作为一个实体,每个scene实体包含多个组件。
这样对scene进行解耦,使得每个模块如layers,post-process模块独立性更强。

既然以scene为单元,engine对象也是绑定在scene内部,渲染时不需要通过去调引擎,Mesh对象构造时也是依赖与某个scene的

scene与engine是双向的,scene引用engine,engine引用scene
正是因为这种互相引用,方便了业务层面上的相互应用,避免了全局引用

自v3.1所有场景对象都继承自Node接口,
```js
/**
* Node is the basic class for all scene objects (Mesh, Light, Camera.)
*/
export class Node implements IBehaviorAware<Node> {
}
```
一般框架中基类会基础事件接口,方便各个部件处理,如three-js中
```js
class Object3D extends EventDispatcher {
}
```

# EventSystem

使用observable观察者模式

## Ammo.js

Ammo.js 使用Emscripten将 Bullet物理引擎 直接移植到JavaScript

## Monaco Editor

monaco基于浏览器,而VSCode基于electron
23 changes: 23 additions & 0 deletions babylonjs/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# dev
先执行
npm run start
打开packages/tools目录下服务,执行相应的script

开启playground,依赖npm run start中的服务
也是tools目录下的一个server,单独开启server:dev模式

## tools

### babylonServer

### playground

playground中的代码保存时会存入https://snippet.babylonjs.com/中,返回一个对象,含有snippetIdentifier标识符,用来定位所有的代码内容,
playground中的examples是通过https://babylonjs-newdocs.search.windows.net的一个接口返回文档中的snippet内容

snippet服务是一个小server,参考[snippet server reference](https://github.com/BabylonJS/SnippetServerReference/blob/main/index.js)
就是一个读写服务器。

### devHost
简单的一个基本场景加载逻辑,通过创建一个scene函数来运行,可以定制scene代码的逻辑
4 changes: 3 additions & 1 deletion babylonjs/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# BabylonJS

[shader](./shader.md)
- [dev](./dev.md)
- [shader](./shader.md)
17 changes: 17 additions & 0 deletions babylonjs/material.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Material

## Effect
Effect containing vertex and fragment shader that can be executed on an object
```js
class Effect {
constructor() {
this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage);
}
}

```

## Node Material

### NMD(Node Material Decorator)
节点材质装饰器
7 changes: 7 additions & 0 deletions babylonjs/mesh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Mesh

## SubMesh
现代引擎中的一个概念
A mesh has 1 to n submeshes, which divide its vertex data to n parts. This is useful for many cases (from collision to Octree, to MultiMatrials and co).
babylonjs中符合这样的概念。
Defines a subdivision inside a mesh
32 changes: 32 additions & 0 deletions babylonjs/rendering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Rendering

在RenderingManager类中可以看到至少有四个render group

## RenderingGroup

# Renderer

## EdgesRender

```js
class EdgesRenderer {
constructor() {
if (isWebGPU) {
drawWrapper = new DrawWrapper(engine);
}
}
render() {
// drawWrapper是处理WebGPU的
if (drawWrapper) {
Shader._setDrawWrapper(drawWrapper);
}
engine.bindBuffers
Shader.bind
engine.drawElementsType
Shader.unbind
}
}
//
```
大致流程还是标准的数据处理

2 changes: 2 additions & 0 deletions babylonjs/webgpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

glsl可以编译为webassembly的数据格式
8 changes: 7 additions & 1 deletion books/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
## online

- [Physically Based Rendering](https://www.pbr-book.org/3ed-2018/contents)
- [设计数据密集型应用 - 中文翻译](http://ddia.vonng.com/#/)
- [github](https://github.com/Vonng/ddia)

##
##

## github resource

- [A collection of academic papers, articles, and other resources that I plan to read or have read. ](https://github.com/jeffrey-xiao/papers/tree/master)
7 changes: 6 additions & 1 deletion index/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@
- [AVA (AVA examples Visual Analytics) is a technology framework designed for more convenient visual analytics.](https://github.com/antvis/AVA)
- [n8n - Workflow automation tool](https://github.com/n8n-io/n8n)
- [Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable](https://github.com/daybrush/moveable)
- [rrweb refers to 'record and replay the web', which is a tool for recording and replaying users' interactions on the web](https://github.com/rrweb-io/rrweb)
- [rrweb refers to 'record and replay the web', which is a tool for recording and replaying users' interactions on the web](https://github.com/rrweb-io/rrweb)

## DICOM

- IODs Information Object Definitions信息对象定义
- SOPs Service-Object Pairs服务对象配对,
1 change: 1 addition & 0 deletions index/computerScience.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

- [Bgfx](../cg/bgfx.md)
- [Iolite a modern,portable game engine with an embedded editor. Completely scriptable in Lua, Free for personal](https://iolite-engine.com/)
- [babylonjs](../babylonjs/index.md)

#### threejs

Expand Down
12 changes: 10 additions & 2 deletions math/pbr3ed.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ <h4 id="section5">5. Color And Radiometry</h4>
<li><em>irradiance</em></li>
<li><em>radiance</em></li>
</ul>
<p>5.2.1 XYZ Color</p>
<p>A remarkable property of the human visual system makes it possible to represent colors for human perception with just three floating-point numbers. The tristimulus theory of color perception says that all visible SPDs can be accurately represented for human observers with three values, \( \mathcal{x}_{\lambda} \), , \( \mathcal{y}_{\lambda} \) and \( \mathcal{z}_{\lambda} \). Given an emissive SPD , these values are computed by integrating its product with the spectral matching curves \(X(\lambda)\), \(Y(\lambda)\), and \(Z(\lambda)\):</p>
<div>
<h5>5.2.1 XYZ Color</h5>
<p>A remarkable property of the human visual system makes it possible to represent colors for human perception with just three floating-point numbers. The tristimulus theory of color perception says that all visible SPDs can be accurately represented for human observers with three values, \( \mathcal{x}_{\lambda} \), , \( \mathcal{y}_{\lambda} \) and \( \mathcal{z}_{\lambda} \). Given an emissive SPD , these values are computed by integrating its product with the spectral matching curves \(X(\lambda)\), \(Y(\lambda)\), and \(Z(\lambda)\):</p>
</div>
<div>
<h5>5.4 Radiometry辐射度学</h5>
<p>radiometry提供了一系列的主意和数学工具来描述light的传播和反射,它是形成渲染算法的基础,radiometry首先引入图形学不是因为物理光的原则,而是作为空间粒子的抽象光属性。</p>
<p>Radiative transfer辐射传输是radiant energy辐射能量传输的现象研究。辐射传输基于辐射原理和几何光学水平的操作,光的微波属性用来描述光与物体交互时比光的波长要长的。辐射度学与Maxwell经典方程描述了电子场域</p>
<p>在pbrt中,假设几何光学最需要</p>
</div>
</div>
</div>
</body>
Expand Down
11 changes: 10 additions & 1 deletion web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@

- [CSS](./css.md)
- [nginx](./nginx.md)
- [vue](./vue.md)
- [vue](./vue.md)

## library

### 引导库

- [Intro.js is a lightweight JavaScript library for creating step-by-step and powerful customer onboarding tours](https://introjs.com/)
- [github](https://github.com/usablica/intro.js)
- [Bootstrap Tour](https://bootstraptour.com/)
- [github](https://github.com/sorich87/bootstrap-tour)

0 comments on commit 20cc132

Please sign in to comment.