Compositor: Difference between revisions

909 bytes added ,  8 November 2019
no edit summary
No edit summary
No edit summary
Line 250: Line 250:
! scope="col" | Description
! scope="col" | Description
|-
|-
! scope="row"| <tt>name
! scope="row"| <tt>name</tt>
| {{No}}
| {{No}}
| string
| string
Line 346: Line 346:
A pass wraps around an [http://public.vrac.iastate.edu/vancegroup/docs/OpenSceneGraphReferenceDocs-3.0/a00089.html osg::Camera]. Passes all have some common parameters:
A pass wraps around an [http://public.vrac.iastate.edu/vancegroup/docs/OpenSceneGraphReferenceDocs-3.0/a00089.html osg::Camera]. Passes all have some common parameters:


; clear-color, clear-accum, clear-depth and clear-stencil
{| class="wikitable" style="text-align: center; font-size: 85%; width: auto; table-layout: fixed;
: Default values are black, black, 1.0 and 0 respectively.
! scope="col" | Parameter Name
; clear-mask
! scope="col" | Optional
: Controls the camera clear mask. Default value is "color depth".
! scope="col" | Value
; effect-scheme
! scope="col" | Default Value
: The pass will try to use the specified effect scheme to draw every object.
! scope="col" | Description
; condition
|-
: A valid boolean condition to enable the pass at startup (doesn't work at runtime).
! scope="row"| <tt>clear-color, clear-accum, clear-depth and clear-stencil</tt>
| {{Yes}}
| vec4
| black, black, <tt>1.0</tt>, <tt>0</tt> respectively
| Pass clear colors
|-
! scope="row"| <tt>clear-mask</tt>
| {{Yes}}
| <tt>color, stencil, depth, accum</tt>
| <tt>color depth</tt>
| Pass clear mask
|-
! scope="row"| <tt>effect-scheme</tt>
| {{Yes}}
| Valid effect scheme name
| None
| The pass will try to use the specified effect scheme to draw every object.
|}


Passes can render to a buffer (Render to Texture), to several buffers (Multiple Render Targets) or directly to the framebuffer. This is accomplished by the <code><attachment/></code> tag. Possible parameters of an attachment are:
Passes can render to a buffer (Render to Texture), to several buffers (Multiple Render Targets) or directly to the framebuffer. This is accomplished by the <code><attachment/></code> tag. Possible parameters of an attachment are:


; buffer
{| class="wikitable" style="text-align: center; font-size: 85%; width: auto; table-layout: fixed;
: The name of the buffer to output to.
! scope="col" | Parameter Name
; component
! scope="col" | Optional
: FBO attachment point. Possible values are color0 to color15, depth, stencil and depth-stencil.
! scope="col" | Value
; level (Optional)
! scope="col" | Default Value
: Controls the mip map level of the texture that is attached. Default value is 0.
! scope="col" | Description
; face (Optional)
|-
: Controls the face of texture cube map or z level of 3d texture. Default value is 0.
! scope="row"| <tt>buffer</tt>
; mipmap-generation (Optional)
| {{No}}
: Controls whether mipmap generation should be done for texture. Default value is false.
| Valid buffer name
; multisample-samples (Optional)
|
: MSAA samples. Default value is 0.
| The name of the buffer to output to
; multisample-color-samples (Optional)
|-
: MSAA color samples. Default value is 0.
! scope="row"| <tt>component</tt>
; condition
| {{No}}
: A valid boolean condition to enable the attachment at startup (doesn't work at runtime).
| <tt>color0</tt> to <tt>color15, depth, stencil, depth-stencil</tt>
|
| FBO attachment point
|-
! scope="row"| <tt>level</tt>
| {{Yes}}
| int
| <tt>0</tt>
| Mipmap level of the texture that is attached
|-
! scope="row"| <tt>face</tt>
| {{Yes}}
| int
| <tt>0</tt>
| Face of cube map texture or z-level of 3d texture
|-
! scope="row"| <tt>mipmap-generation</tt>
| {{Yes}}
| bool
| <tt>false</tt>
| Whether mipmap generation should be done for texture
|-
! scope="row"| <tt>multisample-samples</tt>
| {{Yes}}
| int
| <tt>0</tt>
| Multisample anti-aliasing (MSAA) samples
|-
! scope="row"| <tt>multisample-color-samples</tt>
| {{Yes}}
| int
| <tt>0</tt>
| Multisample anti-aliasing (MSAA) color samples
|}


Passes can also receive buffers as input and use them in their shaders. This is accomplished by the <code><binding/></code> tag, which has the following parameters:
Passes can also receive buffers as input and use them in their shaders. This is accomplished by the <code><binding/></code> tag, which has the following parameters:


; buffer
{| class="wikitable" style="text-align: center; font-size: 85%; width: auto; table-layout: fixed;
: The name of the buffer to bind.
! scope="col" | Parameter Name
; unit
! scope="col" | Optional
: The texture unit to place the texture on. Effects will be able to access the buffer on this texture unit.
! scope="col" | Value
; condition
! scope="col" | Default Value
: A valid boolean condition to enable the binding at startup (doesn't work at runtime).
! scope="col" | Description
|-
! scope="row"| <tt>buffer</tt>
| {{No}}
| Valid buffer name
|
| The name of the buffer to bind
|-
! scope="row"| <tt>unit</tt>
| {{No}}
| int
|
| The texture unit to place the texture on. Effects will be able to access the buffer on this texture unit
|}


There are specific pass types, each with their own set of custom parameters:
There are specific pass types, each with their own set of custom parameters:
342

edits