stream output to vertex buffer (not working as it should)

Started by
13 comments, last by lomateron 12 years, 2 months ago
The stream output captures the triangles, not the vertices. Since the draw call emits 12 vertices and the vertex buffer bound to the stream output has only room for 4 we get an overflow. When looking at the index buffer we see that the first four vertices are: 0,1,2,0. More isn’t written. This matches with my observations with PIX. Vertex 3 became equal to vertex 0, when using pointlists.

If the index buffer would start with 0,1,2,3,… then it would be a hack, but it would be fine, except:
The stream output only writes, if the primitive fits into the available space, so the second triangle starting with 3,… would never be written, because there is no room for the remaining two vertices.
Well, but if you make your vertex buffer bigger, by extending it with two dummy vertices (which are never used for rendering and only receive two vertices from the stream output we already know), everything works as it should.

It is a little hack though. smile.png
So adapt your index buffer to start with 0,1,2,3 and add two more vertices to your vertex buffer.

Cheers!
Advertisement
skills!!!
ohhhh shiii that thing was in front of my face look
http://msdn.microsoft.com/en-us/library/windows/desktop/bb509661%28v=vs.85%29.aspx

so by default it is returning the triangle stream because i am compiling the vertex shader intead of the geometry, so i have to make a geometry shader and define to return a pointStream, and because i will most likely use the geometry shader in the future, i am gona put it there, doing nothing for now.

damm i tried and now at the end rendered image is drawing points, but its working! but its drawing points hahaha. It didnt matter if i put
g_pd3dDevice->IASetPrimitiveTopology( D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST );
before drawing.
So finally i am gona go for the way you told me, its working too! thanks!
.
Damn Directx is to limited. No

I have stream out working fine using dx10 Irender a point list to a buffer of a skinned mesh then to shadows and colur render with the streamed out VB works fine.
I think there is a sample in the sdk stream out skinning or something like that.
Also try looking at you index buffer it will need to be same as the original Indexbuffer.
.

This topic is closed to new replies.

Advertisement