UNPKG

molstar

Version:

A comprehensive macromolecular library.

47 lines (46 loc) 2.02 kB
/** * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ import { ValueCell } from '../mol-util'; import { WebGLExtensions } from './webgl/extensions'; import { GLRenderingContext } from './webgl/compat'; export declare type DefineKind = 'boolean' | 'string' | 'number'; export declare type DefineType = boolean | string; export declare type DefineValues = { [k: string]: ValueCell<DefineType>; }; declare type ShaderExtensionsValue = 'required' | 'optional'; export interface ShaderExtensions { readonly standardDerivatives?: ShaderExtensionsValue; readonly fragDepth?: ShaderExtensionsValue; readonly drawBuffers?: ShaderExtensionsValue; readonly shaderTextureLod?: ShaderExtensionsValue; } declare type FragOutTypes = { [k in number]: 'vec4' | 'ivec4'; }; export interface ShaderCode { readonly id: number; readonly name: string; readonly vert: string; readonly frag: string; readonly extensions: ShaderExtensions; /** Fragment shader output type only applicable for webgl2 */ readonly outTypes: FragOutTypes; } export declare function ShaderCode(name: string, vert: string, frag: string, extensions?: ShaderExtensions, outTypes?: FragOutTypes): ShaderCode; export declare const PointsShaderCode: ShaderCode; export declare const SpheresShaderCode: ShaderCode; export declare const CylindersShaderCode: ShaderCode; export declare const TextShaderCode: ShaderCode; export declare const LinesShaderCode: ShaderCode; export declare const MeshShaderCode: ShaderCode; export declare const DirectVolumeShaderCode: ShaderCode; export declare const ImageShaderCode: ShaderCode; export declare type ShaderDefines = { [k: string]: ValueCell<DefineType>; }; export declare function addShaderDefines(gl: GLRenderingContext, extensions: WebGLExtensions, defines: ShaderDefines, shaders: ShaderCode): ShaderCode; export {};