I want a GPU feature that lets me do multiple pixel shader passes with a single vertex shader. Each pass would get blended together. The goal being composable pixel shaders.
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.
-
-
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 -
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.