PDA

View Full Version : Possible to stitch 2 meshes in geometry shader?



flowerfuneral
02-20-2011, 02:05 PM
Hello everyone,

Suppose I sent a triangle and a quad to the geometry shader, and then want to stitch the 2 together like in the picture. Also remove the dashed line in the picture. Is this possible? Thanks.

mobeen
02-21-2011, 12:29 AM
Yes it is possible.

YarUnderoaker
02-21-2011, 12:43 AM
Geometry shader designed for massive parallel per primitive operations. For such a purpose like yours, it's not very suitable istrument. If this is a single operation, it is better to doing it by CPU.

Yes it is possible.
Principle - yes.

flowerfuneral
02-21-2011, 09:21 PM
Geometry shader designed for massive parallel per primitive operations. For such a purpose like yours, it's not very suitable istrument. If this is a single operation, it is better to doing it by CPU.

Yes it is possible.
Principle - yes.

This is my concern since geometry shader can only see one triangle at a time so I'm really not sure on how to let it detect where the 2 meshes are crossed.

Alfonse Reinheart
02-21-2011, 09:32 PM
Without having really thought everything through, I would guess that, while it could be possible to do it in a geometry shader:

1: it wouldn't be possible for two arbitrary polygons.

2: it would probably not be worthwhile performance-wise.