• Advertisement
Sign in to follow this  

Resizing primitives in vertex buffer

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

Hello,

 

maybe I have a little non-standard request as I am developing a little bit non-standard application.

 

My library receives ID3D10Device1 before the content is rendered. I can get vertex buffer from this device via device->IAGetVertexBuffers which contains individual vertices. I know that the topology is triangle strip.

 

Now I need to enlarge the edges of the rendered primitive. The primitives are mostly the rectangles (4), rectangles with rectangle hole (10 or 22) or rectangles with rounded corners (34). The brackets contain known vertex count for each primitive. I know I can simply do if(vertexCount==4)  ... else.. and modify the original vertices but I would like to find more general solution.

 

The attached images show 2 possibilities of what I would like to do - black rectangles are the original one, red rectangles are what I want to achieve. Just any primitive will be resized that it covers some more pixels at each edge.

 

I hope it is understandable :-)

Share this post


Link to post
Share on other sites
Advertisement

ou could create a matrix and tranform each vertex (but that would mean your buffers have to have the staging flag set).

but simpler would be to just adjust the world matrix of each object.

Share this post


Link to post
Share on other sites

Do you know the vertex layout for the vertex buffer data?  Also, do you know which draw call will be used?  Both of these will influence how you interact with the data in the buffer, so it is important to ensure that you can know what these two items are doing...

Share this post


Link to post
Share on other sites

Yeah, vertex layout is known. Draw is classic device->Draw. I have no problem to modify the vertex buffer. The only problem is how to correctly and fastly compute the new coordinates (the request is to add 8 pixels to each edge of rendered primitive).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement