Jump to content

  • Log In with Google      Sign In   
  • Create Account

Resizing primitives in vertex buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Big Muscle   Members   -  Reputation: 135

Like
0Likes
Like

Posted 14 March 2013 - 08:30 AM

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

Attached Thumbnails

  • rectangles.png


Sponsor:

#2 Yourself   Crossbones+   -  Reputation: 1133

Like
0Likes
Like

Posted 14 March 2013 - 12:20 PM

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.



#3 Jason Z   Crossbones+   -  Reputation: 5062

Like
0Likes
Like

Posted 15 March 2013 - 05:51 PM

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



#4 Big Muscle   Members   -  Reputation: 135

Like
0Likes
Like

Posted 17 March 2013 - 02:27 PM

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS