Shader 学习 · 模块
Math
向量与矩阵的数学基础:点积、旋转、直线与圆相交、坐标空间。
- 01 Soft Circle Cutout 本质是利用step,smoothstep, 三元运算符或是if做判断 2D 片段
- 02 Vector Translation 向量位移 2D 片段
- 03 Vector Scalar Multiplication 向量的放大和位移 2D 片段
- 04 Vector as Displacement 这里是利用单位向量的性质获得cos和sin 2D 片段
- 05 Unit Vector shader-learning 自学第 5 课:Unit Vector 2D 片段
- 06 90-Degree Rotation 求原点到把手的向量,然后逆时针转90度 2D 片段
- 07 Dot - Classify shader-learning 自学第 7 课:Dot - Classify 2D 片段
- 08 Dot Product Cosine cos 里面是弧度计算,返回cos值,好和cos做对比 2D 片段
- 09 Dot Scalar Projection 点乘的应用1 2D 片段
- 10 Axis Aligned Line shader-learning 自学第 10 课:Axis Aligned Line 2D 片段
- 11 Oriented Line 点乘的应用2 2D 片段
- 12 Line Circle Intersection shader-learning 自学第 12 课:Line Circle Intersection 2D 片段
- 13 Oriented Line Circle Intersection **目标**:用“方向对准”来判断线是否可能与圆相交。 2D 片段
- 14 Lines Intersection shader-learning 自学第 14 课:Lines Intersection 2D 片段
- 15 Line Segment 很酷的裁剪手法:float seg = step(dot(l, a), dot(l, uv)) * step(dot(l, uv), dot(l, b)); 2D 片段
- 16 Matrix 两个解没区别,这里注意一开始uv就被平移到了-0.5-0.5的空间里。下面的0.5,0.5 则是这个坐标系的右上角45的位置,旋转反而是最简单的一步 2D 片段
- 17 Equirectangular texture 具体公式可以回去看 https://shader-learning.com/module-training/built-in-functions/task/equirectangular-texture 网格
- 18 Spherical Coordinates 我的版本和gpt一起写的,所以更高级,考虑了局部空间到世界空间的转换,但是不能pass。 网格
- 19 Normal Space 和36是一个写法 网格