platane Posted May 9, 2014 Share Posted May 9, 2014 Hi there, I have a question related to how the alpha is computed in default shader which use a texture. What I am trying to achieve here is to display the length of an object in a dynamic texture. without transparent background with transparent background The shader algorithms only render pixels as opaque or full transparent ( discarded with alpha test ) which create this aliased aspect. In order to make everything looks smoother, I want to have pixel that have an alpha channel between 0 and 1. I understand that it's more expensive in term of performance. I found two ways to enable pixel blending: * I can apply a global alpha to the whole material but that's not what I want * I can use an opacity texture. It works but I think it's a bit overkill. Indeed as the alpha information are already in the diffuse texture, the information in the opacity texture are redundant in that case. I am ok with this solution, but is there currently a better way to achieve this? I guess we could use a flag to trigger a special behavior of the shader, but it may not worth it if this usecase is no so common. Thanks UPDATE : modifications merged here https://github.com/BabylonJS/Babylon.js/pull/194 thanks! Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.