C
C#3mo 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
KleinRieseOP3mo 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
qqdev3mo ago
Did the compilation of the shader succeed? + the ValidateProgram call Please let us know what the issue was :>
KleinRiese
KleinRieseOP3mo 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
qqdev3mo ago
Thanks! ❤️
Want results from more Discord servers?
Add your server