Package limn.render3d

Interface RenderTarget

All Superinterfaces:
GpuSurface, ReadableSurface

public interface RenderTarget extends GpuSurface, ReadableSurface
An offscreen render target for 3D content: a color texture plus a depth buffer, optionally multisampled (MSAA). Extends GpuSurface so it still composites into the 2D scene via Canvas.drawSurface(limn.graphics.GpuSurface, float, float, float, float) and is released via Scene.disposeLater(limn.graphics.GpuSurface). Created through Graphics3D. Sizes are in device pixels.

Color space: the target's contents are linear light, premultiplied alpha, scene-referred, never display-referred. Every program that writes color into one is held to that: authored sRGB values are decoded to linear before they are written, so blending and the MSAA resolve accumulate light rather than encoded pixels. The display transform (exposure, ACES tonemap, sRGB encode) runs exactly once, in the 2D composite, when the target is drawn via drawSurface.

That colour space is also why reading one back is two operations rather than one: ReadableSurface is extended here (every render target can be read), and its two methods return the scene-referred contents and the display-referred picture respectively. exposure() belongs to the second and must not be applied to the first.

  • Method Details

    • samples

      int samples()
      MSAA sample count actually allocated (1 = no multisampling).
    • exposure

      default float exposure()
      The exposure the most recent pass into this target was given (RenderPass.exposure(float)), 1 before any pass ran. The 2D composite's display transform applies it when this target is drawn; exposure belongs to the display transform, not to the scene-referred pixels.
    • stats

      RenderStats stats()
      GPU memory this target owns (color/depth attachments), for the perf monitor.