Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualYura

Posted 20 February 2013 - 04:06 AM

 

There is no easy way to do this unless you marked the vertices to be expanded with a special vertex attribute.  Do you have access to the geometry before it gets loaded into the buffers?  If so, you should do that on your CPU before the data gets uploaded to the GPU.

 

Jason, do not leave me alone with this)

 

Sorry, I didn't see this post...

 

What I meant was that you could add another attribute to your vertex layout, which could indicate to your pipeline that a particular set of vertices needs to be expanded to be thicker.  This would be something like an integer value in your vertices that when it was 1 you would do the expansion, and when it was 0 you wouldn't.  That could be carried out in the GS, but would likely not be all that efficient.

 

I would recommend just doing this as a pre-processing step.  That way you can verify the results at design time, and not have to perform any inefficient rendering techniques at runtime.

 

What I did till now is just doubling vertices in plane figure, otherwords - added additional points. It seems to be not bad, BUT I must have a possibility to enable/disable thickness of plane figures during runtime. Using this method I must rewrite my vertexBuffer each time I call enable or disable thickness. Enable - rewrite with additional points, disable - rewrite "as is".  Other problem - if I have very big model and adding extra points to it, it is very hard then to build indexBuffer, becouse each element contain some vertices, wich are not sorted by phisical index, only by ID, so, it is hard to work with locked vertexBuffer, couse in that way I have an access only to phisical indexes of each vertex. If I'm adding extra points, their phisical index is shifted... 

I need some effective algorithm to do this "pre-processing step"..

 

Appriciate your help


#2Yura

Posted 20 February 2013 - 02:32 AM

 

There is no easy way to do this unless you marked the vertices to be expanded with a special vertex attribute.  Do you have access to the geometry before it gets loaded into the buffers?  If so, you should do that on your CPU before the data gets uploaded to the GPU.

 

Jason, do not leave me alone with this)

 

Sorry, I didn't see this post...

 

What I meant was that you could add another attribute to your vertex layout, which could indicate to your pipeline that a particular set of vertices needs to be expanded to be thicker.  This would be something like an integer value in your vertices that when it was 1 you would do the expansion, and when it was 0 you wouldn't.  That could be carried out in the GS, but would likely not be all that efficient.

 

I would recommend just doing this as a pre-processing step.  That way you can verify the results at design time, and not have to perform any inefficient rendering techniques at runtime.

 

What I did till now is just doubling vertices in plane figure, otherwords - added additional points. It seems to be not bad, BUT I must have a possibility to enable/disable thickness of plane figures during runtime. Using this method I must rewrite my vertexBuffer each time I call enable or disable thickness. Enable - rewrite with additional points, disable - rewrite "as is". 

I need some effective algorithm to do this "pre-processing step"..

 

Appriciate your help


#1Yura

Posted 20 February 2013 - 02:32 AM

 

There is no easy way to do this unless you marked the vertices to be expanded with a special vertex attribute.  Do you have access to the geometry before it gets loaded into the buffers?  If so, you should do that on your CPU before the data gets uploaded to the GPU.

 

Jason, do not leave me alone with this)

 

Sorry, I didn't see this post...

 

What I meant was that you could add another attribute to your vertex layout, which could indicate to your pipeline that a particular set of vertices needs to be expanded to be thicker.  This would be something like an integer value in your vertices that when it was 1 you would do the expansion, and when it was 0 you wouldn't.  That could be carried out in the GS, but would likely not be all that efficient.

 

I would recommend just doing this as a pre-processing step.  That way you can verify the results at design time, and not have to perform any inefficient rendering techniques at runtime.

 

What I did till now is just doubling vertices in plane figure, otherwords - added additional points. It seems to be not bad, BUT I must have a possibility to enable/disable thickness of plane figures during runtime. Using this method I must rewrite my vertexBuffer each time I call enable or disable thickness. Enable - rewrite with additional points, disable - rewrite "as is". 

I need some effective algorithm to do this "pre-processing step"..

 

Appricite your help


PARTNERS