Surface3DProjectionShaderProgramOES

OES external-texture variant of Surface3DProjectionShaderProgram used when the source texture has target = GL_TEXTURE_EXTERNAL_OES (Android MediaPlayer -> SurfaceTexture path). Identical 3D camera-frustum projection shader; only the fragment-stage sampler type changes:

  • #extension GL_OES_EGL_image_external : require at the top of the fragment source, and

  • samplerExternalOES in place of sampler2D for texSampler.

Both edits are derived from the parent's source at construction so the kernel stays the single source of truth: touch Surface3DProjectionShaderProgram's shader strings and the OES variant follows automatically.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Indicates the approximate size of the OpenGL resources referenced by this GPU program.

Functions

Link copied to clipboard
fun loadColor(color: Color)
Link copied to clipboard
fun loadFadeMargin(fadeMargin: Float)

Soft-edge fade margin in normalised UV units (0..0.5). 0 (default) renders a hard cutoff at the unit-square boundary - the cheapest path, since the shader's uniform-controlled branch then skips the fade math entirely. Non-zero values ramp alpha 0..1 across the inner 0..fadeMargin strip on each side, blending the projection into surrounding terrain.

Link copied to clipboard

Tile-local image projection: world-ECEF imageProjection premultiplied by a translation to the current terrain tile's vertex origin. Recomputed per tile by the drawable so per-vertex math stays float-precise. Skips the upload when the matrix matches the previously uploaded value - common for static photos and paused video that re-bind the same surface drawable every render frame.

Link copied to clipboard
Link copied to clipboard
fun loadOpacity(opacity: Float)
Link copied to clipboard
Link copied to clipboard
open override fun release(dc: DrawContext)

Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.

Link copied to clipboard