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

more quality levels

parent e09e25b7
No related branches found
No related tags found
No related merge requests found
...@@ -86,9 +86,11 @@ export const VisualQualityInfo = { ...@@ -86,9 +86,11 @@ export const VisualQualityInfo = {
'custom': {}, 'custom': {},
'auto': {}, 'auto': {},
'highest': {}, 'highest': {},
'higher': {},
'high': {}, 'high': {},
'medium': {}, 'medium': {},
'low': {}, 'low': {},
'lower': {},
'lowest': {}, 'lowest': {},
} }
export type VisualQuality = keyof typeof VisualQualityInfo export type VisualQuality = keyof typeof VisualQualityInfo
......
...@@ -21,19 +21,23 @@ export function getQualityProps(props: Partial<QualityProps>, structure?: Struct ...@@ -21,19 +21,23 @@ export function getQualityProps(props: Partial<QualityProps>, structure?: Struct
let detail = defaults(props.detail, 1) let detail = defaults(props.detail, 1)
let radialSegments = defaults(props.radialSegments, 12) let radialSegments = defaults(props.radialSegments, 12)
let linearSegments = defaults(props.linearSegments, 8) let linearSegments = defaults(props.linearSegments, 8)
let resolution = defaults(props.resolution, 1) let resolution = defaults(props.resolution, 2)
if (quality === 'auto' && structure) { if (quality === 'auto' && structure) {
let score = structure.elementCount let score = structure.elementCount
if (structure.isCoarse) score *= 10 if (structure.isCoarse) score *= 10
if (score > 500_000) { if (score > 500_000) {
quality = 'lowest' quality = 'lowest'
} else if (score > 300_000) {
quality = 'lower'
} else if (score > 100_000) { } else if (score > 100_000) {
quality = 'low' quality = 'low'
} else if (score > 30_000) { } else if (score > 30_000) {
quality = 'medium' quality = 'medium'
} else { } else if (score > 2_000) {
quality = 'high' quality = 'high'
} else {
quality = 'higher'
} }
} }
...@@ -42,19 +46,25 @@ export function getQualityProps(props: Partial<QualityProps>, structure?: Struct ...@@ -42,19 +46,25 @@ export function getQualityProps(props: Partial<QualityProps>, structure?: Struct
detail = 3 detail = 3
radialSegments = 36 radialSegments = 36
linearSegments = 18 linearSegments = 18
resolution = 0.3
break
case 'higher':
detail = 3
radialSegments = 28
linearSegments = 14
resolution = 0.5 resolution = 0.5
break break
case 'high': case 'high':
detail = 2 detail = 2
radialSegments = 24 radialSegments = 20
linearSegments = 12 linearSegments = 10
resolution = 1.0 resolution = 1.0
break break
case 'medium': case 'medium':
detail = 1 detail = 1
radialSegments = 12 radialSegments = 12
linearSegments = 8 linearSegments = 8
resolution = 1.5 resolution = 2.0
break break
case 'low': case 'low':
detail = 0 detail = 0
...@@ -62,11 +72,17 @@ export function getQualityProps(props: Partial<QualityProps>, structure?: Struct ...@@ -62,11 +72,17 @@ export function getQualityProps(props: Partial<QualityProps>, structure?: Struct
linearSegments = 3 linearSegments = 3
resolution = 3 resolution = 3
break break
case 'lower':
detail = 0
radialSegments = 8
linearSegments = 3
resolution = 5
break
case 'lowest': case 'lowest':
detail = 0 detail = 0
radialSegments = 4 radialSegments = 4
linearSegments = 2 linearSegments = 2
resolution = 6 resolution = 8
break break
case 'custom': case 'custom':
// use defaults or given props as set above // use defaults or given props as set above
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment