UNPKG

molstar

Version:

A comprehensive macromolecular library.

74 lines (64 loc) 2.21 kB
"use strict"; /** * Copyright (c) 2018-2024 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.points_frag = void 0; exports.points_frag = ` precision highp float; precision highp int; #include common #include common_frag_params #include color_frag_params #include common_clip const vec2 center = vec2(0.5); const float radius = 0.5; void main(){ #include fade_lod #include clip_pixel float fragmentDepth = gl_FragCoord.z; #include assign_material_color #if defined(dPointStyle_circle) float dist = distance(gl_PointCoord, center); if (dist > radius) discard; #elif defined(dPointStyle_fuzzy) float dist = distance(gl_PointCoord, center); float fuzzyAlpha = 1.0 - smoothstep(0.0, radius, dist); if (fuzzyAlpha < 0.0001) discard; #endif #if defined(dPointStyle_fuzzy) && (defined(dRenderVariant_color) || defined(dRenderVariant_tracing)) material.a *= fuzzyAlpha; #endif #include check_transparency #if defined(dRenderVariant_pick) #include check_picking_alpha #ifdef requiredDrawBuffers gl_FragColor = vObject; gl_FragData[1] = vInstance; gl_FragData[2] = vGroup; gl_FragData[3] = packDepthToRGBA(fragmentDepth); #else gl_FragColor = vColor; #endif #elif defined(dRenderVariant_depth) gl_FragColor = material; #elif defined(dRenderVariant_marking) gl_FragColor = material; #elif defined(dRenderVariant_emissive) gl_FragColor = material; #elif defined(dRenderVariant_color) || defined(dRenderVariant_tracing) gl_FragColor = material; #include apply_marker_color #if defined(dRenderVariant_color) #include apply_fog #include wboit_write #include dpoit_write #elif defined(dRenderVariant_tracing) gl_FragData[1] = vec4(normalize(vViewPosition), emissive); gl_FragData[2] = vec4(material.rgb, uDensity); #endif #endif } `;