Skip to main content
gamedev.net
🔒 Locked

GetRenderTargetData

Started by hl1202 Mar 17, 2011 at 2:47 AM 1 replies 1.5k views
Original Post
hl1202
hl1202
Okie, my last question didn't receive any answer. Because my current problem cannot be solved, i have to find another way to continue with my project. Unfortunately another problem's come up

Here the question:

1, I have a array of Textures which were created through Render Target named iTexture[250]

+ Of course the setting for these textures is D3DPOOL_DEFAULT

2, I want to change these Texture to another Location or D3DPOOL_SYSTEMMEM

The only way i've heard of is Using GetRenderTargetData, and this process is heavy. But actually i don't know how to do the process.

So:

- Besides using GetRenderTargetData. Is there any way to my problem of Changing (copying, transfering...) from D3DPOOL_DEFAULT to D3DPOOL_SYSTEMMEM

- Can someone give me the outline of the process of using GetRenderTargetData

Thanks alot
21st Century Moose
21st Century Moose
Create a batch of D3DPOOL_SYSTEMMEM textures, loop through each batch, use GetSurfaceLevel on each, then D3DXLoadSurfaceFromSurface them. It's not going to perform well though.

It sounds to me as though you have some very specific problem you want to solve and this is the way you've decided that you're going to solve it. I've looked at your last post and that is also the same; you're saying what you want to do, but not why you want to do it. If you could elaborate more on the actual reason why you want to do this, it may be the case that there is a better way.
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls. 
hl1202
hl1202

Create a batch of D3DPOOL_SYSTEMMEM textures, loop through each batch, use GetSurfaceLevel on each, then D3DXLoadSurfaceFromSurface them. It's not going to perform well though.

It sounds to me as though you have some very specific problem you want to solve and this is the way you've decided that you're going to solve it. I've looked at your last post and that is also the same; you're saying what you want to do, but not why you want to do it. If you could elaborate more on the actual reason why you want to do this, it may be the case that there is a better way.


Thanks for the advice.

I manage to solve my Problem using GetRenderTargetData. However, like you said, the performance is terrible.

Actually i want to calculate a Subtraction between a texture A with each Texture of an Array of Textures B (Pixel by pixel). After that i have to add these pixel-by-pixel-subtractions into Array C.
And of course, this should be done by Shader, which is a bit hard for me.

If you have any better idea, please let me know.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.