From 74283d7147fdc049d1841a915b7d247b98ca84c1 Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Mon, 24 Jan 2022 22:40:34 +0800 Subject: [PATCH] render: re-add texCoord vertex attribute --- internal/render/render_world_helper.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/render/render_world_helper.go b/internal/render/render_world_helper.go index db190c7..bf40145 100644 --- a/internal/render/render_world_helper.go +++ b/internal/render/render_world_helper.go @@ -9,11 +9,17 @@ import ( var ( screenQuadVerts = []float32{ -1, -1, + 0, 0, 1, -1, + 1, 0, + 1, 1, 1, 1, -1, -1, + 0, 0, + 1, 1, 1, 1, -1, 1, + 0, 1, } screenQuadVAO uint32 screenQuadVBO uint32 @@ -27,8 +33,10 @@ func initScreenQuad() { gl.GenVertexArrays(1, &screenQuadVAO) gl.BindVertexArray(screenQuadVAO) - gl.VertexAttribPointer(0, 2, gl.FLOAT, false, int32(2*unsafe.Sizeof(float32(0))), gl.PtrOffset(0)) + gl.VertexAttribPointer(0, 2, gl.FLOAT, false, int32(4*unsafe.Sizeof(float32(0))), gl.PtrOffset(0)) + gl.VertexAttribPointer(1, 2, gl.FLOAT, false, int32(4*unsafe.Sizeof(float32(0))), gl.PtrOffset(int(2*unsafe.Sizeof(float32(0))))) gl.EnableVertexAttribArray(0) + gl.EnableVertexAttribArray(1) } // drawScreenQuad draws a Quad covering the entire screen.