Search the Community
Showing results for tags 'blending'.
Found 3 results
Greetings, fellow Jedi! Have a good day y'all. I have a question - just like the title says; What is clamp -in KotOR implementation- that were oftenly used with most player heads? I asked of this because earlier I fiddle around with LSP_planettari01* by using this parameter - blending punchthrough clamp 3 on the TXI and then the planet's gone. The alpha were applied appropriately, because later when I used only this - blending punchthrough the planet's there. Many thanks for considering this, and may the Force be with you! _____ __ _____ * Taris planet texture that were used in the turret mini-game backdrop
Greetings, fellow Jedi! Hope y'all doing fine. In vanilla and/or modded state of the game there seems to be rendering issue with a texture that is rendered behind blending additive shader. As seen in the screenshot: Is there any way to get around this problem? I have tried with removing the additive and using the alpha channel as transparency instead but it looks ugly and then again, another problem as the hilt that was rendered behind is hidden accordingly with the dimension of the top layer's texture. By using the TPC format seems to didn't help much as any alpha-blending value between 0 to 1.0 failed to resolve the issue. I haven't tried with removing the shader/alpha from the hilt that is in the left-hand but- will it work? And even if it works, is there any other way around as a hilt without metal shade is 🤪. Many thanks for considering this!
The TPC texture format contains a floating point number in its header that we refer to as 'alpha blending'. It appears to be critical when used with DXT5 compression. This tutorial will try to help you use this feature properly. What is alpha blending? Alpha blending is not a direct 'opacity' or 'transparency' factor. It is only relevant for non-environment mapped textures that contain alpha-channel image-based transparency. For example, semi-transparent signage, mostly transparent windows, ghosts, etc. The best description I can give you for what alpha blending is: TLDR: alpha blending is not object opacity. It hides any mesh behind the textured object that has opacity less than tpc alpha blending number. Set it to 0.0 when using texture alpha channel as transparency. The meshes that will be hidden include any mesh that may be using alpha channel solely for environment mapping. Let's see how this plays out in practice with some visual aids. Each figure uses a TPC encoded version of the K1 Manaan Overhaul semi-transparent texture for the Sith Embassy signage. Transparency of the sign is right around 50%. Figure 1. TPC with alphaBlending set to 1.0 With alphaBlending set to 1.0 the only thing that shows through the sign is the skybox itself. This may be some kind of depth buffer test to make sure that something always blends through, which, in the 1.0 case, leaves just the most distant mesh, the skybox. Figure 2. TPC with alphaBlending set to 0.9 This seems to be the critical shot. With alphaBlending set to 0.9, lma_wall11 is showing, while lma_wall09 is hidden. lma_wall11 is 100% opaque, 0% transparent. lma_wall09 is 85% opaque, 15% transparent. So because lma_wall11 opacity > alphaBlending, it is shown, while, for lma_wall09, opacity < alphaBlending, so it is hidden. Figure 3. TPC with alphaBlending set to 0.5 In figure 3 we can see that both lma_wall09 and lma_wall11 are showing because their opacities are both greater than 50%. Figure 4. TPC with alphaBlending set to 0.0 This looks exactly the same as figure 3. Wait, isn't that weird though? Why can't we see the other sign through the first sign? It's opacity is 50%, which is greater than 0.0... Figure 5. TPC with alphaBlending set to 0.5, reverse viewing angle Just by looking through the sign in the opposite direction, the signs in the background now are blended through. This is showing a couple things. First, it seems that alphaBlending doesn't actually control instances where the same texture is behind itself. Instead, it appears that there is some kind of directionality at play. I haven't figured out what determines the direction of blending. I investigated whether it was the faces that appear earlier or later, but that didn't necessarily seem true. Using alpha blending The game's vanilla textures use all kinds of different values from 0.0 - 1.0 here. I do not fully understand why or how they have come up with a lot of their alpha blending values. In my testing, it seems like if you have a semi-transparent object, you set this to a low value, 0.0 or 0.1, and if you have a non-transparent object, you set this to 1.0. The important thing is that you do not think of alpha blending as the transparency or opacity of the object itself. If anyone comes up with better guidelines for setting this value through scientific testing, I will be happy to update this post to reflect the improved guidance.