Closed tn88test closed 7 years ago
Whenever I try to pass data data from vertex shader to fragment shader, my computer will crash. I tried other computer and the same crash happens.
Example: Vertex Shader
#version 330 core layout(location = 0) in vec3 position; out vec4 ourColor; void main(){ gl_Position = vec4(position ,1); ourColor = vec4(1.0f, 0.0f, 0.0f, 1.0f); }
Fragment Shader
#version 330 core in vec4 ourColor; out vec4 color; void main() { color = ourColor; }
I don't see anything wrong in your shader. Maybe it's somewhere else causing crash.
I found the problem. I forgot to use gl.UseProgram(0); after drawing. Thanks for your help.
gl.UseProgram(0);
Whenever I try to pass data data from vertex shader to fragment shader, my computer will crash. I tried other computer and the same crash happens.
Example: Vertex Shader
Fragment Shader