add ability to switch between flat/fast and shiny/slow slice render methods
This commit is contained in:
parent
5005bc9a0e
commit
a8bbedf435
5 changed files with 19 additions and 2 deletions
|
|
@ -680,6 +680,7 @@ const conf = exports({
|
||||||
controller:{
|
controller:{
|
||||||
view: null,
|
view: null,
|
||||||
dark: false,
|
dark: false,
|
||||||
|
shiny: false,
|
||||||
decals: true,
|
decals: true,
|
||||||
danger: false,
|
danger: false,
|
||||||
zoomSpeed: 1.0,
|
zoomSpeed: 1.0,
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
if (control.antiAlias != ui.antiAlias.checked) {
|
if (control.antiAlias != ui.antiAlias.checked) {
|
||||||
api.show.alert('Page Reload Required to Change Aliasing');
|
api.show.alert('Page Reload Required to Change Aliasing');
|
||||||
}
|
}
|
||||||
|
control.shiny = ui.shiny.checked;
|
||||||
control.decals = ui.decals.checked;
|
control.decals = ui.decals.checked;
|
||||||
control.danger = ui.danger.checked;
|
control.danger = ui.danger.checked;
|
||||||
control.showOrigin = ui.showOrigin.checked;
|
control.showOrigin = ui.showOrigin.checked;
|
||||||
|
|
@ -1756,6 +1757,7 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
showRulers: uc.newBoolean(LANG.op_shru_s, booleanSave, {title:LANG.op_shru_l}),
|
showRulers: uc.newBoolean(LANG.op_shru_s, booleanSave, {title:LANG.op_shru_l}),
|
||||||
showSpeeds: uc.newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}),
|
showSpeeds: uc.newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}),
|
||||||
decals: uc.newBoolean(LANG.op_decl_s, booleanSave, {title:LANG.op_decl_s}),
|
decals: uc.newBoolean(LANG.op_decl_s, booleanSave, {title:LANG.op_decl_s}),
|
||||||
|
shiny: uc.newBoolean(LANG.op_shny_s, booleanSave, {title:LANG.op_shny_l, modes:FDM}),
|
||||||
lineType: uc.newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"),
|
lineType: uc.newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"),
|
||||||
animesh: uc.newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"),
|
animesh: uc.newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"),
|
||||||
units: uc.newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM, trace:true}, "units"),
|
units: uc.newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM, trace:true}, "units"),
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,13 @@ gapp.register("kiri.stack", [], (root, exports) => {
|
||||||
const { kiri } = root;
|
const { kiri } = root;
|
||||||
|
|
||||||
class Stack {
|
class Stack {
|
||||||
constructor(view, freeMem) {
|
constructor(view, freeMem, shiny) {
|
||||||
this._view = view;
|
this._view = view;
|
||||||
this.view = view.newGroup();
|
this.view = view.newGroup();
|
||||||
this.slices = [];
|
this.slices = [];
|
||||||
this.meshes = [];
|
this.meshes = [];
|
||||||
this.freeMem = freeMem;
|
this.freeMem = freeMem;
|
||||||
|
newMat = shiny ? createPhongMaterial : createLambertMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
size() {
|
size() {
|
||||||
|
|
@ -259,4 +260,15 @@ function createPhongMaterial(color, flat) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createLambertMaterial(color, flat) {
|
||||||
|
return new THREE.MeshLambertMaterial({
|
||||||
|
// shininess,
|
||||||
|
// specular,
|
||||||
|
transparent: color.opacity != 1,
|
||||||
|
opacity: color.opacity || 1,
|
||||||
|
color: color.face,
|
||||||
|
side: flat ? THREE.DoubleSide : THREE.FrontSide
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ function create(name, view) {
|
||||||
}
|
}
|
||||||
const stack = stacks[name] = {
|
const stack = stacks[name] = {
|
||||||
layers: [ ],
|
layers: [ ],
|
||||||
obj: new kiri.Stack(view, freeMem),
|
obj: new kiri.Stack(view, freeMem, kiri.api.conf.get().controller.shiny),
|
||||||
add: function(layers) {
|
add: function(layers) {
|
||||||
let lmap = layers.layers;
|
let lmap = layers.layers;
|
||||||
let map = stack.obj.addLayers(layers);
|
let map = stack.obj.addLayers(layers);
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,8 @@ self.kiri.lang['en-us'] = {
|
||||||
op_xprt_l: "show more settings options",
|
op_xprt_l: "show more settings options",
|
||||||
op_decl_s: "show decals",
|
op_decl_s: "show decals",
|
||||||
op_decl_l: "show device decals and logos",
|
op_decl_l: "show device decals and logos",
|
||||||
|
op_shny_s: "detail render",
|
||||||
|
op_shny_l: "choose a slice render method that is slower and uses specular highlighting. this makes it easier to see detail in some models at the expense of render speed",
|
||||||
op_dang_s: "experimental",
|
op_dang_s: "experimental",
|
||||||
op_dang_l: "show experimental parameters",
|
op_dang_l: "show experimental parameters",
|
||||||
op_devl_s: "developer",
|
op_devl_s: "developer",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue