Version 3 (modified by art, 13 years ago) (diff)


osgPPU Units

Each unit can be understood as a black box with n inputs and m outputs. The input and the output is represented by a texture. A shader can be applied to a unit to be used for computing the output. Texture inputs are bound to the associated shader in the appropriate texture units based on the specified order (e.g. Texture A to texture unit 1, Texture B to texture unit 0, etc.).

Output textures can be used by the associated shader program to write the output to. You can use multiple output textures if your GPU does support MRT (multiple rendering targets). The output textures can either be reused as input again (e.g. for Motion Blur effect) or used in any other place of your rendering application.

Mipmapping is supported either by a hardware mipmap generation on the output texture or by using an additional mipmap shader associated with a Unit. A mipmap shader is responsible for computing the data of the current mipmap level from the previous one. (Note: UnitInOut? does support In/Out? mipmapping, which do copy the data from the input mipmap structure to the output).

In general osgPPU can be also used for non-rendering task, e.g. to compute procedural textures or to perform offscreen computation on some dataset.

Supported Units

  • Unit - default bypass unit without any rendering capabilities
  • UnitOut? - pass input textures to the frame buffer (can be used to display results on the screen)
  • UnitOutCapture? - pass input textures to a file (often used to capture renderings in higher resolution than monitor supports)
  • UnitInOut? - pass input to the output
  • UnitInResampleOut? - pass input to the output by scaling the input texture
  • UnitText? - pass input to the output and print some texture message on the output texture