v0.10.0: offscreen render targets + custom fragment shaders
Adds two new surfaces for downstream post-processing pipelines (cinder-cantata v0.3 bloom is the immediate consumer):
- Render targets — make-render-target / render-target? / render-target-width / render-target-height / render-target-free! / render-target->texture / draw-render-target / with-render-target macro. Each render target wraps a sokolgfx color image + paired depth-stencil image (required for sgp pipeline-validation compatibility with the swap chain) and exposes a texture view + sampler for sample-time use. with-render-target uses dynamic-wind so the offscreen pass closes cleanly on non-local exit. - Custom fragment shaders — load-shader / shader? / shader-free! / set-shader-uniform / with-shader macro. Auto-uniforms utime (seconds since gfx-setup, monotonic) and uresolution (current viewport size) are populated on every shader-bound draw without caller setup; caller-set uniforms persist across frames. Implementation builds a NATIVE-layout uniform block at fragment stage slot 1 to match sgpsetuniform's SGPUNIFORMSLOTFRAGMENT path; sampler2D uniforms use sgp's channel-0 binding. - y-flip on draw-render-target's textured-rect composite (sokolgfx writes offscreen RTs in GL bottom-up convention; the composite inverts the V range so the scene appears upright on the swap chain). - slogfunc installed as sg_setup logger so sokol validation failures print a diagnostic before the abort.
The existing public surface (set-color, draw-*, with-additive-blend, transform stack, textures) is unchanged — additive only.
Tested via three smoke tests under test/ (test-render-target, test-shader, test-postprocess-demo) plus an end-to-end audit of cinder-cantata running through a one-pass bloom shader on its present pass.
package.sgl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)package.sglmodified
(package name: "sigil-graphics" version: "0.9.3" version: "0.10.0" sigil: "^0.14" description: "2D graphics, image loading, and font rendering for Sigil" url: "https://codeberg.org/sigil/sigil-graphics"