Resizing primitives in vertex buffer

Started by
2 comments, last by Big Muscle 11 years, 1 month ago

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 :-)

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.

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...

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).

This topic is closed to new replies.

Advertisement