Triangle fullscreen quad

This commit is contained in:
Simon Lübeß
2022-05-28 15:53:35 +02:00
parent d212576719
commit 47fdce0a7e
+7 -11
View File
@@ -11,25 +11,21 @@ namespace GlitchyEngine.Renderer
s_fullscreenQuadGeometry = new GeometryBinding(); s_fullscreenQuadGeometry = new GeometryBinding();
s_fullscreenQuadGeometry.SetPrimitiveTopology(.TriangleList); s_fullscreenQuadGeometry.SetPrimitiveTopology(.TriangleList);
using(var quadVertices = new VertexBuffer(typeof(Vector4), 4, .Immutable)) using(var quadVertices = new VertexBuffer(typeof(Vector4), 3, .Immutable))
{ {
Vector4[4] vertices = .( Vector4[4] vertices = .(
.(-1,-1, 0, 1), .(-1, 1, 0, 0),
.(-1, 1, 0, 0), .( 3, 1, 2, 0),
.( 1, 1, 1, 0), .(-1,-3, 0, 2),
.( 1,-1, 1, 1) );
);
quadVertices.SetData(vertices); quadVertices.SetData(vertices);
s_fullscreenQuadGeometry.SetVertexBufferSlot(quadVertices, 0); s_fullscreenQuadGeometry.SetVertexBufferSlot(quadVertices, 0);
} }
using(var quadIndices = new IndexBuffer(6, .Immutable)) using(var quadIndices = new IndexBuffer(3, .Immutable))
{ {
uint16[6] indices = .( uint16[3] indices = .(0, 1, 2);
0, 1, 2,
2, 3, 0
);
quadIndices.SetData(indices); quadIndices.SetData(indices);
s_fullscreenQuadGeometry.SetIndexBuffer(quadIndices); s_fullscreenQuadGeometry.SetIndexBuffer(quadIndices);