开发者

Darkening part of a surface in Direct3D 9

In Direct3D 9, I'm trying to modify a surface thus:

Given a rectangle, for each of the pixels in the given surface within the rectangle's bounds, each of the channels (R, G, B, A) would be multiplied by a certain (float) value to either开发者_C百科 dim or brighten it.

How would I go about doing this? Preferably I want to avoid using LockRect (especially as it seems to not work with the default pool).


If you are wanting to update a Surfaces pixels directly, you can use "Device.UpdateTexture". This updates a Texture created in Pool.SystemMemory to a Texture created in Pool.Default.

But this doesn't sound like what you want to be doing. Use an Effect to hardware accelerate this. If you would like to know how I can show you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜