diff options
author | rodri <rgl@antares-labs.eu> | 2024-08-10 17:57:02 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-08-10 17:57:02 +0000 |
commit | d3b48593b0fee862ea60687336031fd9374ab667 (patch) | |
tree | 7810bcb85cbba3beee05e89b911c35f1d8e1b769 /graphics.h | |
parent | 6eab9793d68feb3282714083b355d38c6c36400b (diff) | |
download | libgraphics-d3b48593b0fee862ea60687336031fd9374ab667.tar.gz libgraphics-d3b48593b0fee862ea60687336031fd9374ab667.tar.bz2 libgraphics-d3b48593b0fee862ea60687336031fd9374ab667.zip |
experimental A-buffer implementation.
very simple, without anti-aliasing, made for getting
OIT (order independent transparency) rendering of
arbitrary objects.
also added switches for blending, depth testing and the
A-buffer to the camera.
Diffstat (limited to 'graphics.h')
-rw-r--r-- | graphics.h | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -54,6 +54,9 @@ typedef struct Shadertab Shadertab; typedef struct Renderer Renderer; typedef struct Rendertime Rendertime; typedef struct Renderjob Renderjob; +typedef struct Fragment Fragment; +typedef struct Astk Astk; +typedef struct Abuf Abuf; typedef struct Framebuf Framebuf; typedef struct Framebufctl Framebufctl; typedef struct Viewport Viewport; @@ -246,11 +249,34 @@ struct Renderjob Renderjob *next; }; +struct Fragment +{ + Color c; + float z; +}; + +struct Astk +{ + Point p; + Fragment *items; + ulong size; + int active; +}; + +struct Abuf +{ + QLock; + Astk *stk; /* framebuffer fragment stacks */ + Astk **act; /* active fragment stacks */ + ulong nact; +}; + struct Framebuf { ulong *cb; /* color buffer */ float *zb; /* z/depth buffer */ ulong *nb; /* normals buffer (DBG only) */ + Abuf abuf; /* A-buffer */ Rectangle r; }; @@ -300,6 +326,9 @@ struct Camera Matrix3 proj; /* VCS to clip space xform */ Projection projtype; int cullmode; + int enableblend; + int enabledepth; + int enableAbuff; struct { uvlong min, avg, max, acc, n, v; |