From a53231c9e45b0021653c9e5619af7fd4b367a129 Mon Sep 17 00:00:00 2001 From: lmj01 Date: Thu, 9 May 2024 13:54:52 +0800 Subject: [PATCH] update --- cg/canvas.md | 10 +++- cg/geometry.md | 2 + cg/gpu.md | 49 ------------------ cg/graphics.md | 87 ++++++++++++++++++++++++++++---- cg/library/NumericCalculation.md | 1 + cg/render.md | 8 --- cg/tools/CAD.md | 29 ----------- index/computerScience.md | 7 +-- 8 files changed, 92 insertions(+), 101 deletions(-) delete mode 100644 cg/gpu.md delete mode 100644 cg/render.md delete mode 100644 cg/tools/CAD.md diff --git a/cg/canvas.md b/cg/canvas.md index 6df43fa..5e88015 100644 --- a/cg/canvas.md +++ b/cg/canvas.md @@ -2,6 +2,8 @@ > 既然是图形库,那一定使用了很多图形学的技术 +- [WebGL Report](https://webglreport.com/) + ## 尺寸 设计会以标准桌面1920X1080来设计和canvas在1920X1080下是1,其他情况下可能有问题。 @@ -103,8 +105,14 @@ ctx.translate(-center.x, -center.y); ## 经验 + ### 2024-4-19 在使用CanvasRenderingContext2D.drawImage以canvas为参数时,关于图像的放大问题,会陷入使用图像的逻辑中,先以中心点放大,再截图。 在使用canvas实现这个逻辑时,小程序上的实现让我很郁闷。表现出了不是预期的情况。 最后就是简单的绘制一部分到另外一个canvas上,就产生了预期的结果。实在令人困扰。 -这个可能与微信中canvas实现机制有关,那就好奇实现原理了。 \ No newline at end of file +这个可能与微信中canvas实现机制有关,那就好奇实现原理了。 + +### 2020-8-9 +图形学,在一些理论基础上,算是固定的,或是教科书上能列出来的东西,都是算是知识点,可是除了这些,还有一些特效,是在当前技术不能实现或达到要求的,通过迂回的方法来获得类似的结果,至少大部分人区分不了这些之间的差别。 +最近在分析别人的实现,隐适美的3D场景的显示,与实现的计算方案时,选择一个引擎,就发现其中的各种限制,比如关于orthographic camera的实现,目前还没有查到是与浏览器的实现,或本事就是存在的一种差异,比如对于阴影的实现,threejs是利用perspective camera来生成了一个结果来应用到结果上,如果全是orthographic camera的话,会产生什么样的结果呢? +每次看到别人把多个引擎,多个三维软件的结果做对比,可见我还只是停留在知识点上。系统的分析其内容是需要深厚的知识储备的。 \ No newline at end of file diff --git a/cg/geometry.md b/cg/geometry.md index e026469..5167ff4 100644 --- a/cg/geometry.md +++ b/cg/geometry.md @@ -1,5 +1,7 @@ # Geometry +- [Polygon Mesh Processing书籍](/cg/mesh/PolygonMeshProcessing.md) + ## Projective Geometric Algebra - [Projective Geometric Algebra](http://projectivegeometricalgebra.org/) diff --git a/cg/gpu.md b/cg/gpu.md deleted file mode 100644 index b1b1298..0000000 --- a/cg/gpu.md +++ /dev/null @@ -1,49 +0,0 @@ -# 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 -``` -## 概念 - - -## where gpu sits in the system - -理想化其概念, - - -## 参考 - -- [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) \ No newline at end of file diff --git a/cg/graphics.md b/cg/graphics.md index 45c2263..f45ec56 100644 --- a/cg/graphics.md +++ b/cg/graphics.md @@ -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的话,会产生什么样的结果呢? -每次看到别人把多个引擎,多个三维软件的结果做对比,可见我还只是停留在知识点上。系统的分析其内容是需要深厚的知识储备的。 \ No newline at end of file +- [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) diff --git a/cg/library/NumericCalculation.md b/cg/library/NumericCalculation.md index ddaa4d1..44158f2 100644 --- a/cg/library/NumericCalculation.md +++ b/cg/library/NumericCalculation.md @@ -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/) diff --git a/cg/render.md b/cg/render.md deleted file mode 100644 index 39fb991..0000000 --- a/cg/render.md +++ /dev/null @@ -1,8 +0,0 @@ -# Render -> 渲染器 - -## phong - -## parallax mapping -是一种类似于法线贴图的纹理技术,能显著增强模型或纹理的表面细节和凹凸感 -[GLRF_example实现了一个视差映射的demo](https://github.com/DunkleMango/GLRF_Example) diff --git a/cg/tools/CAD.md b/cg/tools/CAD.md deleted file mode 100644 index 341afde..0000000 --- a/cg/tools/CAD.md +++ /dev/null @@ -1,29 +0,0 @@ -# CAD - -## 编辑器子概念 - -### 吸附Absorb - -对一个元素拖拽时,生成当前元素与其他元素对齐的参考线, -实现相近元素间的四条边与水平中心线或垂直中心线对齐. -在拖动完成后实现自动吸附对齐 - -应该是在编辑情况下,对于拖拽的元素自动对齐的功能 - -### 自动布局 - -### Frame -图框 -### 组 - -## [exocad](https://exocad.com/) - -Exocad是一款跨平台的应用程序,免费使用。 - -## 参考 - -- [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) diff --git a/index/computerScience.md b/index/computerScience.md index 5765c53..9e7418e 100644 --- a/index/computerScience.md +++ b/index/computerScience.md @@ -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/) @@ -45,7 +46,6 @@ - [网格划分](/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) @@ -53,15 +53,12 @@ - [计算几何第四周:维诺图](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)