开发者

Darkening part of a surface in Direct3D 9

开发者 https://www.devze.com 2023-02-01 07:37 出处:网络
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 multipli

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

精彩评论

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