C
C#2mo ago
KleinRiese

✅ OpenGl Problem : I am trying to render a square, but I am getting a black Screen

I am using C# witch OpenTk. Here is the Code:
4 Replies
KleinRiese
KleinRiese2mo ago
Vertex Shader : #version 330 layout(location = 0) in vec4 aPosition; void main() { gl_Position = aPosition; } Fragment Shader : #version 330 out vec4 FragColor; void main() { FragColor = vec4(1.0, 1.0, 1.0, 1.0); }
qqdev
qqdev2mo ago
Did the compilation of the shader succeed? + the ValidateProgram call Please let us know what the issue was :>
KleinRiese
KleinRiese2mo ago
Oh, Im sorry, i filled the indexbuffer with the vertex data, instead of the index data... BufferData(OpenTK.Graphics.OpenGL.BufferTarget.ElementArrayBuffer, indicies.Length * sizeof(uint), vertecies, OpenTK.Graphics.OpenGL.BufferUsageHint.StaticDraw); the "vertecies" varieable is the vertexdata. Copie and pastet without checking twice if i had corrected everything I tried GL.DrawArray(), wich only uses the Vertecies and it worked. So i knew it hat something to do with the index Buffer
qqdev
qqdev2mo ago
Thanks! ❤️
Want results from more Discord servers?
Add your server