Compositor: Difference between revisions

1,142 bytes added ,  2 January 2019
no edit summary
No edit summary
Line 128: Line 128:
A pass wraps around an [http://public.vrac.iastate.edu/vancegroup/docs/OpenSceneGraphReferenceDocs-3.0/a00089.html osg::Camera]. The following types of passes are supported:
A pass wraps around an [http://public.vrac.iastate.edu/vancegroup/docs/OpenSceneGraphReferenceDocs-3.0/a00089.html osg::Camera]. The following types of passes are supported:


; '''shadow-map'''
; scene
: Renders the scene from the point of view given by the CameraGroup.
; shadow-map
: Renders the scene from a light's point of view.
: Renders the scene from a light's point of view.
; '''scene'''
; quad
: Renders the scene from the point of view given by the CameraGroup.
; '''quad'''
: Renders a fullscreen quad with an optional [[Effects|effect]] applied. Useful for screen space shaders (like SSAO, Screen Space Reflections or bloom) and deferred rendering.
: Renders a fullscreen quad with an optional [[Effects|effect]] applied. Useful for screen space shaders (like SSAO, Screen Space Reflections or bloom) and deferred rendering.


Passes can render to a buffer (Render to Texture), to several buffers (Multiple Render Targets) or directly to the framebuffer. This allows chaining of multiple passes, sharing buffers between them. They can also receive other buffers as input, so effects can access them as textures.
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
: The name of the buffer to output to.
; component
: FBO attachment point. Possible values are color0 to color15, depth, stencil and depth-stencil.
; level (Optional)
: Controls the mip map level of the texture that is attached. Default value is 0.
; face (Optional)
: Controls the face of texture cube map or z level of 3d texture. Default value is 0.
; mipmap-generation (Optional)
: Controls whether mipmap generation should be done for texture. Default value is false.
; multisample-samples (Optional)
MSAA samples. Default value is 0.
; multisample-color-samples (Optional)
MSAA color samples. Default value is 0.
 
Passes can also receive buffers as input and use them in their shaders. This is accomplished by the <binding/> tag, which can have the following possible parameters:
 
; buffer
: The name of the buffer to bind.
; unit
: The texture unit to place the texture on. Effects will be able to access the buffer on this texture unit.


Example XML for a ''scene'' type pass:
Example XML for a ''scene'' type pass:
Line 147: Line 169:
   <clustered-forward/>
   <clustered-forward/>


  <binding>
    <buffer>shadowmap</buffer>
    <unit>10</unit>
   <attachment>
   <attachment>
     <buffer>color</buffer>
     <buffer>color</buffer>
Line 186: Line 211:
* Rewrite the uniform system (maybe integrating with Effects?).
* Rewrite the uniform system (maybe integrating with Effects?).
* Find a way to override an entire pass stateset with an Effect.
* Find a way to override an entire pass stateset with an Effect.
* Some kind of versioning system to be able to make breaking changes in the future if/when the compositor is updated in any significant way, without people having to manually update their configs.


== Known Issues ==
== Known Issues ==
343

edits