3dmol
Version:
JavaScript/TypeScript molecular visualization library
165 lines (164 loc) • 4.85 kB
TypeScript
/**
* Simplified webGL renderer
*/
import { SpritePlugin } from "./SpritePlugin";
export declare class Renderer {
row: any;
col: any;
rows: any;
cols: any;
context: any;
devicePixelRatio: number;
domElement: HTMLCanvasElement;
sortObjects: boolean;
autoUpdateObjects: boolean;
autoUpdateScene: boolean;
info: {
memory: {
programs: number;
geometries: number;
textures: number;
};
render: {
calls: number;
vertices: number;
faces: number;
points: number;
};
};
private _gl;
private _offscreen;
private _bitmap;
private _programs;
private _programs_counter;
private _webglversion;
private _currentProgram;
private _currentMaterialId;
private _currentGeometryGroupHash;
private _currentCamera;
private _geometryGroupCounter;
private _oldDoubleSided;
private _oldFlipSided;
private _oldDepthTest;
private _oldDepthWrite;
private _oldPolygonOffset;
private _oldLineWidth;
private _viewportWidth;
private _viewportHeight;
private _currentWidth;
private _currentHeight;
private _enabledAttributes;
private _vector3;
private _worldInverse;
private _projInverse;
private _textureMatrix;
private _fullProjModelMatrix;
private _fullProjModelMatrixInv;
private _direction;
private _lightsNeedUpdate;
private _lights;
sprites: SpritePlugin;
private _screenshader;
private _AOshader;
private _blurshader;
private _vertexattribpos;
private _aovertexattribpos;
private _blurvertexattribpos;
private _screenQuadVBO;
private _fb;
private _targetTexture;
private _depthTexture;
private _shadingTexture;
private _scratchTexture;
private _canvas;
private _precision;
private _alpha;
private _premultipliedAlpha;
private _antialias;
private _upscale;
private _preserveDrawingBuffer;
private _clearColor;
private _clearAlpha;
private _outlineMaterial;
private _outlineSphereImposterMaterial;
private _outlineStickImposterMaterial;
private _outlineEnabled;
private _AOEnabled;
private _AOstrength;
private _AOradius;
private _extInstanced;
private _extFragDepth;
private _extFloatLinear;
private _extColorBufferFloat;
private SHADE_TEXTURE;
constructor(parameters: any);
supportedExtensions(): {
supportsAIA: boolean;
supportsImposters: boolean;
regen: boolean;
};
getContext(): WebGLRenderingContext | WebGL2RenderingContext;
getCanvas(): any;
isLost(): boolean;
getPrecision(): any;
setClearColorHex(hex: any, alpha: any): void;
enableOutline(parameters: any): void;
disableOutline(): void;
enableAmbientOcclusion(parameters: any): void;
disableAmbientOcclusion(): void;
setViewport(): void;
setSize(width: any, height: any): void;
clear(color: any, depth: any, stencil: any): void;
setMaterialFaces(material: any, reflected: any): void;
setDepthTest(depthTest: any): void;
setDepthWrite(depthWrite: any): void;
setBlending(blending: any): void;
initMaterial(material: any, lights: any, fog: any, objects: any): void;
renderBuffer(camera: any, lights: any, fog: any, material: any, geometryGroup: any, object: any): void;
clearShading(): void;
setShading(scene: any, camera: any, materialType: any): void;
render(scene: any, camera: any): void;
setFrameBuffer(): void;
initFrameBuffer(): void;
renderFrameBuffertoScreen(): void;
initWebGLObjects(scene: any): void;
getYRatio(): any;
getXRatio(): any;
getAspect(width: any, height: any): number;
setTexture(texture: any, slot: any, is3D: any): void;
supportsVolumetric(): boolean;
private enableAttribute;
private disableAttributes;
private setPolygonOffset;
private setLineWidth;
private deallocateGeometry;
private deallocateMaterial;
private deallocateTexture;
private onGeometryDispose;
private onTextureDispose;
private onMaterialDispose;
private getShader;
private buildProgram;
private setProgram;
private loadMaterialUniforms;
private addObject;
private updateObject;
private removeObject;
private removeInstances;
private removeInstancesDirect;
private unrollBufferMaterial;
private setBuffers;
private createMeshBuffers;
private createLineBuffers;
private addBuffer;
private setupMatrices;
private filterFallback;
private setTextureParameters;
private paramToGL;
private setupLights;
private initGL;
private isWebGL1;
private setDefaultGLState;
private renderObjects;
private renderSprites;
}