Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
MatroxRT
Level 7

TextureManager + Alpha

Hi all,

Does anyone know if it's possible to enable the Alpha Channel for a PNG with the TextureManager? Or do we need to handle this case manually?

Thanks,
Matt
0 Kudos
4 Replies
MatroxRT
Level 7

Re: TextureManager + Alpha

So, I answered by own question, So I thought I would post my findings.

Alpha channels are supported through the TextureManager, that actually wasn't my problem. I was also experimenting with the Compositor at the same time. I switched to using an roScreen instead, and everything lit up, and the Alpha channel is being observed. I should have been more specific in my first post.

I don't need to use a Compositor for what I am trying to do, and I have not really used them outside of toy POC's. I know some folks live and die by them on this forum, but let's not strike up that holy war. Smiley Happy

So I have a couple more questions that it would be cool if someone had an answer, but it's not critical to what I am working on right now.

* Does the compositor have the ability to observe an Alpha Channel?

* In terms of the TextureManager, is Alpha just on by default? Is there a way to toggle it on /off?
* Does it really mater? If you disable Alpha on roScreen itself, then Alpha is not observed, So does that prevent the performance hit, because it is toggling the Channel off before it goes to do the actual draw?

Thanks,
Matt
0 Kudos
Roku Employee
Roku Employee

Re: TextureManager + Alpha

Not sure what you mean by "observe". The draw commands all allow you to use alpha (on non-legacy hardware) and if you draw to a region that belongs to a sprite, the sprite will update.

* Does it really mater? If you disable Alpha on roScreen itself, then Alpha is not observed, So does that prevent the performance hit, because it is toggling the Channel off before it goes to do the actual draw?


Yes, that should prevent the performance hit. With sprites the compositor.drawAll should honor the alpha settings for the regions that the sprites are based on.

- Joel
0 Kudos
MatroxRT
Level 7

Re: TextureManager + Alpha

Hi Joel, for the most part I think if you replaced observe with honor I think we are on the same page.

Not sure why it didn't click yesterday, but it did today after your hint. Thanks.
0 Kudos
Roku Employee
Roku Employee

Re: TextureManager + Alpha

"MatroxRT" wrote:
Hi Joel, for the most part I think if you replaced observe with honor I think we are on the same page.


Click! Now I understand what you meant.

- Joel
0 Kudos