jpdev Posted December 11, 2016 Share Posted December 11, 2016 I noticed that decals can be transparent in places but they are either 100% transparent in a pixel or 0%. I would like to have "soft" edges on my decals and also be able to only slightly color the underlying object. So a 50% transparency decal for example, or a decal with different values for the alpha channel. Is there any way to accomplish this? I tried setting visibility to 0.5 on the decal, but this breaks it (it's rendered transparent.. but as a square instead of the texture). Example here (line 38 breaks it): http://www.babylonjs-playground.com/#1BAPRM#82 Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 12, 2016 Share Posted December 12, 2016 Hi @jpdev, this is rather interesting. I also tried changing the alpha value of the texture with no luck. You could, however use the opacity texture with the same texture you use for the diffuse texture. Then set the level of the opacity texture - http://www.babylonjs-playground.com/#1BAPRM#83 jpdev 1 Quote Link to comment Share on other sites More sharing options...
jpdev Posted December 12, 2016 Author Share Posted December 12, 2016 Thank you @RaananW I still wonder why it doesn't work with the obvious property or alpha within the texture - but your solution works very well. I used a texture with different alpha levels to check if there now is a gradient, and there is: http://www.babylonjs-playground.com/#1BAPRM#84 Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 12, 2016 Share Posted December 12, 2016 great! glad it works Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.