From c40a1238f24534b5f433308d92308e1481464141 Mon Sep 17 00:00:00 2001 From: rodri Date: Wed, 24 Apr 2024 12:36:41 +0000 Subject: doc: add some schematics about the overall architecture. --- doc/libgraphics.ms | 175 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 147 insertions(+), 28 deletions(-) (limited to 'doc/libgraphics.ms') diff --git a/doc/libgraphics.ms b/doc/libgraphics.ms index 87a23a7..31a44af 100644 --- a/doc/libgraphics.ms +++ b/doc/libgraphics.ms @@ -2,33 +2,152 @@ libgraphics .AU Rodrigo G. López -.sp rgl@antares-labs.eu -.AI -Antares Telecom Laboratories -Albatera, Alicante -.FS -ACHTUNG! this is a -.B "WORK IN PROGRESS" -.FE -.NH 1 -Data Structures -.NH 2 -Camera -.P1 -struct Camera { - RFrame3; /* VCS */ - Image *viewport; - double fov; /* vertical FOV */ - struct { - double n, f; /* near and far clipping planes */ - } clip; - Projection ptype; - Matrix3 proj; /* VCS to viewport xform */ -}; -.P2 +.AB +To be determined. +.AE +.SH +Rendering graph .PP -A camera is an image capturing entity, analog to the real world device -we all know, that allows us to see the virtual 3-D world by projecting -it into a viewport we can attach to a screen or window for real-time -visualization or write out into a file. +.PS +.ps 7 +circlerad = 0.3 +moveht = 0.1 +box "Renderjob" +arrow +R: circle "renderer" +arrow +E: circle "entityproc" +move +Tiler: [ + down + T0: circle "tiler 0" + move + T1: circle "tiler 1" + move + Td: circle "…" + move + Tn: circle "tiler n" +] +move +Raster: [ + down + R0: circle "rasterizer 0" + move + R1: circle "rasterizer 1" + move + Rd: circle "…" + move + Rn: circle "rasterizer n" +] +arrow from E to Tiler.T0 chop +arrow from E to Tiler.T1 chop +arrow from E to Tiler.Td chop +arrow from E to Tiler.Tn chop +arrow from Tiler.T0 to Raster.R0 chop +arrow from Tiler.T0 to Raster.R1 chop +arrow from Tiler.T0 to Raster.Rd chop +arrow from Tiler.T0 to Raster.Rn chop +arrow from Tiler.T1 to Raster.R0 chop +arrow from Tiler.T1 to Raster.R1 chop +arrow from Tiler.T1 to Raster.Rd chop +arrow from Tiler.T1 to Raster.Rn chop +.ps 10 +.PE +.B "Figure 1" : +For a +.B 2(n+1) +processor machine. +.SH +The scene +.PP +.PS +.ps 7 +boxwid = 0.5 +boxht = 0.2 +linewid = 0.1 +lineht = 0.2 +box "Scene" +down; line from last box.s; right; line +box "Entity" +down; line from last box.s; right; line +box "Model" +down; line from last box.s; right; line +box "Mesh" +down; line from last box.s; right; line +box "Primitive" +down +line from 2nd last line.s; line; right; line +box "Material" +.ps 10 +.PE +.SH +Tile-based rendering +.PP +.PS +.ps 7 +Tiles: [ + boxht = 0.2 + boxwid = 1.25 + down + T0: box dashed "tile 0" + T1: box dashed "tile 1" + Td: box dashed "…" + Tn: box dashed "tile n" +] +box ht last [].ht+0.1 wid last [].wid+0.1 at last [] +"Screen" rjust with .se at last [].nw - (0.1,0) +Raster: [ + moveht = 0.1 + down + R0: circle "rasterizer 0" + move + R1: circle "rasterizer 1" + move + Rd: circle "…" + move + Rn: circle "rasterizer n" +] with .w at Tiles.e + (0.5,0) +line from Tiles.T0.e to Raster.R0.w +line from Tiles.T1.e to Raster.R1.w +line from Tiles.Td.e to Raster.Rd.w +line from Tiles.Tn.e to Raster.Rn.w +.ps 10 +.PE +.B "Figure 2" : +Per tile rasterizers. +.PS +.ps 7 +Tiles: [ + boxht = 0.2 + boxwid = 1.25 + down + T0: box dashed "0" + T1: box dashed "1" + Td: box dashed "…" + Tn: box dashed "n" +] +line from last [].w + (0.1,-0.05) to last [].n - (-0.1,0.25) +line to last [].se - (0.3,-0.1) +line to 1st line +box ht last [].ht+0.1 wid last [].wid+0.1 at last [] +"Screen" rjust with .se at last [].nw - (0.1,0) +Raster: [ + moveht = 0.1 + down + R0: circle "rasterizer 0" + move + R1: circle "rasterizer 1" + move + Rd: circle "…" + move + Rn: circle "rasterizer n" +] with .w at Tiles.e + (0.5,0) +arrow dashed from Tiles.T0.e to Raster.R0.w +arrow from Tiles.T1.e to Raster.R1.w +arrow from Tiles.Td.e to Raster.Rd.w +arrow from Tiles.Tn.e to Raster.Rn.w +.ps 10 +.PE +.B "Figure 3" : +Raster task scheduling. -- cgit v1.2.3