CS_BeatSaber_Camera2 icon indicating copy to clipboard operation
CS_BeatSaber_Camera2 copied to clipboard

Change the maximum opacity value of Transparency

Open rynan4818 opened this issue 1 year ago • 8 comments

Even if I set the 'Transparency Threshold' of 'EFFECTS' to the minimum (0.5), the maximum alpha value is clamped at 0.9. I would like to be able to change the clamp value.

The reason is that we want to display the avatar as an overlay, but it is a bit transparent.

image

The right side shows this clamp replaced with a shader that has been changed to 1.0 https://github.com/kinsi55/CS_BeatSaber_Camera2/blob/aa93200cd4553254958fe8202dc39d7ae65f0ca4/Shaders/LuminanceKey.shader#L55

rynan4818 avatar Mar 05 '23 07:03 rynan4818

Hm, I did have some reason before why I clipped it at 0.9... But I dont remember any more. I'll just change it to 1 with the next version

kinsi55 avatar Mar 08 '23 00:03 kinsi55

I didn't see any reason to set it to 0.9 either, so if it's fine to set it to 1, that's fine.

rynan4818 avatar Mar 08 '23 11:03 rynan4818

Actually, I remembered why I do thave that in there. That statement is only relevant when you do not use the depth buffer - Have you enabled the depth texture for that camera?

kinsi55 avatar Mar 09 '23 02:03 kinsi55

image Transparency remains the same whether depth texture is enabled or disabled. The left side is enabled and the right side is disabled.

rynan4818 avatar Mar 09 '23 15:03 rynan4818

I suppose the Shaders on your Avatar do not write to the Depthbuffer then. Alright I'll just change the clamp value.

kinsi55 avatar Mar 09 '23 16:03 kinsi55

By the way, the avatar display mod we are using is Custom Avatars 5.3.0.

I am very grateful for this feature of Camera2, as it is essential for this kind of overlay display using Custom Avatars.

rynan4818 avatar Mar 10 '23 02:03 rynan4818

The problem here is with the specific model that you use not with the Avatar Mod - The Materials / Shaders do not write to the depth buffer, thus Cam2 doesnt properly know which pixels are supposed to be transparent or not, but yeah this issue shouldnt exist anymore when I change the clamp value.

kinsi55 avatar Mar 10 '23 02:03 kinsi55

Okay, I understand. I don't know if changing the clamp value has any impact or problem on the others, but I will leave it to you to decide on the modification.

rynan4818 avatar Mar 10 '23 02:03 rynan4818