Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Render To Texture using alpha?

14 views
Skip to first unread message

gameMaker

unread,
Jul 7, 2005, 3:42:03 PM7/7/05
to
Here is what I do:

First, I clear my destination texture surface to all zeros. Then, I render
a texture with alpha in the texture to this destination texture (A8R8B8G8).
Then, I put this destination texture onto a quad and clear the back buffer to
blue and render it to the back buffer (X8R8B8G8).

The problem is that the alpha in the texture appears darker than it should
be. If I do not render to texture but instead just render my quad to the
back buffer, the alpha looks correct.

Is there something I am not understanding about rendering to a texture and
preserving the alpha? Shouldn't the alpha stay exactly the same if I am
rendering it to an all black texture destination?

Thanks!

Wessam Bahnassi

unread,
Jul 8, 2005, 12:51:23 AM7/8/05
to
Revise the math for the color operation you want. You might notice that
you're blending the colors with alpha twice, which can darken them...

Wessam Bahnassi
Microsoft DirectX MVP,
Lead Programmer
In|Framez

"gameMaker" <game...@discussions.microsoft.com> wrote in message
news:C9AF079D-B662-4B91...@microsoft.com...

gameMaker

unread,
Jul 8, 2005, 12:00:05 PM7/8/05
to
Thanks Wessam, that did the trick! I thought blending with black would just
leave it as is, but now it makes sense.
0 new messages