Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed May 9, 2024
1 parent 9136a2d commit a53231c
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 101 deletions.
10 changes: 9 additions & 1 deletion cg/canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

> 既然是图形库,那一定使用了很多图形学的技术
- [WebGL Report](https://webglreport.com/)

## 尺寸

设计会以标准桌面1920X1080来设计和canvas在1920X1080下是1,其他情况下可能有问题。
Expand Down Expand Up @@ -103,8 +105,14 @@ ctx.translate(-center.x, -center.y);

## 经验


### 2024-4-19
在使用CanvasRenderingContext2D.drawImage以canvas为参数时,关于图像的放大问题,会陷入使用图像的逻辑中,先以中心点放大,再截图。
在使用canvas实现这个逻辑时,小程序上的实现让我很郁闷。表现出了不是预期的情况。
最后就是简单的绘制一部分到另外一个canvas上,就产生了预期的结果。实在令人困扰。
这个可能与微信中canvas实现机制有关,那就好奇实现原理了。
这个可能与微信中canvas实现机制有关,那就好奇实现原理了。

### 2020-8-9
图形学,在一些理论基础上,算是固定的,或是教科书上能列出来的东西,都是算是知识点,可是除了这些,还有一些特效,是在当前技术不能实现或达到要求的,通过迂回的方法来获得类似的结果,至少大部分人区分不了这些之间的差别。
最近在分析别人的实现,隐适美的3D场景的显示,与实现的计算方案时,选择一个引擎,就发现其中的各种限制,比如关于orthographic camera的实现,目前还没有查到是与浏览器的实现,或本事就是存在的一种差异,比如对于阴影的实现,threejs是利用perspective camera来生成了一个结果来应用到结果上,如果全是orthographic camera的话,会产生什么样的结果呢?
每次看到别人把多个引擎,多个三维软件的结果做对比,可见我还只是停留在知识点上。系统的分析其内容是需要深厚的知识储备的。
2 changes: 2 additions & 0 deletions cg/geometry.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Geometry

- [Polygon Mesh Processing书籍](/cg/mesh/PolygonMeshProcessing.md)

## Projective Geometric Algebra

- [Projective Geometric Algebra](http://projectivegeometricalgebra.org/)
Expand Down
49 changes: 0 additions & 49 deletions cg/gpu.md

This file was deleted.

87 changes: 78 additions & 9 deletions cg/graphics.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,89 @@
# Graphics

## 图形接口

早期3D的API由驱动层提供,所有细节都是驱动贴近硬件实现的,在经过shader发展中,现代硬件越来越复杂了
新时代的抽象图形接口vulkan来了,需要更具象化的过程,就是需要自己负责更多的事情
- 任务调度
- driver驱动

## Thingking
## GPU
> Graphics Processing Unit
- Asynchronous accelerator for graphics异步图形加速
- parallel problem并行处理
1. if a single ALU take a branch, all ALUs will take it.一个分支所有都执行这个分支
- GPU通过驱动获取API,意味着不能直接获取硬件信息
- cache
1. constant cache
2. R/W cache
3. Texture cache
4. ROP(Render OutPut) cache

渲染流程上分immediate mode和tiled-based GPU,各自有各种的优劣势
```js
// immediate mode
foreach(triangle)
foreach(fragment in triangle)
load FBO data(color, depth, ...)
call fragment shader
store new FBO data
// tiled-based
foreach(fragment)
load FBO data(color, depth, ...)
foreach(triangle)
call fragment shader
store new FBO data
// tile based rendering
foreach(tile)
load tile FBO data(color, depth, ...)
foreach(triangle in tile)
foreach(fragment in triangle in tile)
call fragment shader
store new tile FBO data
```

### 参考

- [GPU Architectures A CPU Perspective](https://courses.cs.washington.edu/courses/cse471/13sp/lectures/GPUsStudents.pdf)
- [CPU vs. GPU Key Differences & Uses Explained](https://www.run.ai/guides/multi-gpu/cpu-vs-gpu)
- [关于他的一篇GPU Architecture文章](https://github.com/Kangz)
- [tiny-gpu A minimal GPU implementation in Verilog optimized for learning about how GPUs work from the ground up](https://github.com/adam-maj/tiny-gpu)

## Render
> 渲染器
### phong

### parallax mapping
是一种类似于法线贴图的纹理技术,能显著增强模型或纹理的表面细节和凹凸感
[GLRF_example实现了一个视差映射的demo](https://github.com/DunkleMango/GLRF_Example)


## CAD

### 编辑器子概念

#### 吸附Absorb

对一个元素拖拽时,生成当前元素与其他元素对齐的参考线,
实现相近元素间的四条边与水平中心线或垂直中心线对齐.
在拖动完成后实现自动吸附对齐

应该是在编辑情况下,对于拖拽的元素自动对齐的功能

#### 自动布局

#### Frame
图框
####

### 2022-5-12
### [exocad](https://exocad.com/)

开始分析图形学的工程实践了
Exocad是一款跨平台的应用程序,免费使用

### 2020-8-9
### 参考

图形学,在一些理论基础上,算是固定的,或是教科书上能列出来的东西,都是算是知识点,可是除了这些,还有一些特效,是在当前技术不能实现或达到要求的,通过迂回的方法来获得类似的结果,至少大部分人区分不了这些之间的差别。
最近在分析别人的实现,隐适美的3D场景的显示,与实现的计算方案时,选择一个引擎,就发现其中的各种限制,比如关于orthographic camera的实现,目前还没有查到是与浏览器的实现,或本事就是存在的一种差异,比如对于阴影的实现,threejs是利用perspective camera来生成了一个结果来应用到结果上,如果全是orthographic camera的话,会产生什么样的结果呢?
每次看到别人把多个引擎,多个三维软件的结果做对比,可见我还只是停留在知识点上。系统的分析其内容是需要深厚的知识储备的。
- [FreeCAD is an open-source parametric 3D modeler made primarily to design real-life objects of any size](https://github.com/FreeCAD/FreeCAD)
- [Analysis Situs, Analysis Situs is the open-source application and SDK for CAD feature recognition and more](https://analysissitus.org/index.html)
- [Yet another modeling kernel? Hell, no.关于是否要从0开发一个新的几何内核](https://quaoar.su/blog/page/modeling-kernel-no-thanks)
- [A 3D CAD application on your browser](https://chili3d.com/)
- [github](https://github.com/xiangechen/chili3d)
1 change: 1 addition & 0 deletions cg/library/NumericCalculation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ All Eigen matrices default to column-major storage order, but this can be change
[github Cmake编译库,从源码拉起下来进行编译](https://github.com/scivision/mumps)

## 其他
- [oneMKL Interfaces is an open-source implementation of the oneMKL Data Parallel C++ (DPC++) interface according to the oneMKL specification. It works with multiple devices (backends) using device-specific libraries underneath](https://github.com/oneapi-src/oneMKL)
- [求取近似值的一个小技巧](https://www.johndcook.com/blog/2023/02/07/mediant-approximation-trick/)
- [ALGLIB is a cross-platform numerical analysis and data processing library. It supports five programming languages (C++, C#, Java, Python, Delphi) and several operating systems (Windows and POSIX, including Linux). ](https://www.alglib.net/)
8 changes: 0 additions & 8 deletions cg/render.md

This file was deleted.

29 changes: 0 additions & 29 deletions cg/tools/CAD.md

This file was deleted.

7 changes: 2 additions & 5 deletions index/computerScience.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

## ComputerGraphics

- [graphics图形学](/cg/graphics.md)
- [Real-Time Rendering Resources](https://www.realtimerendering.com/)
- [Ambient Occlusion](../cg/lighting/ambient-occlusion.md)
- [smallpt: Global Illumination in 99 lines of C++](http://www.kevinbeason.com/smallpt/)
Expand All @@ -45,23 +46,19 @@
- [网格划分](/cg/mesh/mesh-generation.md)
- [NURBS](/cg/mesh/NURBS.md)
- [曲线](/cg/tools/curve.md)
- [GMesh]()
- [Triangulate Efficient Triangulation Algorithm Suitable for Terrain Modelling or An Algorithm for Interpolating Irregularly-Spaced Data with Applications in Terrain Modelling](http://paulbourke.net/papers/triangulate/)
- [多边形网格算法](http://paulbourke.net/geometry/polygonmesh/)
- [点至三角形的最近点](https://zhuanlan.zhihu.com/p/458837573)
- [Brillouin zone visualisation tool,维诺图Voronoi Diagram,Lattice格](https://github.com/tobycrisford/bravais-lattice-fermi-surfaces)
- [计算几何第四周:维诺图](https://zhuanlan.zhihu.com/p/33896575)
- [Lattice学习笔记01:格的简介](https://zhuanlan.zhihu.com/p/161411204)
- [How to make an infinite grid无限网格](http://asliceofrendering.com/scene%20helper/2020/01/05/InfiniteGrid/)

- [CAD相关笔记](/cg/tools/CAD.md)
- [几何](/cg/geometry.md)

### api

- [GPU](/cg/gpu.md)
- [OpenGL](/cg/opengl.md)
- [webgl](/cg/webgl.md)
- [webgl](/cg/canvas.md)
- [Shader](/cg/shader.md)
- [vulkan]()
- [Official Khronos Vulkan Samples](https://github.com/KhronosGroup/Vulkan-Samples)
Expand Down

0 comments on commit a53231c

Please sign in to comment.