Skip to content
Snippets Groups Projects
Commit b20b80f9 authored by Alexander Rose's avatar Alexander Rose
Browse files

wip, lines

parent b07f9c70
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@ export namespace Lines {
...Geometry.Params,
lineSizeAttenuation: BooleanParam('Line Size Attenuation', '', false),
sizeTheme: SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
sizeValue: NumberParam('Size Value', '', 1, 0, 0.1, 20),
sizeValue: NumberParam('Size Value', '', 1, 0, 10, 0.1),
sizeFactor: NumberParam('Size Factor', '', 1, 0, 10, 0.1),
}
export const DefaultProps = paramDefaultValues(Params)
......
......@@ -12,7 +12,8 @@ import { StructureElementIterator, getElementLoci, markElement } from './util/el
import { computeMarchingCubesLines } from '../../../util/marching-cubes/algorithm';
import { Lines } from '../../../geometry/lines/lines';
import { GaussianDensityProps, GaussianDensityParams } from 'mol-model/structure/structure/unit/gaussian-density';
import { paramDefaultValues } from 'mol-view/parameter';
import { paramDefaultValues, SelectParam, NumberParam, BooleanParam } from 'mol-view/parameter';
import { SizeThemeName, SizeThemeOptions } from 'mol-view/theme/size';
async function createGaussianWireframe(ctx: RuntimeContext, unit: Unit, structure: Structure, props: GaussianDensityProps, lines?: Lines): Promise<Lines> {
const { smoothness } = props
......@@ -33,6 +34,9 @@ async function createGaussianWireframe(ctx: RuntimeContext, unit: Unit, structur
export const GaussianWireframeParams = {
...UnitsLinesParams,
...GaussianDensityParams,
sizeTheme: SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
sizeValue: NumberParam('Size Value', '', 2, 0, 10, 0.1),
lineSizeAttenuation: BooleanParam('Line Size Attenuation', '', false),
}
export const DefaultGaussianWireframeProps = paramDefaultValues(GaussianWireframeParams)
export type GaussianWireframeProps = typeof DefaultGaussianWireframeProps
......
......@@ -60,8 +60,6 @@ void main(){
float size = readFromTexture(tSize, aInstance * float(uGroupCount) + aGroup, uSizeTexDim).r;
#endif
float linewidth = 3.0; // size;
mat4 modelView = uView * uModel * aTransform;
// camera space
......@@ -106,6 +104,14 @@ void main(){
// sign flip
if (aMapping.x < 0.0) offset *= -1.0;
// calculate linewidth
float linewidth;
#ifdef dLineSizeAttenuation
linewidth = size * uPixelRatio * ((uViewportHeight / 2.0) / -start.z) * 5.0;
#else
linewidth = size * uPixelRatio;
#endif
// adjust for linewidth
offset *= linewidth;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment