Commit cfb963c
authored
URenderPipeline: Fix rendering being affected by global glShadeModel state
The `glShadeModel` state is initially `GL_SMOOTH`, but other code may
change it to `GL_FLAT` and if it doesn't change it back afterwards,
users of `URenderPipeline` may not get the expected render result (e.g.
trying to draw a gradient will result in a single flat color instead).
The chance of some user of `URenderPipeline` intentionally relying on
this global state leaking in feels sufficiently low, that I don't think
any backwards compatibility needs to be maintained for it.
I don't think it is even necessary to make this behavior configurable,
since we don't allow a single vertex to be shared by multiple
primitives, so anything which could be achieved by using GL_FLAT can
also by achieved by simply using the same data for all vertices of each
primitive. And modern OpenGL doesn't support it anyway.
GitHub: #1161 parent da7bf4a commit cfb963c
File tree
2 files changed
+9
-0
lines changed- src/main/kotlin/gg/essential/universal/render
2 files changed
+9
-0
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| |||
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
| 221 | + | |
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
218 | 225 | | |
| 226 | + | |
219 | 227 | | |
220 | 228 | | |
221 | 229 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| |||
0 commit comments