Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Render To Texture using alpha?

瀏覽次數:14 次
跳到第一則未讀訊息

gameMaker

未讀,
2005年7月7日 下午3:42:032005/7/7
收件者:
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

未讀,
2005年7月8日 凌晨12:51:232005/7/8
收件者:
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

未讀,
2005年7月8日 中午12:00:052005/7/8
收件者:
Thanks Wessam, that did the trick! I thought blending with black would just
leave it as is, but now it makes sense.
0 則新訊息