UNPKG

@itwin/core-frontend

Version:
56 lines 3.1 kB
/** @packageDocumentation * @module WebGL */ import { FragmentShaderBuilder, ProgramBuilder, ShaderBuilder, VertexShaderBuilder } from "../ShaderBuilder"; import { FeatureMode, TechniqueFlags } from "../TechniqueFlags"; /** @internal */ export declare const enum FeatureSymbologyOptions { None = 0, Weight = 1, LineCode = 2, HasOverrides = 4, Color = 8, Alpha = 16, Surface = 28, Point = 29, Linear = 31 } /** @internal */ export declare function addOvrFlagConstants(builder: ShaderBuilder): void; export declare function addFeatureIndex(vert: VertexShaderBuilder): void; export declare function addMaxAlpha(builder: ShaderBuilder): void; /** @internal */ export declare function addSurfaceHiliter(builder: ProgramBuilder, wantWeight?: boolean): void; /** @internal */ export declare function addHiliter(builder: ProgramBuilder, wantWeight?: boolean): void; /** @internal */ export declare const readDepthAndOrder = "\nvec2 readDepthAndOrder(vec2 tc) {\n vec4 pdo = TEXTURE(u_pickDepthAndOrder, tc);\n float order = floor(pdo.x * 16.0 + 0.5);\n return vec2(order, decodeDepthRgb(pdo.yzw));\n}\n"; export declare function addRenderOrderConstants(builder: ShaderBuilder): void; /** @internal */ export declare function addRenderOrder(builder: ShaderBuilder): void; export declare function addPixelWidthFactor(builder: ShaderBuilder): void; /** @internal */ export declare function addFeatureId(builder: ProgramBuilder, computeInFrag: boolean): void; /** @internal */ export declare function addSurfaceDiscard(builder: ProgramBuilder, flags: TechniqueFlags): void; export declare const mixFeatureColor = "\n vec3 rgb = mix(baseColor.rgb, mix(baseColor.rgb, feature_rgb.rgb, u_overrideColorMix), step(0.0, feature_rgb.r));\n float alpha = mix(baseColor.a, feature_alpha, step(0.0, feature_alpha));\n return vec4(rgb, alpha);\n "; /** @internal */ export declare function addClassifierFlash(frag: FragmentShaderBuilder): void; /** @internal */ export declare function addFeatureSymbology(builder: ProgramBuilder, feat: FeatureMode, opts: FeatureSymbologyOptions): void; /** If we're running the hilite shader for a uniform feature, it follows that the feature must be hilited. * So the hilite shader simply needs to output '1' for every fragment. * @internal */ export declare function addUniformHiliter(builder: ProgramBuilder): void; /** For a uniform feature table, the feature ID output to pick buffers is equal to the batch ID. * The following symbology overrides are supported: * - Visibility - implcitly, because if the feature is invisible its geometry will never be drawn. * - Flash * - Hilite * - Color and Transparency- only for point clouds currently which set addFeatureColor to true. * This shader could be simplified, but want to share code with the non-uniform versions...hence uniforms/globals with "v_" prefix typically used for varyings on no prefix... * @internal */ export declare function addUniformFeatureSymbology(builder: ProgramBuilder, addFeatureColor: boolean): void; //# sourceMappingURL=FeatureSymbology.d.ts.map