/** @packageDocumentation
 * @module Rendering
 */
import { Id64String, IDisposable } from "@itwin/core-bentley";
import { ColorDef, ElementAlignedBox3d, Frustum, Gradient, ImageBuffer, ImageSource, ImageSourceFormat, PackedFeatureTable, RenderFeatureTable, RenderMaterial, RenderTexture, SkyGradient } from "@itwin/core-common";
import { ClipVector, Matrix3d, Point3d, Range2d, Transform, Vector2d, XAndY, XYAndZ } from "@itwin/core-geometry";
import { WebGLExtensionName } from "@itwin/webgl-compatibility";
import { IModelConnection } from "../IModelConnection";
import { MapTileTreeReference, TileTreeReference } from "../tile/internal";
import { SceneContext } from "../ViewContext";
import { Viewport } from "../Viewport";
import { MeshParams } from "../common/internal/render/MeshParams";
import { PointStringParams } from "../common/internal/render/PointStringParams";
import { PolylineParams } from "../common/internal/render/PolylineParams";
import { TextureCacheKey } from "../common/render/TextureParams";
import { ViewRect } from "../common/ViewRect";
import { GraphicBranch, GraphicBranchOptions } from "./GraphicBranch";
import { CustomGraphicBuilderOptions, GraphicBuilder, ViewportGraphicBuilderOptions } from "./GraphicBuilder";
import { InstancedGraphicParams, PatternGraphicParams } from "../common/render/InstancedGraphicParams";
import { Mesh } from "../common/internal/render/MeshPrimitives";
import { RealityMeshGraphicParams } from "./RealityMeshGraphicParams";
import { RealityMeshParams } from "./RealityMeshParams";
import { PointCloudArgs } from "../common/internal/render/PointCloudPrimitive";
import { RenderClipVolume } from "./RenderClipVolume";
import { RenderGraphic, RenderGraphicOwner } from "./RenderGraphic";
import { CreateRenderMaterialArgs } from "./CreateRenderMaterialArgs";
import { RenderMemory } from "./RenderMemory";
import { RenderPlanarClassifier } from "./RenderPlanarClassifier";
import { RenderTarget } from "./RenderTarget";
import { CreateTextureArgs, CreateTextureFromSourceArgs } from "./CreateTextureArgs";
import { ScreenSpaceEffectBuilder, ScreenSpaceEffectBuilderParams } from "./ScreenSpaceEffectBuilder";
import { GraphicType } from "../common/render/GraphicType";
import { BatchOptions } from "../common/render/BatchOptions";
import { GraphicDescription } from "../common/render/GraphicDescriptionBuilder";
import { _featureTable, _implementationProhibited, _transformCenter, _transforms } from "../common/internal/Symbols";
import { GraphicDescriptionContext, GraphicDescriptionContextProps, WorkerGraphicDescriptionContextProps } from "../common/render/GraphicDescriptionContext";
import { MeshArgs } from "./MeshArgs";
import { PolylineArgs } from "./PolylineArgs";
import { RenderGeometry } from "../internal/render/RenderGeometry";
import { RenderInstancesParams } from "../common/render/RenderInstancesParams";
import { GraphicTemplate } from "./GraphicTemplate";
/** An opaque representation of a texture draped on geometry within a [[Viewport]].
 * @internal
 */
export declare abstract class RenderTextureDrape implements IDisposable {
    abstract dispose(): void;
    /** @internal */
    abstract collectStatistics(stats: RenderMemory.Statistics): void;
    abstract collectGraphics(context: SceneContext): void;
}
/** @internal */
export type TextureDrapeMap = Map<Id64String, RenderTextureDrape>;
/** @internal */
export type MapLayerClassifiers = Map<number, RenderPlanarClassifier>;
/** Describes a texture loaded from an HTMLImageElement
 * ###TODO Replace with TextureImage from RenderTexture.ts after we start returning transparency info from the backend.
 * @internal
 */
export interface OldTextureImage {
    /** The HTMLImageElement containing the texture's image data */
    image: HTMLImageElement;
    /** The format of the texture's image data */
    format: ImageSourceFormat;
}
/** @internal */
export declare enum RenderDiagnostics {
    /** No diagnostics enabled. */
    None = 0,
    /** Debugging output to browser console enabled. */
    DebugOutput = 2,
    /** Potentially expensive checks of WebGL state enabled. */
    WebGL = 4,
    /** All diagnostics enabled. */
    All = 6
}
/** @internal */
export interface GLTimerResult {
    /** Label from GLTimer.beginOperation */
    label: string;
    /** Time elapsed in nanoseconds, inclusive of child result times.
     *  @note no-op queries seem to have 32ns of noise.
     */
    nanoseconds: number;
    /** Child results if GLTimer.beginOperation calls were nested */
    children?: GLTimerResult[];
}
/** @internal */
export type GLTimerResultCallback = (result: GLTimerResult) => void;
/** An interface optionally exposed by a RenderSystem that allows control of various debugging features.
 * @beta
 */
export interface RenderSystemDebugControl {
    /** Destroy this system's webgl context. Returns false if this behavior is not supported. */
    loseContext(): boolean;
    /** Overrides [[RenderSystem.dpiAwareLOD]].
     * @internal
     */
    dpiAwareLOD: boolean;
    /** Record GPU profiling information for each frame drawn. Check isGLTimerSupported before using.
     * @internal
     */
    resultsCallback?: GLTimerResultCallback;
    /** Returns true if the browser supports GPU profiling queries.
     * @internal
     */
    readonly isGLTimerSupported: boolean;
    /** Attempts to compile all shader programs and returns true if all were successful. May throw exceptions on errors.
     * This is useful for debugging shader compilation on specific platforms - especially those which use neither ANGLE nor SwiftShader (e.g., linux, mac, iOS)
     * because our unit tests which also compile all shaders run in software mode and therefore may not catch some "errors" (especially uniforms that have no effect on
     * program output).
     * @internal
     */
    compileAllShaders(): boolean;
    /** Obtain accumulated debug info collected during shader compilation. See `RenderSystem.Options.debugShaders`.
     * @internal
     */
    debugShaderFiles?: DebugShaderFile[];
}
/** @internal */
export declare abstract class RenderTerrainGeometry implements IDisposable, RenderMemory.Consumer {
    abstract dispose(): void;
    abstract get transform(): Transform | undefined;
    abstract collectStatistics(stats: RenderMemory.Statistics): void;
}
/** @internal */
export declare class TerrainTexture {
    readonly texture: RenderTexture;
    featureId: number;
    readonly scale: Vector2d;
    readonly translate: Vector2d;
    readonly targetRectangle: Range2d;
    readonly layerIndex: number;
    transparency: number;
    readonly clipRectangle?: Range2d | undefined;
    constructor(texture: RenderTexture, featureId: number, scale: Vector2d, translate: Vector2d, targetRectangle: Range2d, layerIndex: number, transparency: number, clipRectangle?: Range2d | undefined);
    cloneWithClip(clipRectangle: Range2d): TerrainTexture;
}
/** @internal */
export declare class DebugShaderFile {
    readonly filename: string;
    readonly src: string;
    isVS: boolean;
    isGL: boolean;
    isUsed: boolean;
    constructor(filename: string, src: string, isVS: boolean, isGL: boolean, isUsed: boolean);
}
/** Transparency settings for planar grid display.
 * @alpha
 */
export declare class PlanarGridTransparency {
    /** Transparency for the grid plane.   This should generally be fairly high to avoid obscuring other geometry */
    readonly planeTransparency = 0.9;
    /** Transparency of the grid lines.  This should be higher than the plane, but less than reference line transparency */
    readonly lineTransparency = 0.75;
    /** Transparency of the reference lines.   This should be less than plane or line transparency so that reference lines are more prominent */
    readonly refTransparency = 0.5;
}
/** Settings for planar grid display.
 * @alpha
 */
export interface PlanarGridProps {
    /**  The grid origin */
    origin: Point3d;
    /** The grid orientation. The grid X and Y direction are the first and second matrix rows */
    rMatrix: Matrix3d;
    /** The spacing between grid liens in the X and Y direction */
    spacing: XAndY;
    /** Grid lines per reference. If zero no reference lines are displayed. */
    gridsPerRef: number;
    /** Grid color.   [[Use Viewport.getContrastToBackgroundColor]] to get best constrast color based on current background. */
    color: ColorDef;
    /** Transparency settings.  If omitted then the [[PlanarGridTransparency]] defaults are used. */
    transparency?: PlanarGridTransparency;
}
/** An opaque representation of instructions for repeatedly drawing a [[RenderGeometry]] to pattern a planar region, to be supplied to [[RenderSystem.createRenderGraphic]].
 * @internal
 */
export interface RenderAreaPattern extends IDisposable, RenderMemory.Consumer {
    readonly [_implementationProhibited]: "renderAreaPattern";
}
/** Contains the WebGL resources necessary to draw multiple [[Instance]]s of a [[GraphicTemplate]] using [instanced rendering](https://webglfundamentals.org/webgl/lessons/webgl-instanced-drawing.html).
 * Use [[RenderSystem.createRenderInstances]] to create one.
 * The instances may be associated with [Feature]($common)s, in which case those features override any defined in the template itself.
 * Example usage:
 * ```ts
 * [[include:Gltf_Instancing]]
 * ```
 * @beta
 */
export interface RenderInstances {
    /** @internal */
    readonly [_implementationProhibited]: "renderInstances";
    /** @internal */
    readonly [_transformCenter]: XYAndZ;
    /** @internal */
    readonly [_transforms]: Float32Array;
    /** @internal */
    readonly [_featureTable]?: PackedFeatureTable;
}
/** @internal */
export interface RenderSkyGradientParams {
    type: "gradient";
    gradient: SkyGradient;
    zOffset: number;
}
/** @internal */
export interface RenderSkySphereParams {
    type: "sphere";
    texture: RenderTexture;
    rotation: number;
    zOffset: number;
}
/** @internal */
export interface RenderSkyCubeParams {
    type: "cube";
    texture: RenderTexture;
}
/** @internal */
export type RenderSkyBoxParams = RenderSkyGradientParams | RenderSkySphereParams | RenderSkyCubeParams;
/** Arguments supplied to [[RenderSystem.createGraphicFromDescription]].
 * @beta
 */
export interface CreateGraphicFromDescriptionArgs {
    /** A description of the [[RenderGraphic]] to create, obtained from a [[GraphicDescriptionBuilder]]. */
    description: GraphicDescription;
    /** The context that was used to create the graphic description, obtained from [[RenderSystem.resolveGraphicDescriptionContext]]. */
    context: GraphicDescriptionContext;
}
/** Arguments supplied to [[RenderSystem.createGraphicFromTemplate]].
 * @beta
 */
export interface CreateGraphicFromTemplateArgs {
    /** Describes how to draw the graphic. */
    template: GraphicTemplate;
    /** Optionally describes how to draw multiple repetitions of the graphic. */
    instances?: RenderInstances;
}
/** A RenderSystem provides access to resources used by the internal WebGL-based rendering system.
 * An application rarely interacts directly with the RenderSystem; instead it interacts with types like [[Viewport]] which
 * coordinate with the RenderSystem on the application's behalf.
 * @see [Display system overview]($docs/learning/display/index.md)
 * @see [[IModelApp.renderSystem]].
 * @public
 * @extensions
 */
export declare abstract class RenderSystem implements IDisposable {
    /** Options used to initialize the RenderSystem. These are primarily used for feature-gating.
     * This object is frozen and cannot be modified after the RenderSystem is created.
     * @internal
     */
    readonly options: RenderSystem.Options;
    /** Antialias samples to use on all subsequently created render targets.
     * Default value: undefined (no antialiasing)
     * @beta
     */
    antialiasSamples?: number;
    /** Initialize the RenderSystem with the specified options.
     * @note The RenderSystem takes ownership of the supplied Options and freezes it.
     * @internal
     */
    protected constructor(options?: RenderSystem.Options);
    /** @internal */
    abstract get isValid(): boolean;
    /** @internal */
    abstract dispose(): void;
    /** The maximum permitted width or height of a texture supported by this render system. */
    get maxTextureSize(): number;
    /** @internal */
    get supportsCreateImageBitmap(): boolean;
    /** @internal */
    get dpiAwareLOD(): boolean;
    /** @internal */
    get isMobile(): boolean;
    /** @internal */
    abstract createTarget(canvas: HTMLCanvasElement): RenderTarget;
    /** @internal */
    abstract createOffscreenTarget(rect: ViewRect): RenderTarget;
    /** Perform a small unit of idle work and return true if more idle work remains to be done. This function is invoked on each tick of the javascript event loop as long as no viewports are registered with the ViewManager, until it returns false to indicate all idle work has been completed.
     * @internal
     */
    abstract doIdleWork(): boolean;
    /** Find a previously-created [RenderMaterial]($common) by its ID.
     * @param _key The unique ID of the material within the context of the IModelConnection. Typically an element ID.
     * @param _imodel The IModelConnection with which the material is associated.
     * @returns A previously-created material matching the specified ID, or undefined if no such material exists.
     */
    findMaterial(_key: string, _imodel: IModelConnection): RenderMaterial | undefined;
    /** Create a [RenderMaterial]($common) from parameters
     * If the parameters include a non-empty key, and no previously-created material already exists with that key, the newly-created material will be cached on the IModelConnection such
     * that it can later be retrieved by the same key using [[RenderSystem.findMaterial]].
     * @param _params A description of the material's properties.
     * @param _imodel The IModelConnection associated with the material.
     * @returns the newly-created material, or undefined if the material could not be created or if a material with the same key as that specified in the params already exists.
     * @deprecated in 3.x. Use [[createRenderMaterial]].
     */
    createMaterial(_params: RenderMaterial.Params, _imodel: IModelConnection): RenderMaterial | undefined;
    /** Create a [RenderMaterial]($common).
     * @see [[CreateRenderMaterialArgs]] for a description of the material parameters.
     */
    createRenderMaterial(_args: CreateRenderMaterialArgs): RenderMaterial | undefined;
    /** Creates a [[GraphicBuilder]] for creating a [[RenderGraphic]].
     * @param placement The local-to-world transform in which the builder's geometry is to be defined.
     * @param type The type of builder to create.
     * @param viewport The viewport in which the resultant [[RenderGraphic]] will be rendered.
     * @param pickableId If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].
     * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within the specified viewport.
     * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.
     * @see [[RenderContext.createGraphicBuilder]].
     * @see [[Decorator]]
     */
    createGraphicBuilder(placement: Transform, type: GraphicType, viewport: Viewport, pickableId?: Id64String): GraphicBuilder;
    /** Obtain a [[GraphicBuilder]] from which to produce a [[RenderGraphic]].
     * @param options Options describing how to create the builder.
     * @returns A builder that produces a [[RenderGraphic]].
     */
    abstract createGraphic(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions): GraphicBuilder;
    /** Obtain an object capable of producing a custom screen-space effect to be applied to the image rendered by a [[Viewport]].
     * @returns undefined if screen-space effects are not supported by this RenderSystem.
     */
    createScreenSpaceEffectBuilder(_params: ScreenSpaceEffectBuilderParams): ScreenSpaceEffectBuilder | undefined;
    /** Create a graphic from a low-level representation of a triangle mesh.
     * @param args A description of the mesh.
     * @param instances Repetitions of the mesh to be drawn.
     * @see [[createGraphic]] to obtain a [[GraphicBuilder]] that can assemble a mesh from higher-level primitives.
     */
    createTriMesh(args: MeshArgs, instances?: InstancedGraphicParams): RenderGraphic | undefined;
    /** @internal */
    createTriMesh(args: MeshArgs, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined;
    /** @internal */
    createMeshGraphics(mesh: Mesh, instances?: InstancedGraphicParams | Point3d): RenderGraphic | undefined;
    /** @internal */
    createGeometryFromMesh(mesh: Mesh, viOrigin: Point3d | undefined): RenderGeometry | undefined;
    /** Create a graphic from a low-level representation of a set of line strings.
     * @param args A description of the line strings.
     * @param instances Repetitions of the line strings to be drawn.
     */
    createIndexedPolylines(args: PolylineArgs, instances?: InstancedGraphicParams): RenderGraphic | undefined;
    /** @internal */
    createIndexedPolylines(args: PolylineArgs, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined;
    /** @internal */
    createMeshGeometry(_params: MeshParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined;
    /** @internal */
    createPolylineGeometry(_params: PolylineParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined;
    /** @internal */
    createPointStringGeometry(_params: PointStringParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined;
    /** @internal */
    createPointCloudGeometry(_args: PointCloudArgs): RenderGeometry | undefined;
    /** @internal */
    createRealityMeshGeometry(_params: RealityMeshParams, _disableTextureDisposal?: boolean): RenderGeometry | undefined;
    /** @internal */
    createAreaPattern(_params: PatternGraphicParams): RenderAreaPattern | undefined;
    /** Create a [[RenderInstances]] from a [[RenderInstancesParams]], to be supplied to [[createGraphicFromTemplate]] via [[CreateGraphicFromTempalateArgs.instances]].
     * @beta
     */
    createRenderInstances(_params: RenderInstancesParams): RenderInstances | undefined;
    /** Creates a graphic that draws any number of repetitions of a [[GraphicTemplate]].
     * @beta
     */
    abstract createGraphicFromTemplate(args: CreateGraphicFromTemplateArgs): RenderGraphic;
    /** Create a RenderGraphic from a RenderGeometry produced by this RenderSystem.
     * @internal
     */
    abstract createRenderGraphic(_geometry: RenderGeometry, instances?: InstancedGraphicParams | RenderAreaPattern): RenderGraphic | undefined;
    private createGraphicFromGeometry;
    /** @internal */
    createMesh(params: MeshParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined;
    /** @internal */
    createPolyline(params: PolylineParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined;
    /** @internal */
    createPointString(params: PointStringParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined;
    /** @internal */
    createTerrainMesh(_params: RealityMeshParams, _transform?: Transform, _disableTextureDisposal?: boolean): RenderTerrainGeometry | undefined;
    /** @internal */
    createRealityMeshGraphic(_params: RealityMeshGraphicParams, _disableTextureDisposal?: boolean): RenderGraphic | undefined;
    /** @internal */
    createRealityMesh(realityMesh: RealityMeshParams, disableTextureDisposal?: boolean): RenderGraphic | undefined;
    /** @internal */
    get maxRealityImageryLayers(): number;
    /** @internal */
    createPointCloud(args: PointCloudArgs, _imodel: IModelConnection): RenderGraphic | undefined;
    /** Create a clip volume to clip geometry.
     * @note The clip volume takes ownership of the ClipVector, which must not be subsequently mutated.
     * @param _clipVector Defines how the volume clips geometry.
     * @returns A clip volume, or undefined if, e.g., the clip vector does not clip anything.
     */
    createClipVolume(_clipVector: ClipVector): RenderClipVolume | undefined;
    /** @internal */
    createPlanarGrid(_frustum: Frustum, _grid: PlanarGridProps): RenderGraphic | undefined;
    /** @internal */
    createBackgroundMapDrape(_drapedTree: TileTreeReference, _mapTree: MapTileTreeReference): RenderTextureDrape | undefined;
    /** @internal */
    createTile(tileTexture: RenderTexture, corners: Point3d[], featureIndex?: number): RenderGraphic | undefined;
    /** Create a Graphic for a [[SkyBox]] which encompasses the entire scene, rotating with the camera.
     * @internal
     */
    createSkyBox(_params: RenderSkyBoxParams): RenderGraphic | undefined;
    /** Create a RenderGraphic consisting of a list of Graphics to be drawn together. */
    abstract createGraphicList(primitives: RenderGraphic[]): RenderGraphic;
    /** Create a RenderGraphic consisting of a list of Graphics, with optional transform and symbology overrides applied to the list */
    createBranch(branch: GraphicBranch, transform: Transform, options?: GraphicBranchOptions): RenderGraphic;
    /** Create a graphic from a [[GraphicBranch]]. */
    abstract createGraphicBranch(branch: GraphicBranch, transform: Transform, options?: GraphicBranchOptions): RenderGraphic;
    /** Create a node in the scene graph corresponding to a transform node in the scene's schedule script.
     * Nodes under this branch will only be drawn if they belong to the specified transform node.
     * This allows the graphics in a single Tile to be efficiently drawn with different transforms applied by different nodes.
     * The node Id is either the Id of a single transform node in the script, of 0xffffffff to indicate all nodes that have no transform applied to them.
     * @internal
     */
    createAnimationTransformNode(graphic: RenderGraphic, _nodeId: number): RenderGraphic;
    /** Create a "batch" of graphics containing individual [Feature]($common)s.
     * @param graphic The graphic representing the contents of the batch.
     * @param features The features contained within the batch.
     * @param range A volume fully encompassing the batch's geometry.
     * @param options Options customizing the behavior of the batch.
     */
    abstract createBatch(graphic: RenderGraphic, features: RenderFeatureTable, range: ElementAlignedBox3d, options?: BatchOptions): RenderGraphic;
    /** Return a Promise which when resolved indicates that all pending external textures have finished loading from the backend. */
    waitForAllExternalTextures(): Promise<void>;
    /** @internal */
    get hasExternalTextureRequests(): boolean;
    /** Create a graphic that assumes ownership of another graphic.
     * @param ownedGraphic The RenderGraphic to be owned.
     * @returns The owning graphic that exposes a `disposeGraphic` method for explicitly disposing of the owned graphic.
     * @see [[RenderGraphicOwner]] for details regarding ownership semantics.
     * @public
     */
    createGraphicOwner(ownedGraphic: RenderGraphic): RenderGraphicOwner;
    /** Create a "layer" containing the graphics belonging to it. A layer has a unique identifier and all of its geometry lies in an XY plane.
     * Different layers can be drawn coincident with one another; their draw order can be controlled by a per-layer priority value so that one layer draws
     * on top of another. Layers cannot nest inside other layers. Multiple GraphicLayers can exist with the same ID; they are treated as belonging to the same layer.
     * A GraphicLayer must be contained (perhaps indirectly) inside a GraphicLayerContainer.
     * @see [[createGraphicLayerContainer]]
     * @internal
     */
    createGraphicLayer(graphic: RenderGraphic, _layerId: string): RenderGraphic;
    /** Create a graphic that can contain [[GraphicLayer]]s.
     * @internal
     */
    createGraphicLayerContainer(graphic: RenderGraphic, _drawAsOverlay: boolean, _transparency: number, _elevation: number): RenderGraphic;
    /** Find a previously-created [[RenderTexture]] by its key.
     * @param _key The unique key of the texture within the context of the IModelConnection. Typically an element Id.
     * @param _imodel The IModelConnection with which the texture is associated.
     * @returns A previously-created texture matching the specified key, or undefined if no such texture exists.
     */
    findTexture(_key: TextureCacheKey, _imodel: IModelConnection): RenderTexture | undefined;
    /** Find or create a [[RenderTexture]] from a persistent texture element.
     * @param id The ID of the texture element.
     * @param iModel The IModel containing the texture element.
     * @returns A Promise resolving to the created RenderTexture or to undefined if the texture could not be created.
     * @note If the texture is successfully created, it will be cached on the IModelConnection such that it can later be retrieved by its ID using [[RenderSystem.findTexture]].
     * @see [[RenderSystem.loadTextureImage]].
     */
    loadTexture(id: Id64String, iModel: IModelConnection): Promise<RenderTexture | undefined>;
    /**
     * Load a texture image given the ID of a texture element.
     * @param id The ID of the texture element.
     * @param iModel The IModel containing the texture element.
     * @returns A Promise resolving to a TextureImage created from the texture element's data, or to undefined if the TextureImage could not be created.
     * @see [[RenderSystem.loadTexture]]
     * @internal
     */
    loadTextureImage(id: Id64String, iModel: IModelConnection): Promise<OldTextureImage | undefined>;
    /** Obtain a texture created from a gradient.
     * @param _symb The description of the gradient.
     * @param _imodel The IModelConnection with which the texture is associated.
     * @returns A texture created from the gradient image, or undefined if the texture could not be created.
     * @note If a texture matching the specified gradient is already cached on the iModel, it will be returned.
     * Otherwise, if an iModel is supplied, the newly-created texture will be cached on the iModel such that subsequent calls with an equivalent gradient and the
     * same iModel will return the cached texture instead of creating a new one.
     */
    getGradientTexture(_symb: Gradient.Symb, _imodel?: IModelConnection): RenderTexture | undefined;
    /** Create a new texture from an [[ImageBuffer]].
     * @deprecated in 3.x. Use [[createTexture]].
     */
    createTextureFromImageBuffer(image: ImageBuffer, iModel: IModelConnection, params: RenderTexture.Params): RenderTexture | undefined;
    /** Create a new texture from an HTML image. Typically the image was extracted from a binary representation of a jpeg or png via [[imageElementFromImageSource]].
     * @deprecated in 3.x. Use [[createTexture]].
     */
    createTextureFromImage(image: HTMLImageElement, hasAlpha: boolean, iModel: IModelConnection | undefined, params: RenderTexture.Params): RenderTexture | undefined;
    /** Create a new texture from an ImageSource.
     * @deprecated in 3.x. Use RenderSystem.createTextureFromSource.
     */
    createTextureFromImageSource(source: ImageSource, iModel: IModelConnection | undefined, params: RenderTexture.Params): Promise<RenderTexture | undefined>;
    /** Create a texture from an ImageSource. */
    createTextureFromSource(args: CreateTextureFromSourceArgs): Promise<RenderTexture | undefined>;
    /** Create a new texture by its element ID. This texture will be retrieved asynchronously from the backend. A placeholder image will be associated with the texture until the requested image data loads. */
    createTextureFromElement(_id: Id64String, _imodel: IModelConnection, _params: RenderTexture.Params, _format: ImageSourceFormat): RenderTexture | undefined;
    createTexture(_args: CreateTextureArgs): RenderTexture | undefined;
    /** Create a new texture from a cube of HTML images.
     * @internal
     */
    createTextureFromCubeImages(_posX: HTMLImageElement, _negX: HTMLImageElement, _posY: HTMLImageElement, _negY: HTMLImageElement, _posZ: HTMLImageElement, _negZ: HTMLImageElement, _imodel: IModelConnection, _params: RenderTexture.Params): RenderTexture | undefined;
    /** @internal */
    onInitialized(): void;
    /** @internal */
    enableDiagnostics(_enable: RenderDiagnostics): void;
    /** @internal */
    get supportsLogZBuffer(): boolean;
    /** Obtain an object that can be used to control various debugging features. Returns `undefined` if debugging features are unavailable for this `RenderSystem`.
     * @beta
     */
    get debugControl(): RenderSystemDebugControl | undefined;
    /** @internal */
    collectStatistics(_stats: RenderMemory.Statistics): void;
    /** A function that is invoked after the WebGL context is lost. Context loss is almost always caused by excessive consumption of GPU memory.
     * After context loss occurs, the RenderSystem will be unable to interact with WebGL by rendering viewports, creating graphics and textures, etc.
     * By default, this function invokes [[ToolAdmin.exceptionHandler]] with a brief message describing what occurred.
     * An application can override this behavior as follows:
     * ```ts
     * RenderSystem.contextLossHandler = (): Promise<any> => {
     *  // your implementation here.
     * }
     * ```
     * @note Context loss is reported by the browser some short time *after* it has occurred. It is not possible to determine the specific cause.
     * @see [[TileAdmin.gpuMemoryLimit]] to limit the amount of GPU memory consumed thereby reducing the likelihood of context loss.
     * @see [[TileAdmin.totalTileContentBytes]] for the amount of GPU memory allocated for tile graphics.
     */
    static contextLossHandler(): Promise<any>;
    /** Convert a [[GraphicDescription]] produced by a [[GraphicDescriptionBuilder]] into a [[RenderGraphic]].
     * @beta
     */
    createGraphicFromDescription(args: CreateGraphicFromDescriptionArgs): RenderGraphic | undefined;
    /** Convert a [[GraphicDescription]] produced by a [[GraphicDescriptionBuilder]] into a [[GraphicTemplate]].
     * @beta
     */
    createTemplateFromDescription(args: CreateGraphicFromDescriptionArgs): GraphicTemplate;
    /** Obtain the JSON representation of a [[WorkerGraphicDescriptionContext]] for the specified `iModel` that can be forwarded to a Worker for use with a [[GraphicDescriptionBuilder]].
     * @beta
     */
    createWorkerGraphicDescriptionContextProps(iModel: IModelConnection): WorkerGraphicDescriptionContextProps;
    /** Synchronize changes made to a [[WorkerGraphicDescriptionContext]] on a Worker with the state of the `iModel` from which it was created.
     * @beta
     */
    resolveGraphicDescriptionContext(props: GraphicDescriptionContextProps, iModel: IModelConnection): Promise<GraphicDescriptionContext>;
}
/** A RenderSystem provides access to resources used by the internal WebGL-based rendering system.
 * An application rarely interacts directly with the RenderSystem; instead it interacts with types like [[Viewport]] which
 * coordinate with the RenderSystem on the application's behalf.
 * @see [[IModelApp.renderSystem]].
 * @public
 */
export declare namespace RenderSystem {
    /** Options passed to [[IModelApp.supplyRenderSystem]] to configure the [[RenderSystem]] on startup. Many of these options serve as "feature flags" used to enable newer, experimental features. As such they typically begin life tagged as "alpha" or "beta" and are subsequently deprecated when the feature is declared stable.
     *
     * @public
     */
    interface Options {
        /** WebGL extensions to be explicitly disabled, regardless of whether or not the WebGL implementation supports them.
         * This is chiefly useful for testing code that only executes in the absence of particular extensions, while running on a system that supports those extensions.
         *
         * Default value: undefined
         *
         * @public
         */
        disabledExtensions?: WebGLExtensionName[];
        /** If true, preserve the shader source code as internal strings, useful for debugging purposes.
         *
         * Default value: false
         *
         * @public
         */
        preserveShaderSourceCode?: boolean;
        /** If true, display solar shadows when enabled by [ViewFlags.shadows]($common).
         *
         * Default value: true
         *
         * @beta
         */
        displaySolarShadows?: boolean;
        /** If the view frustum is sufficiently large, and the EXT_frag_depth WebGL extension is available, use a logarithmic depth buffer to improve depth buffer resolution. Framerate may degrade to an extent while the logarithmic depth buffer is in use. If this option is disabled, or the extension is not supported, the near and far planes of very large view frustums will instead be moved to reduce the draw distance.
         *
         * Default value: true
         *
         * @public
         */
        logarithmicDepthBuffer?: boolean;
        /** If true, [[ScreenViewport]]s will respect the DPI of the display.  See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].
         * @see [[dpiAwareLOD]] to control whether device pixel ratio affects the level of detail for tile graphics and decorations.
         * @see [[Viewport.cssPixelsToDevicePixels]] to convert CSS pixels to device pixels.
         * @see [[Viewport.devicePixelRatio]].
         *
         * Default value: true
         *
         * @public
         */
        dpiAwareViewports?: boolean;
        /** If defined, this will be used as the device pixel ratio instead of the system's actual device pixel ratio.
         * This can be helpful for situations like running in the iOS Simulator where forcing a lower resolution by setting a sub-1 device pixel ratio would increase performance.
         * @note If this setting is used to decrease the effective device pixel ratio, the view will appear pixelated.
         * @note This setting should only be used to increase performance in situations like the iOS Simulator for testing purposes only. It should not be used in a production situation.
         * @note This setting has no effect if [[dpiAwareViewports]] is `false`.
         *
         * Default value: undefined
         *
         * @public
         */
        devicePixelRatioOverride?: number;
        /** If true, [[ScreenViewport]]s will take into account the DPI of the display when computing the level of detail for tile graphics and decorations.
         * This can result in sharper-looking images on high-DPI devices like mobile phones, but may reduce performance on such devices.
         * @note This setting has no effect if [[dpiAwareViewports]] is `false`.
         * @see [[Viewport.devicePixelRatio]].
         *
         * Default value: false
         *
         * @public
         */
        dpiAwareLOD?: boolean;
        /** Previously, this property dictated whether to attempt to use a WebGL 2 rendering context before falling back to WebGL 1.
         * WebGL 1 is no longer supported, so this property is now ignored.
         * @public
         * @deprecated in 4.x. WebGL 1 is no longer supported.
         */
        useWebGL2?: boolean;
        /** If true, plan projection models will be rendered using [PlanProjectionSettings]($common) defined by the [[DisplayStyle3dState]].
         * Default value: true
         * @public
         */
        planProjections?: boolean;
        /** To help prevent delays when a user interacts with a [[Viewport]], the WebGL render system can precompile shader programs before any Viewport is opened.
         * This particularly helps applications when they do not open a Viewport immediately upon startup - for example, if the user is first expected to select an iModel and a view through the user interface.
         * Shader precompilation will cease once all shader programs have been compiled, or when a Viewport is opened (registered with the [[ViewManager]]).
         * @note Enabling this feature can slow UI interactions before a [[Viewport]] is opened.
         * To enable this feature, set this to `true`.
         *
         * Default value: false
         *
         * @beta
         */
        doIdleWork?: boolean;
        /** WebGL context attributes to explicitly set when initializing [[IModelApp.renderSystem]].
         * Exposed chiefly for OpenCities Planner.
         * @internal
         */
        contextAttributes?: WebGLContextAttributes;
        /** If true, will cause exception when a shader uniform is missing (usually optimized out), otherwise will only log these.
         * Default value: false
         * @public
         */
        errorOnMissingUniform?: boolean;
        /** If true, and the `WEBGL_debug_shaders` extension is available, accumulate debug information during shader compilation.
         * This information can be accessed via `RenderSystemDebugControl.debugShaderFiles`.
         * Default value: false
         * @internal
         */
        debugShaders?: boolean;
        /** Initial antialias setting.
         * If antialiasing is supported, a value greater than 1 enables it using that many samples, and a value less than or equal to 1 disables antialiasing.
         * Default value: 1
         * @public
         */
        antialiasSamples?: number;
    }
}
//# sourceMappingURL=RenderSystem.d.ts.map