Move cull and texture filter option to viewport menu
This commit is contained in:
@@ -72,7 +72,6 @@ class Config {
|
||||
|
||||
#if arm_painter
|
||||
if (raw.undo_steps == null) raw.undo_steps = 4; // Max steps to keep
|
||||
if (raw.rp_culling == null) raw.rp_culling = true;
|
||||
if (raw.keymap == null) {
|
||||
raw.keymap = {};
|
||||
raw.keymap.action_paint = "left";
|
||||
@@ -229,5 +228,4 @@ typedef TConfig = {
|
||||
@:optional var plugins:Array<String>;
|
||||
@:optional var undo_steps:Null<Int>;
|
||||
@:optional var keymap:Dynamic; // Map<String, String>
|
||||
@:optional var rp_culling:Null<Bool>;
|
||||
}
|
||||
|
||||
@@ -828,7 +828,7 @@ class MaterialBuilder {
|
||||
name: context_id,
|
||||
depth_write: true,
|
||||
compare_mode: 'less',
|
||||
cull_mode: (Config.raw.rp_culling || !isScene) ? 'clockwise' : 'none',
|
||||
cull_mode: (UITrait.inst.cullBackfaces || !isScene) ? 'clockwise' : 'none',
|
||||
vertex_elements: [{name: "pos", data: 'short4norm'},{name: "nor", data: 'short2norm'},{name: "tex", data: 'short2norm'}] });
|
||||
|
||||
var vert = con_mesh.make_vert();
|
||||
@@ -1006,7 +1006,7 @@ class MaterialBuilder {
|
||||
name: context_id,
|
||||
depth_write: true,
|
||||
compare_mode: 'less',
|
||||
cull_mode: Config.raw.rp_culling ? 'clockwise' : 'none',
|
||||
cull_mode: UITrait.inst.cullBackfaces ? 'clockwise' : 'none',
|
||||
vertex_elements: [{name: "pos", data: 'short4norm'},{name: "nor", data: 'short2norm'},{name: "tex", data: 'short2norm'}] });
|
||||
|
||||
var vert = con_mesh.make_vert();
|
||||
|
||||
@@ -147,18 +147,7 @@ class BoxPreferences {
|
||||
var vsyncHandle = Id.handle({selected: Config.raw.window_vsync});
|
||||
Config.raw.window_vsync = ui.check(vsyncHandle, "VSync");
|
||||
if (vsyncHandle.changed) Config.save();
|
||||
var cullHandle = Id.handle({selected: Config.raw.rp_culling});
|
||||
Config.raw.rp_culling = ui.check(cullHandle, "Cull Backfaces");
|
||||
if (cullHandle.changed) {
|
||||
Config.save();
|
||||
MaterialParser.parseMeshMaterial();
|
||||
}
|
||||
var filterHandle = Id.handle({selected: UITrait.inst.textureFilter});
|
||||
UITrait.inst.textureFilter = ui.check(filterHandle, "Filter Textures");
|
||||
if (filterHandle.changed) {
|
||||
MaterialParser.parsePaintMaterial();
|
||||
MaterialParser.parseMeshMaterial();
|
||||
}
|
||||
|
||||
#if (!kha_direct3d12)
|
||||
ui.check(UITrait.inst.hvxao, "Voxel AO");
|
||||
if (ui.isHovered) ui.tooltip("Cone-traced AO and shadows");
|
||||
|
||||
@@ -50,7 +50,7 @@ class UIMenu {
|
||||
menuCommands(ui);
|
||||
}
|
||||
else {
|
||||
var menuItems = [12, 3, 13, 17, 5];
|
||||
var menuItems = [12, 3, 15, 17, 5];
|
||||
if (viewportColorHandle.selected) menuItems[2] += 6;
|
||||
#if (!kha_direct3d12) menuItems[2] += 2; #end
|
||||
var sepw = menuW / ui.SCALE();
|
||||
@@ -152,6 +152,19 @@ class UIMenu {
|
||||
MaterialParser.parseMeshMaterial();
|
||||
}
|
||||
|
||||
var cullHandle = Id.handle({selected: UITrait.inst.cullBackfaces});
|
||||
UITrait.inst.cullBackfaces = ui.check(cullHandle, "Cull Backfaces");
|
||||
if (cullHandle.changed) {
|
||||
MaterialParser.parseMeshMaterial();
|
||||
}
|
||||
|
||||
var filterHandle = Id.handle({selected: UITrait.inst.textureFilter});
|
||||
UITrait.inst.textureFilter = ui.check(filterHandle, "Filter Textures");
|
||||
if (filterHandle.changed) {
|
||||
MaterialParser.parsePaintMaterial();
|
||||
MaterialParser.parseMeshMaterial();
|
||||
}
|
||||
|
||||
UITrait.inst.drawWireframe = ui.check(UITrait.inst.wireframeHandle, "Wireframe");
|
||||
if (UITrait.inst.wireframeHandle.changed) {
|
||||
ui.g.end();
|
||||
|
||||
@@ -90,6 +90,7 @@ class UITrait {
|
||||
public var wireframeHandle = new Handle({selected: false});
|
||||
public var drawTexels = false;
|
||||
public var texelsHandle = new Handle({selected: false});
|
||||
public var cullBackfaces = true;
|
||||
public var textureFilter = true;
|
||||
|
||||
public var ui:Zui;
|
||||
|
||||
Reference in New Issue
Block a user