Commit ce06e17
committed
Fix the alpha gamma value when rendering legacy diffuse textures and materials
With the new PBR renderer, the faces using alpha blend with a simple diffuse
texture or a Blinn-Phong material are badly rendered (way too opaque), which
breaks rendering for an enormous amount of "legacy" (pre-PBR) objects.
It has been proposed (1) to introduce a new "alpha gamma" parameter for faces,
that would need to be set on legacy contents in order to fix the latter, which
would also force to introduce a no-mod permission exception for this parameter
alone, so that people owning a legacy no-mod object could still manually edit
it to fix its rendering.
This proposal is ill-conceived: how can anyone, in their right mind, hope that
*every* owner of *every* "legacy" object using alpha blending in SL will
bother to edit the said object (supposing they even know they can do it and
how to do it) ???
The *proper* solution is to fix the renderer itself, and automatically apply a
gamma correction factor to faces *not bearing* a glTF material.
This commit implements this fix (which is now part of the Cool VL Viewer and
proves that it works very nicely). It implements the same kind of rendering
fix (at the shader level) as (2), but instead automatically detects faces
rendering with a PBR material, and applies the correction to all faces *not*
using such a material.
In the event you want to let contents creators use linear alpha channels in
objects mixing legacy BP materials and PBR materials (even though I fail to
see how a creator would want to do that at all), I suggest you implement an
additional flag for faces, that could be set to antagonize this auto-fix
(this would let full leeway about the alpha channel scale for newly created
contents while not requiring to implement some weird no-mod permission
exception since this flag would be set by the creator themselves).
In the mean time, this fix solves one of the remaining major issues seen
with the PBR renderer.
(1) https://feedback.secondlife.com/bug-reports/p/pbr-client-opacity-issue-on-textures-with-alpha-channel-windows
(2) secondlife#26681 parent cefee59 commit ce06e17
File tree
8 files changed
+31
-5
lines changed- indra
- llrender
- newview
- app_settings
- shaders
- class2/deferred
- class3/deferred
8 files changed
+31
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
| 1316 | + | |
1316 | 1317 | | |
1317 | 1318 | | |
1318 | 1319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7478 | 7478 | | |
7479 | 7479 | | |
7480 | 7480 | | |
| 7481 | + | |
| 7482 | + | |
| 7483 | + | |
| 7484 | + | |
| 7485 | + | |
| 7486 | + | |
| 7487 | + | |
| 7488 | + | |
| 7489 | + | |
| 7490 | + | |
| 7491 | + | |
7481 | 7492 | | |
7482 | 7493 | | |
7483 | 7494 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | | - | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
266 | | - | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
598 | 603 | | |
599 | 604 | | |
600 | 605 | | |
| |||
760 | 765 | | |
761 | 766 | | |
762 | 767 | | |
| 768 | + | |
| 769 | + | |
763 | 770 | | |
764 | 771 | | |
765 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5372 | 5372 | | |
5373 | 5373 | | |
5374 | 5374 | | |
| 5375 | + | |
5375 | 5376 | | |
5376 | | - | |
5377 | 5377 | | |
5378 | | - | |
5379 | 5378 | | |
5380 | 5379 | | |
5381 | 5380 | | |
| |||
5384 | 5383 | | |
5385 | 5384 | | |
5386 | 5385 | | |
| 5386 | + | |
5387 | 5387 | | |
5388 | 5388 | | |
5389 | 5389 | | |
| |||
5447 | 5447 | | |
5448 | 5448 | | |
5449 | 5449 | | |
| 5450 | + | |
5450 | 5451 | | |
5451 | 5452 | | |
5452 | 5453 | | |
| |||
5501 | 5502 | | |
5502 | 5503 | | |
5503 | 5504 | | |
| 5505 | + | |
5504 | 5506 | | |
5505 | 5507 | | |
5506 | 5508 | | |
| |||
0 commit comments