Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Fallout2man

Some Help with D3DPOOL and updating textures/surfaces

This topic is 5227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

One of the problems I've been trying to think of a solution around is a problem some of DX9's additions cause. DX9's methods for copying from texture to texture and surface to surface require the source and destination to be created with specific, different, D3DPOOL types, this is a big problem for when you're trying to make a 2D engine that can do transparent blits to and from multiple textures in a hierarchy, as with the default method I'm unable to do something such as the following mockup.
texture1--\                     |
texture2---sub master texture 1-|
texture3--/                     |
                                |--Master Texture---The Screen
texture4--\                     |
texture5---sub master texture 2-|
texture6--/
Has anyone figured out a way of working around the D3DPOOL restrictions or found another way I could do a transparent copy of texture data (without reverting to DX8 or earlier ). I'd be very grafeful for any assistance. [edited by - Fallout2man on February 29, 2004 6:18:35 AM]

Share this post


Link to post
Share on other sites
Advertisement
Have you looked at StretchRect? I don''t think it takes alpha values into account but it might help you out.

You could always use shaders to do this. First, you''d need to set the render target to be the texture you want to write to. Then render a screen aligned quad and use shaders to blend textures however you want.

neneboricua

Share this post


Link to post
Share on other sites
quote:
Original post by neneboricua19
Have you looked at StretchRect? I don''t think it takes alpha values into account but it might help you out.

You could always use shaders to do this. First, you''d need to set the render target to be the texture you want to write to. Then render a screen aligned quad and use shaders to blend textures however you want.

neneboricua


I was hoping to avoid shaders (so that the game would be playable on lesser rigs without the latest graphics cards), however I''ll take that into consideration, thanks a lot ^_^

Share this post


Link to post
Share on other sites
Try creating your sub-master and master textures as POOL_DEFAULT and USAGE_RENDERTARGET, if the card supports it. Then, use the ID3DXRenderToSurface to draw each sub-master texture, and again to draw each master texture. You could use just draw quads, or use ID3DXSprite, but you''ll need to use the 3D pipe if you want alpha blending.

xyzzy

Share this post


Link to post
Share on other sites
quote:
Original post by xyzzy00
Try creating your sub-master and master textures as POOL_DEFAULT and USAGE_RENDERTARGET, if the card supports it. Then, use the ID3DXRenderToSurface to draw each sub-master texture, and again to draw each master texture. You could use just draw quads, or use ID3DXSprite, but you''ll need to use the 3D pipe if you want alpha blending.

xyzzy


I can''t use ID3DXSprite, I read up about the problems it has with sizing, so I''ve been working on a custom solution thanks to the helpful info provided here. Thanks for the info.

Share this post


Link to post
Share on other sites
quote:
Original post by neneboricua19
Have you looked at StretchRect? I don''t think it takes alpha values into account but it might help you out.

StretchRect requires 8.x+ drivers, has hairy restrictions (see: IDirect3DDevice9::StretchRect), and it has no reference implmentation

quote:
I can''t use ID3DXSprite, I read up about the problems it has with sizing, so I''ve been working on a custom solution thanks to the helpful info provided here. Thanks for the info.

If you''re referring to the article on GDNet that says there''s a bug in ID3DXSprite, and that there''s a bug in windows and MSDN docs regarding RECTS, well...that article''s wrong

Muhammad Haggag

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!