It gets difficult to do things within the pixel shader that I want to do for the user, while letting them customize some parts. Take vector graphics.
-
-
Näytä tämä ketju
-
If I want to fill a cubic bezier interior of a triangle, but let the user provide a pixel shader that determines how to fill it, the user also has to futs with the cubic curve determination in their pixel shader.
Näytä tämä ketju -
If I could set it up where the first pass returned float4(1,1,1,a) where a is an anti-aliased determination of how “in” the curve this pixel is, then the user can provide a fragment pass that does other crazy stuff.
Näytä tämä ketju -
You could even make it so that if an earlier fragment pass discarded the pixel, it would not run that pixels in the next pass.
Näytä tämä ketju -
To do this today, I can only think of drawing to an offscreen FBO as a mask, then reading that mask in on a later draw.
Näytä tämä ketju -
But then you’d want to batch tons of these mask calls into a single FBO. Figuring out where to put them on the target texture gets tricky, especially if your vector is in 3D and viewed at a glancing angle.
Näytä tämä ketju -
Also useful for multi pass materials? Instead of redrawing the model, you’d just make another run of a new pixel stage. The benefit is that it’s not committed to the render target till all fragment passes are complete.
Näytä tämä ketju
Keskustelun loppu
Uusi keskustelu -
-
-
Would transform feedback do?
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
-
-
Have you looked into Vulkan sub-renderpasses? From an outsider perspective, they sound a bit like what you're describing.
-
subpasses (to my knowledge) still run sets of vertex and fragment. I don't want {[v, f], [v, f], ...}. I want { [v, f0, f1, f2, ...], ...}. The key being that the fragment shaders would have blend operations on to determine their blending.
- Näytä vastaukset
Uusi keskustelu -
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.