Sign in to follow this  

[solved][dx10] Who could point to some R2VB samples?

This topic is 3728 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

Hi, att, a rendertarget wants to be a pointlist, who could help him? thanks for pointers/references to any sample codes or function hints! //bow [Edited by - yk_cadcg on October 8, 2007 1:20:59 AM]

Share this post


Link to post
Share on other sites
You could use stream out. But if you want to use the output of a pixel shader I guess you could declare the resource as D3D10_BIND_VERTEX_BUFFER and D3D10_BIND_RENDER_TARGET and handle it with different views. You probably need to declare it as a TYPELESS format.

[edit] Another thing that might work is to have two resources one texture and one vertex buffer. First render to the the texture and then copy its contents to the buffer with ID3D10Device::CopyResource.

Share this post


Link to post
Share on other sites
Thanks! but below don't work:

//texS1: int2
D3D10_TEXTURE2D_DESC descTexS1;
descTexS1.Width = _winW;
descTexS1.Height = _winH;
descTexS1.MipLevels = 1;
descTexS1.ArraySize = 1;
descTexS1.SampleDesc.Count = 1;
descTexS1.SampleDesc.Quality = 0;
descTexS1.MiscFlags = 0;
descTexS1.Format = DXGI_FORMAT_R32G32_TYPELESS; //SINT;
descTexS1.Usage = D3D10_USAGE_DEFAULT;
descTexS1.BindFlags = D3D10_BIND_RENDER_TARGET| D3D10_BIND_VERTEX_BUFFER;
descTexS1.CPUAccessFlags = 0;
V(g_pd3dDevice->CreateTexture2D(&descTexS1, NULL, &pTexS1));

Only if i remove D3D10_BIND_VERTEX_BUFFER. Thanks.

Quote:
Original post by 51mon
You could use stream out. But if you want to use the output of a pixel shader I guess you could declare the resource as D3D10_BIND_VERTEX_BUFFER and D3D10_BIND_RENDER_TARGET and handle it with different views. You probably need to declare it as a TYPELESS format.

[edit] Another thing that might work is to have two resources one texture and one vertex buffer. First render to the the texture and then copy its contents to the buffer with ID3D10Device::CopyResource.


Share this post


Link to post
Share on other sites
Thanks Demirug!
i can't create Buffer and render to it, since I need pingpong rendering it with another texture. it's a workflow.
Thus i have to copy the texture into vertex.
The slides "Everything about particle effects" at GDC07: http://www.2ld.de/gdc2007/EverythingAboutParticleEffectsSlides.pdf
Page 21 says we can copy texture to vertex buffer under DX10, I'm just needing it.
But CopyResource can't do it, do you know what func could do that? Thanks a lot!

Quote:
Original post by Demirug
CopyResource does not work with different resource types.


Share this post


Link to post
Share on other sites
I can think of one thing that will work if nothing else do. If the texture / buffer is less than 1024 in size you could stream it out manually in one invocation of GS. But there might be faster to create a vertex buffer containing nothing more than uv's, the complete set of the texture. Then you stream out the data into the buffer by using vertex texturing. In the second method you don't use any GS.

Share this post


Link to post
Share on other sites
thanks! i'm trying to draw pointlist without buffer at all, gen tex coord by VertexID. seems not working currently, debugging.
Quote:
Original post by 51mon
I can think of one thing that will work if nothing else do. If the texture / buffer is less than 1024 in size you could stream it out manually in one invocation of GS. But there might be faster to create a vertex buffer containing nothing more than uv's, the complete set of the texture. Then you stream out the data into the buffer by using vertex texturing. In the second method you don't use any GS.


Share this post


Link to post
Share on other sites

This topic is 3728 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this