fix: CameraView

TWO lines (нет слов, одни эмоции бля)
This commit is contained in:
2026-04-13 18:36:53 +03:00
parent 66cd73d8ff
commit b7a095f84d
+6 -5
View File
@@ -51,7 +51,7 @@ public partial class CameraView : OpenGlControlBase
uniform mat4 uMvp; uniform mat4 uMvp;
uniform mat3 uUv; uniform mat3 uUv;
out vec2 vUv; out vec2 vUv;
void main() void main()
@@ -59,7 +59,7 @@ public partial class CameraView : OpenGlControlBase
vec3 uv = uUv * vec3(aUv, 1.0); vec3 uv = uUv * vec3(aUv, 1.0);
vUv = uv.xy; vUv = uv.xy;
gl_Position = uMvp * vec4(aPos, 0.0, 1.0); gl_Position = uMvp * vec4(aPos, 0.0, 1.0);
} }
"; ";
private const string FRAGMENT_SHADER = @" private const string FRAGMENT_SHADER = @"
#version 300 es #version 300 es
@@ -73,7 +73,7 @@ public partial class CameraView : OpenGlControlBase
void main() void main()
{ {
fragColor = texture(uTex, vUv); fragColor = texture(uTex, vUv);
} }
"; ";
private readonly float[] Vertices = private readonly float[] Vertices =
[ [
@@ -164,7 +164,7 @@ public partial class CameraView : OpenGlControlBase
gl.BindVertexArray(VAO); ThrowIfOpenGLError(gl); gl.BindVertexArray(VAO); ThrowIfOpenGLError(gl);
gl.BindBuffer(GlConsts.GL_ARRAY_BUFFER, VAO); ThrowIfOpenGLError(gl); gl.BindBuffer(GlConsts.GL_ARRAY_BUFFER, VBO); ThrowIfOpenGLError(gl);
unsafe unsafe
{ {
fixed (float* pVertices = Vertices) fixed (float* pVertices = Vertices)
@@ -515,6 +515,7 @@ public partial class CameraView : OpenGlControlBase
var tileMode = TileMode; var tileMode = TileMode;
// 1. Очищаем экран // 1. Очищаем экран
gl.Disable(GlConsts.GL_SCISSOR_TEST);
gl.Viewport(0, 0, (int)Bounds.Width, (int)Bounds.Height); gl.Viewport(0, 0, (int)Bounds.Width, (int)Bounds.Height);
gl.ClearColor(0f, 0f, 0f, 0f); gl.ClearColor(0f, 0f, 0f, 0f);
gl.Clear(GlConsts.GL_COLOR_BUFFER_BIT); gl.Clear(GlConsts.GL_COLOR_BUFFER_BIT);
@@ -697,4 +698,4 @@ public partial class CameraView : OpenGlControlBase
return (1f, 1f); return (1f, 1f);
} }
} }
} }