Compositor: Difference between revisions

Jump to navigation Jump to search
161 bytes added ,  8 November 2019
no edit summary
No edit summary
No edit summary
Line 238: Line 238:
=== Buffers ===
=== Buffers ===


A buffer represents a texture or, more generically, a region of GPU memory. It can have the following parameters:
A buffer represents a texture or, more generically, a region of GPU memory.


; name
{| class="wikitable" style="text-align: center; font-size: 85%; width: auto; table-layout: fixed;
: Passes will be able to address the buffer by this name.
! scope="col" | Parameter Name
; type
! scope="col" | Optional
: Any texture type allowed by OpenGL: 1d, 2d, 2d-array, 2d-multisample, 3d, rect or cubemap.
! scope="col" | Value
; width
! scope="col" | Default Value
: Texture width. It's possible to write 'screen' to use the physical viewport width.
! scope="col" | Description
; screen-width-scale (Optional)
|-
: If 'screen' was used, this controls the width scaling factor.
! scope="row"| <tt>name
; height
| {{No}}
: Texture height. It's possible to write 'screen' to use the physical viewport height.
| string
; screen-height-scale (Optional)
|
: If 'screen' was used, this controls the height scaling factor.
| Passes will be able to address the buffer by this name
; depth
|-
: Texture depth.
! scope="row"| <tt>type</tt>
; format
| {{No}}
: Specifies the texture format. It corresponds to the ''internalformat'', ''format'' and ''type'' arguments of the OpenGL function ''glTexImage2D''. See {{simgear file|simgear/scene/viewer/CompositorBuffer.cxx}} for the latest available values.
| <tt>1d, 2d, 2d-array, 2d-multisample, 3d, rect, cubemap</tt>
; min-filter and mag-filter (Optional)
|
: They change the minification and magnification filtering respectively. Possible values are: linear, linear-mipmap-linear, linear-mipmap-nearest, nearest, nearest-mipmap-linear and nearest-mipmap-nearest. The default value for both filters is linear.
| Any texture type allowed by OpenGL
; wrap-s, wrap-t and wrap-r (Optional)
|-
: They change the wrap mode for each coordinate. Possible values are: clamp, clamp-to-edge, clamp-to-border, repeat and mirror. The default value for every coordinate is clamp-to-border.
! scope="row"| <tt>width</tt>
; condition (Optional)
| {{No}}
: A valid boolean condition to enable the buffer at startup (doesn't work at runtime).
| Any unsigned integer or <tt>screen</tt> to use the physical viewport width
|
| Texture width
|-
! scope="row"| <tt>screen-width-scale</tt>
| {{Yes}}
| float
| <tt>1.0</tt>
| If <tt>screen</tt> was used, this controls the width scaling factor
|-
! scope="row"| <tt>height</tt>
| {{No}}
| Any unsigned integer or <tt>screen</tt> to use the physical viewport height
|
| Texture height
|-
! scope="row"| <tt>screen-height-scale</tt>
| {{Yes}}
| float
| <tt>1.0</tt>
| If <tt>screen</tt> was used, this controls the height scaling factor
|-
! scope="row"| <tt>depth</tt>
| {{No}}
| int
|
| Texture depth
|-
! scope="row"| <tt>format</tt>
| {{Yes}}
| See {{simgear file|simgear/scene/viewer/CompositorBuffer.cxx}} for the latest available values
| <tt>rgba8</tt>
| Specifies the texture format. It corresponds to the ''internalformat'', ''format'' and ''type'' arguments of the OpenGL function ''glTexImage2D''
|-
! scope="row"| <tt>min-filter, mag-filter</tt>
| {{Yes}}
| <tt>linear, linear-mipmap-linear, linear-mipmap-nearest, nearest, nearest-mipmap-linear, nearest-mipmap-nearest</tt>
| <tt>linear</tt>
| Change the minification and magnification filtering respectively
|-
! scope="row"| <tt>wrap-s, wrap-t, wrap-r</tt>
| {{Yes}}
| <tt>clamp, clamp-to-edge, clamp-to-border, repeat, mirror</tt>
| <tt>clamp-to-border</tt>
| They change the wrap mode for each coordinate
|}


A typical [[PropertyList XML File|property tree structure]] describing a buffer may be as follows:
A typical [[PropertyList XML File|property tree structure]] describing a buffer may be as follows:
Line 273: Line 318:
   <screen-width-scale>1.5</screen-width-scale>
   <screen-width-scale>1.5</screen-width-scale>
   <screen-height-scale>1.5</screen-height-scale>
   <screen-height-scale>1.5</screen-height-scale>
   <internal-format>rgba8</internal-format>
   <format>rgba8</format>
  <source-format>rgba</source-format>
  <source-type>ubyte</source-type>
  <min-filter>nearest-mipmap-nearest</min-filter>
  <mag-filter>nearest-mipmap-nearest</mag-filter>
  <wrap-s>repeat</wrap-s>
  <wrap-t>repeat</wrap-t>
</buffer>
</buffer>
</syntaxhighlight>
</syntaxhighlight>
343

edits

Navigation menu