Commit 01ea578
committed
URenderPipeline: Fix rendering being affected by global glColor state
The `glColor` state is initially `1f, 1f, 1f, 1f`, but other code (e.g.
until 1.14 the vanilla FontRenderer) may change it and if it doesn't
change it back afterwards, users of `URenderPipeline` may not get the
expected render result (anything which doesn't explicitly use per-vertex
colors will implicitly get colored with whatever glColor was last set).
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 coloring
is ordinarily just done via the per-vertex color. And modern OpenGL
doesn't support it anyway.1 parent 5f02456 commit 01ea578
File tree
2 files changed
+36
-0
lines changed- src/main/kotlin/gg/essential/universal/render
2 files changed
+36
-0
lines changedLines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| |||
184 | 193 | | |
185 | 194 | | |
186 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
| |||
222 | 238 | | |
223 | 239 | | |
224 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
225 | 245 | | |
226 | 246 | | |
227 | 247 | | |
228 | 248 | | |
229 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
230 | 261 | | |
231 | 262 | | |
232 | 263 | | |
233 | 264 | | |
234 | 265 | | |
235 | 266 | | |
| 267 | + | |
236 | 268 | | |
237 | 269 | | |
238 | 270 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
| |||
0 commit comments