Project Rembrandt: Difference between revisions

Line 68: Line 68:
You can also use a startup parameter: --prop:/sim/rendering/shadows/map-size=2048
You can also use a startup parameter: --prop:/sim/rendering/shadows/map-size=2048


=== Configurable pipeline ideas ===
=== Configurable pipeline ===
 
The Rembrandt renderer uses an XML file to setup its pipeline for each viewport described in the camera group. This file describes the way the intermediary buffers are setup and how the different rendering stages are sequenced. The general outline of a pipeline file is as follow :
 
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<!-- BUFFERS -->
<buffer>
<!-- First buffer definition -->
</buffer>
<buffer>
<!-- nth buffer definition -->
</buffer>
<!-- STAGES -->
<stage>
<!-- First stage definition -->
</stage>
<stage>
<!-- nth stage definition -->
</stage>
</PropertyList>
</syntaxhighlight>
 
A buffer is a texture used as a storage area in the GPU. It's size is usually a multiple of the screen size, but fixed size is supported (typical for shadow map). The description of a buffer is described below :
 
<syntaxhighlight lang="xml">
<buffer>
<name>buffer-name</name>
<internal-format>rgba8</internal-format> <!-- rgb8, rgba8, rgb16, rgba16, rg16, depth-component24, depth-component32 or OpenGL hex value -->
<source-format>rgba</source-format> <!-- rg, rgb, rgba, depth-component or OpenGL hex value -->
<source-type>unsigned-byte</source-type> <!-- unsigned-byte, unsigned-short, unsigned-int, float or OpenGL hex value -->
<width>screen</width> <!-- screen, value or <property>/a/width/property</property> -->
<height>screen</height> <!-- screen, value or <property>/a/height/property</property> -->
<scale-factor>1.0</scale-factor>
<wrap-mode>clamp-to-border</wrap-mode> <!-- clamp, clamp-to-border, clamp-to-edge, mirror, repeat or OpenGL hex value -->
<!-- optional, for shadow map -->
<shadow-comparison>true</shadow-comparison>
<!-- optional condition -->
<condition>
<!-- Valid boolean expression -->
</condition>
</buffer>
</syntaxhighlight>
 
A stage is an unit of rendering to a group of buffer. Most stages are predefined and their type is not free. When a type is not specified, the name is used. Stage types are :
{| class="wikitable"
!align="left"| Stage type
!align="left"| Purpose
|-
|geometry
|The geometry stage initialize most of the buffers and works on the real objects and geometry. Transparent objects are set aside and will be used untouched in the lighting stage. Other opaque geometry is rendered with the standard effects that do the hard work to put sensible data in the buffers.
|-
|shadow
|In this stage, the geometry is rendered in the normal map from the perspective of the sun.
|-
|lighting
|This stage uses the buffers filled by the previous stages to light every pixel of the scene. The result is rendered in another buffer to allow post effects.
|-
|fullscreen
|Stages of this type are used to alter the whole scene or transform data from a particular buffer.
|-
|display
|Final rendering of the scene to the screen or the texture defined in the camera group.
|}
 
<syntaxhighlight lang="xml">
<stage>
<name>stage-name</name>
<type>stage-type</type> <!-- optional if name is one of the predefined type except fullscreen -->
<order-num>1</order-num>
<effect>Effects/fullscreen-effect</effect> <!-- only if type == fullscreen -->
<needs-du-dv>true</needs-du-dv> <!-- only if type == fullscreen -->
<scale-factor>0.25</scale-factor> <!-- only if type == fullscreen -->
 
<!-- optional condition -->
<condition>
<!-- Valid boolean expression -->
</condition>
 
<attachment>
<!-- First attachment definition -->
</attachment>
<attachment>
<!-- Nth attachment definition -->
</attachment>
</stage>
</syntaxhighlight>


== Running Flightgear with Rembrandt ==
== Running Flightgear with Rembrandt ==
269

edits