正交投影完成

This commit is contained in:
xsl
2025-09-24 22:20:07 +08:00
parent ceba7f90ac
commit a112cecfbf
6 changed files with 18 additions and 1 deletions
Binary file not shown.
Binary file not shown.
@@ -6,6 +6,20 @@ layout(location = 2) in vec3 fragLineEnd;
layout(location = 0) out vec4 outColor; layout(location = 0) out vec4 outColor;
layout(binding = 0) uniform UniformBufferObject {
mat4 proj;
mat4 model;
mat4 view;
} ubo;
layout(binding = 1) uniform DashParameters {
float dashSize;
float gapSize;
float dashOffset;
float uAASize;
int useWorldSpace;
} dashParams;
void main() { void main() {
vec2 fragPos = gl_FragCoord.xy; vec2 fragPos = gl_FragCoord.xy;
Binary file not shown.
+4 -1
View File
@@ -15,7 +15,10 @@ void main() {
// 预计算MVP矩阵以减少乘法次数 // 预计算MVP矩阵以减少乘法次数
mat4 mvp = ubo.proj * ubo.view * ubo.model; mat4 mvp = ubo.proj * ubo.view * ubo.model;
//vec3 pos = vec3(2.0, inPosition.y, inPosition.z); //vec3 pos = vec3(2.0, inPosition.y, inPosition.z);
gl_Position = mvp * vec4(inPosition, 1.0); //gl_Position = mvp * vec4(inPosition, 1.0);
gl_Position = vec4(inPosition.xy*2 -1, 0.5, 1.0);
fragColor = inColor; fragColor = inColor;
gl_PointSize = 2.0; gl_PointSize = 2.0;
} }
Binary file not shown.