3.3. The rendering pipelines

../_images/pipelines.png

The rendering pipelines

All elements are accessible through the application

BREP generates a scene with triangles or other shapes.. (with more info) Tetmesh, generates tetrahedra, that are available as a scene with tetrahedra. Rasters, from renderers, can appear as Raster objects

3.3.1. 2D rendering pipeline

asdfasfd

3.3.2. 3D rendering pipeline

ssfdgfdsg

3.3.3. Anableps renderers

Anableps comes with a variety of renderers. Each renderer has different features. Depending on the renderer, shadows can be present or not at all, there can be different lighting, etc. Bear in mind that each render has a different goal when rendering an scene, and that not two renderers will display the same details: describing the features of each one is the purpose of this chapter.

First, it’s important to understand that there are two families of renderers, depending on the final image produced:

  • Vectorial renderers: whose output are lines, points, and areas. Displaying those lines in a screen will convert them into pixels, but the info in the file is of lines and do not contain any information about resolution. See the previous chapter about vectorial vs raster formats.
  • Raster renderers: raster renderers are inherently pixel oriented. the produce a matrix of pixels that form the image. Images have resolution, and zooming them enough will reveal the pixels. Examples of raster renderers is Open-gl, among others.

Regarding the algorithms, there are two general approaches to rendering:

  • solid-display: can produce raster or vectorial 2d pictures out of an scene. It’s normally not as photorealistic as ray-tracing can be, but can incorporate a good deal of lighting, texture and color.
  • Ray-tracing: is a inherently raster technique (i.e, produces a grid of pixels) that works by following light rays inversely, from the eye to the objects (instead from objects to the eye) painting each pixel according to which surfaces that ray intersects.

Anableps has several renders both ray-traced and solid, raster and vectorial, that can be used for different purposes.

3.3.3.1. Vector Renderer

This is a renderer that produces lines, shapes, points and text, using the standar BREP pipeline (see ref1, ref2). Let’s see a simple example:

scene s: .loremipsum cubes
VectorRenderer r:  # we explicitly create a renderer and set
                   # its parameters
r.mode = wireframe
r.render s: .filename myPicture.svg

This renderer can work in four different styles, set with .style:

  • wireframe: displays all the objects as wireframes.
  • solidwhite: displays all the objects solid but without texture.
  • celshading: displays solid plus outline.
  • stipplehatching: changes shadowing by stippling or hatching.

3.3.3.1.1. Coloring, stippling and hatching

blah blah

3.3.3.1.2. Shadows

Shadows can be switched on of with the .shadows switch. Obviously, in Vectorial rendering, shadows are sharp

Shadows can be suppressed on an object or group basis::
cube c: .shadow no

3.3.3.2. OpenGL Render

This a raster render that produces directly pixel images. If you are not familiar with OpenGL and want to use this renderer, may be you want to revise some basic documentation like here and here.

Anableps comes with a default shader.

3.3.3.2.1. parameters

  • shader: the name of the shader used. It can be read from a file.

RasterRender –————–

This is a raster render that produces directly pixels from an scene. It uses phong shadowing, that is, coloring each pixel according with light

3.3.3.3. StereographicRenderer

This is an special render that produces two images of the same scene, some distance apart so, when they are seen together, the impression of depth is conveyed. It has two styles, according with the method used to create those images:

renderer:a parameter that specifies which render to use for each image. Obviously, the value cannot be stereo
style:one of pair, color. Pair generates two images side-to-side. Color generates an image with two colors. this works only with wireframe,
inverted:this makes to generate an inverted pair (for eyes crossing) or colors inverted
colors:allows specifying which two colors are needed. Used only if style=color .

(figure with an example)

3.3.3.4. Raytracer renderer