# Introduction
Kristy's Alpha Fixer is a script that synchronizes Legacy Material (Blinn-Phong) transparency changes with PBR Alpha.
PBR Materials have their own alpha value that is not the same as the standard transparency value, which means older scripts do not support making PBR materials invisible.
This script is copy only, because I do not want creators using this specific method as a 'quick fix':
A proper fix designed for their own specific scripts will be better for performance and memory use.
This is only intended as a workaround for DIY-ers who are PBR-ifying items they own.
You'll need Mod permissions on the items you want to use this on.
Blinn-Phong Emissive is completely different from PBR Emissive and is not compatible so it will be treated as Opaque by this script.
## Variants
Multiple script variants are included to cover variety of different use cases.
Use ONLY ONE of the scripts!
I recommend using the Basic variant - it will work in vast majority of the use cases.
Sometimes you might need to use the Colour variant.
The other variants are for very rare and very specific edge cases.
-- See Included Notecard for full details --
## Setting it up
-- See Included Notecard for full details --
## How PBR Materials Work
# PBR Overrides Caveat
From: https://wiki.secondlife.com/wiki/LlSetLinkGLTFOverrides
> OVERRIDE_GLTF_BASE_COLOR_FACTOR and OVERRIDE_GLTF_BASE_ALPHA parameters are coupled. If an override is set for one parameter, then the other is automatically given an override. The default OVERRIDE_GLTF_BASE_COLOR_FACTOR is <1,1,1>, and the default OVERRIDE_GLTF_BASE_ALPHA is 1.0.
Here is the LSL bug related to this.
https://feedback.secondlife.com/scripting-bugs/p/pbr-colour-data-is-lost-when-setting-pbr-overrides
In short - this means that if there is no colour override set, the item will turn white.
To work around it, you simply need to change the Base Colour tint back to the desired colour for each face, on the item itself.
The Tint Colour variant of the script is not affected, but you need to tint Blinn-Phong materials to actually tint PBR materials
# General PBR Material explanation
Before PBR you can set your textures and tint colour, but when PBR material is applied, those values will be ignored, and the PBR values will be used.
PBR values are separate from the Blinn-Phong values, and as mentioned above, the transparency/alpha values are also separate.
PBR material can be applied in two ways:
A) By dragging and dropping a Material Object from your inventory onto a specific face of the item or via edit menu by selecting a Material Object from your inventory by choosing PBR material mode for that face. This applies a Material to that face.
B) You can also apply a 'Blank' material while editing the object, if you don't have a Material Object in your inventory. In this case, you will have to edit individual properties of the PBR material on the item itself, rather than Material Object in the inventory.
Editing these properties on the item itself, stores them as Material Overrides, which are different from Material Object.
The material slot, can only be set to a complete material, whether it is from your inventory or blank.
Scripts and editing object manually can only change the values in the Override part.
Think of it this way, when the viewer tries to render the object it will be told "Use this Material, but when you need to use a colour, here's an Override to use instead".
Due to the Caveat mentioned above, changing just the alpha, will also change the colour as well, which means, if there is no Override set already, it will be set to white instead.
If you change this white to something else, my script will be able to use that colour during any further alpha changes.
When using the Tint Colour variant, the script will take the Blinn-Phong colour and place it in the Override, replacing any colour you might have set manually.
Depending on your viewer, you may or may not be able to edit Blinn-Phong values without removing PBR material first.
## Changelog
# v1.4.1 - 07/07/2025
+ Fixed an issue where the script sometimes would not work with textures without alpha.
+ Small optimisation to skip non-PBR faces.
# v1.4.0 - 30/06/2025
+ Added more script variants.
+ Swapped to using llSetLinkGLTFOverrides()
- And variety of other code changes, script should be a little bit faster.
Full Notes included in the notecard.
See item in Second Life- PBR
- Alpha
- Fix
Works like a charm
Should have been built in, but this is a good workaround.