DrawableViewshedKernel

Single-pass GPU dispatch for earth.worldwind.shape.ViewshedSightline's visibility kernel. Uploads the elevation grid as R32F, runs the per-fragment Amanatides–Woo walk via ViewshedKernelShaderProgram into an externally-owned RGBA8 outputTexture, and signals completion via callback. The texture lives on the GPU and is sampled directly by SurfaceImage on its own draw — no CPU readback, no PBO, no fence.

NOT pool-managed; the renderable holds a single instance and re-enqueues it per dispatch. recycle is a deliberate no-op. width/height are settable per-dispatch — the same drawable instance survives samplesPerSide changes; only the outputTexture reference is swapped out by the renderable.

Bails (no callback fired) when Kgl.supportsSizedTextureFormats is false (WebGL1 / GLES2); the kernel needs R32F and texelFetch.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

0 = circular AOI, 1 = rectangular AOI.

Link copied to clipboard
var callback: () -> Unit?

Invoked on the GL thread once the kernel has rendered into outputTexture.

Link copied to clipboard

If true, draw drains texturesToRelease, calls release on this drawable's own GPU resources, and returns without rendering. The renderable sets this from dispose(); one final enqueue gets all resources off the GL.

Link copied to clipboard
Link copied to clipboard

Source elevations in row-major south-up order (matching Globe.getElevationGrid).

Link copied to clipboard
var height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

RGBA8 render target attached to GL_COLOR_ATTACHMENT0. Owned by the renderable.

Link copied to clipboard

Shader program acquired via RenderContext.getShaderProgram before enqueue.

Link copied to clipboard

Textures the renderable wants released on the next draw. Used to dispose previous outputTexture instances after a samplesPerSide change without leaking until engine teardown. Drained at the top of draw.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var width: Int

Functions

Link copied to clipboard
open override fun draw(dc: DrawContext)
Link copied to clipboard
open override fun recycle()
Link copied to clipboard

Free this drawable's GPU resources. Must run on the GL thread (i.e. from within draw).