第一个版本
This commit is contained in:
@@ -11,7 +11,7 @@ void main() {
|
|||||||
|
|
||||||
// 网格参数
|
// 网格参数
|
||||||
float gridSize = 14.0; // 网格大小
|
float gridSize = 14.0; // 网格大小
|
||||||
float dotRadius = 7.0; // 点状半径
|
float dotRadius = 6.0; // 点状半径
|
||||||
|
|
||||||
// 计算当前片段所在的网格和网格中心坐标
|
// 计算当前片段所在的网格和网格中心坐标
|
||||||
vec2 gridCoord = fragPos / gridSize;
|
vec2 gridCoord = fragPos / gridSize;
|
||||||
@@ -21,7 +21,7 @@ void main() {
|
|||||||
float distanceToCenter = length(fragPos - gridCenter);
|
float distanceToCenter = length(fragPos - gridCenter);
|
||||||
|
|
||||||
// 如果距离超过点状半径,丢弃(创建点状虚线)
|
// 如果距离超过点状半径,丢弃(创建点状虚线)
|
||||||
if (distanceToCenter > dotRadius) {
|
if (distanceToCenter > dotRadius && fragColor.y > 0.5) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user