Graphics twitter, can anybody point me in the direction of generating the intersecting shape of two 2D shapes? I don't mean just detecting if two shapes intersect, but generating the intersection in the sense of constructive solid geometry.
-
Näytä tämä ketju
-
Vastauksena käyttäjälle @tloch14
What form are you looking to have the result in (is the result just visualization or data)? Are these convex polygons or curves?
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @m_ninepoints
I'm drawing the shapes on the gpu, so triangles. I currently don't have curves of any kind. polygonal shapes.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @tloch14
Can you just use the stencil buffer then with the increment operator to leverage the builtin rasterizer?
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
Vastauksena käyttäjälle @m_ninepoints
Unfortunately, I can't use stencil operations. I wish I could.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @tloch14
What about clearing alpha at the start and blending with a blend op that writes color only if alpha is set?
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
Vastauksena käyttäjälle @m_ninepoints
The problem with these kinds of operations in general is that is gets in the way of draw order. There is a feature in Vulkan and OpenGL|ES that I might be able to leverage (pixel local storage) to do this without changing my draw order, but I'm yet uncertain. Need to try it.
2 vastausta 0 uudelleentwiittausta 0 tykkäystä
regarding draw order, I'm not just drawing one of these intersecting shapes. I'm drawing many, and they are batched by material.
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.