This topic is 2328 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am trying to generate "bold" line... I have points creating a single line. My idea is to send those points via StructuredBuffer<float2> to GS and there "cook" triangles by calculating displaced vertices from line points
So far I have this done in pixel shader... i send line in structured buffer and than generate triangles and apply "point-in-triangle" test for every "screen-pixel" (i need only 2D case). It works nice... but performnace is of course poor (the longer line is, the slowest it is )

Idea is to generate triangles in GS and send them to PS. But VS is kind of obsolete... I dont need any output from it... and i dont even have any geometry to send in... how to handle this ?

I know, I can attach NULL vertex buffer and use SV_VertexID... but problem is still the same... i dont have any triangles yet, only line points. I can generate triangles in VS via this, with some "magic" if-ing (can generate only 1-triangle at time, not all of them at once like in GS).
What is better solution and how can it be done with only GS ?

##### Share on other sites
You can't avoid having a vertex shader stage, so just make it 'pass through' and do the work in the GS as you plan.

##### Share on other sites
So just generate for example one triangle with all vertices "0" ?

##### Share on other sites
Do you have two points per line, or is it variable?

##### Share on other sites
I have two points per line and "normal" vector at those points... I move [x1,y1] and [x2,y2] by +/- [z1,w1] and +/- [z2,w2] to get 4-vertices polygon (2 triangles respectively). I changed points every frame, as the line tracks movement (like trail behind snail )

1. 1
Rutin
67
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633418
• Total Posts
3011785
• ### Who's Online (See full list)

There are no registered users currently online

×