Skip to content

Conversation

vldevel
Copy link
Contributor

@vldevel vldevel commented Aug 23, 2025

Description

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.

Related Issues

(1) https://feedback.secondlife.com/bug-reports/p/pbr-client-opacity-issue-on-textures-with-alpha-channel-windows
(2) #2668

…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#2668
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


root seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@vldevel
Copy link
Contributor Author

vldevel commented Aug 23, 2025

Bleh... I DID set my email !... I HATE git !

@vldevel vldevel closed this Aug 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2025
@vldevel vldevel deleted the legacy_alpha_gamma branch August 23, 2025 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant