Re: Returning calculation results from pixel shader
- From: "Jayhawk" <thomas.greenleaf@xxxxxxxxx>
- Date: 23 Aug 2006 17:07:56 -0700
Why don't you create a R32F lockable RT-texture
(your gf6 card should allow that), render to
it, and get it's data back by calling
IDirect3DDevice9::GetRenderTargetData?
But I do... now ;-)
Thanks for the hint. I was not aware of the GetRenderTargetData. It
works just fine now.
If I may; I have a folow up on this. Perhaps I am misunderstanding the
graphicsStream.Read. Currently I am doing this for reading out data.
private void readResult(float[,] errorValues)
device.GetRenderTargetData(renderSurface, readSurface);
GraphicsStream gs = readTexture.LockRectangle(0, LockFlags.ReadOnly);
float[,] tmp = (float[,])gs.Read(typeof(float), new int[] { dataWidth,
dataHeight });
for (int x = 0; x < dataWidth; x++)
for (int y = 0; y < dataHeight; y++)
errorValues[x, y] = tmp[x, y];
It seems rather wastefull to have a loop like that to read data out.
Besides.. have the data not allready been moved once from the gpu to
systemmemory, and now I am moving them from system to system?
.
- Follow-Ups:
- Re: Returning calculation results from pixel shader
- From: Jan Bruns
- Re: Returning calculation results from pixel shader
- References:
- Returning calculation results from pixel shader
- From: Jayhawk
- Re: Returning calculation results from pixel shader
- From: Stephan Rose
- Re: Returning calculation results from pixel shader
- From: Jayhawk
- Re: Returning calculation results from pixel shader
- From: Jan Bruns
- Returning calculation results from pixel shader
- Prev by Date: Re: Shadow and fog
- Next by Date: Re: bmp alpha blending in DirectX9
- Previous by thread: Re: Returning calculation results from pixel shader
- Next by thread: Re: Returning calculation results from pixel shader
- Index(es):
Relevant Pages
|