Skip to content

Commit e21c014

Browse files
authored
Merge pull request #37 from deccer/main
Troubleshoot OpenGL article fixups
2 parents 81a8093 + 5ddbe2d commit e21c014

File tree

1 file changed

+8
-7
lines changed
  • blog/2024/2024-11-01-my-screen-is-black

1 file changed

+8
-7
lines changed

Diff for: blog/2024/2024-11-01-my-screen-is-black/index.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: ['opengl', 'troubleshoot', 'guide', 'article', 'debug']
88
image: 'https://raw.githubusercontent.com/graphicsprogramming/blog/main/blog/2024/2024-11-01-my-screen-is-black/arrested-for-opengl-crimes-full.png'
99
---
1010

11-
![](arrested-for-opengl-crimes-full.png)
11+
![arrested for opengl crimes](arrested-for-opengl-crimes-full.png)
1212

1313
<!-- truncate -->
1414

@@ -25,7 +25,7 @@ If you use `glGetError` with or without macros like `GLCALL` or `GLCHECK` or rol
2525

2626
Make sure you check that shader compilation *and* linking was successful. See `glGetShaderiv` & `glGetProgramiv` on compile and link status.
2727

28-
### You are on a Mac
28+
### You are on a Mac
2929

3030
Please port your engine to `metal` or `webgpu` at least, seriously. There is no support for `KHR_debug` and you cannot use anything > gl 4.1. That is enough reason
3131

@@ -49,12 +49,12 @@ Older versions of `gEDebugger` or `CodeXL` might work too.
4949
It is most likely that the headers you are using are just outdated. Regenerate the header on dav1d's site. Or check your build system that it is
5050
pulling a recent version of glad.
5151

52-
### Debug Callback Says...
52+
### Debug Callback Says
5353

5454
- `GL_INVALID_OPERATION error generated. Array object is not active.`:
5555
You didn't bind a VAO. Core Context OpenGL requires a VAO bound at all times. Bind one.
5656

57-
### Shader Compiler Log Says...
57+
### Shader Compiler Log Says
5858

5959
- `function "main" is already defined`
6060
You probably compile your fragment shader as vertex shader or other way around
@@ -65,7 +65,7 @@ pulling a recent version of glad.
6565
You either need to query extensions with a forward compatible context or you switch to query `GL_NUM_EXTENSIONS` first and
6666
then iterate over all of them with `glGetStringi` and then check if the extension is part of that list. The latter requires a core OpenGL context.
6767

68-
### Exception when calling glDrawElements - aka "0xC0000005"
68+
### Exception when calling glDrawElements - aka "0xC0000005"
6969

7070
You most likely have no indexbuffer is bound. Or it is not associated to/with the current VAO.
7171

@@ -109,7 +109,8 @@ Vertex colors might just be black. If it wasn't intentional, check the contents
109109
- are you playing with depth-pre-pass-isms?
110110
- make sure the gl state between passes is the same, face winding, cullmode, etc. See Appending A.3 in the gl spec for more clues about invariance.
111111
- check winding order and cullmode, you might be looking at the wrong side of your faces
112-
- you check renderdoc and wonder why the vertex list contains the same (perhaps even first element) only, for all vertices. Make sure your `glDrawElements(..., ..., GL_UNSIGNED_INT, ...)` or whatever datatype your indexbuffer consists of matches that parameter
112+
- you check renderdoc and wonder why the vertex list contains the same (perhaps even first element) only, for all vertices. Make sure your `glDrawElements(..., ..., GL_UNSIGNED_INT, ...)` or whatever datatype your indexbuffer consists of matches that parameter
113+
- Perhaps you are trying to read an int/uint or long/ulong value from your vertex attribute. Get some glasses and double check that you called the right `glVertexAttrib`**`X`**`Pointer` when setting up your VAO.
113114

114115
All these things can be checked with a graphics debugger of your choice.
115116

@@ -121,7 +122,7 @@ Request 4 channels from stb_image. There is almost never a reason to request 3 o
121122

122123
### Textures look like one color component is more prominent than others
123124

124-
Happens when you are used to DirectXisms.
125+
Happens when you are used to DirectXisms
125126

126127
- Colors are more shifted towards blue
127128

0 commit comments

Comments
 (0)