Skip to content

Conversation

Geenz
Copy link
Collaborator

@Geenz Geenz commented Sep 24, 2024

This PR includes support for alpha gamma parameters.

@Geenz Geenz marked this pull request as ready for review September 27, 2024 17:30
@Geenz Geenz requested a review from RunitaiLinden September 27, 2024 17:30
@Geenz Geenz changed the base branch from develop to release/2024.12-ForeverFPS February 14, 2025 17:06
@Geenz Geenz changed the base branch from release/2024.12-ForeverFPS to develop February 14, 2025 17:12
@Geenz Geenz marked this pull request as draft April 28, 2025 21:12
vldevel pushed a commit to vldevel/viewer-henri-contribs that referenced this pull request Aug 23, 2025
…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
vldevel added a commit to vldevel/viewer-henri-contribs that referenced this pull request Aug 23, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants