Material mode
This commit is contained in:
@@ -137,7 +137,7 @@ class Layers {
|
||||
UITrait.inst.pipe.inputLayout = [vs];
|
||||
UITrait.inst.pipe.blendSource = kha.graphics4.BlendingFactor.SourceAlpha;
|
||||
UITrait.inst.pipe.blendDestination = kha.graphics4.BlendingFactor.InverseSourceAlpha;
|
||||
UITrait.inst.pipe.colorWriteMaskAlpha = false;
|
||||
UITrait.inst.pipe.colorWriteMaskAlpha = false; // TODO: use texpaint.a to merge all layer channels instead
|
||||
UITrait.inst.pipe.compile();
|
||||
}
|
||||
|
||||
|
||||
@@ -188,6 +188,10 @@ class RenderPathDeferred {
|
||||
return;
|
||||
}
|
||||
|
||||
// Match projection matrix jitter
|
||||
@:privateAccess iron.Scene.active.camera.frame = taaFrame;
|
||||
@:privateAccess iron.Scene.active.camera.projectionJitter();
|
||||
|
||||
var tid = UITrait.inst.selectedLayer.id;
|
||||
|
||||
if (UITrait.inst.pushUndo) {
|
||||
|
||||
@@ -464,7 +464,7 @@ class UINodes extends iron.Trait {
|
||||
}
|
||||
|
||||
public function parseMeshMaterial() {
|
||||
if (UITrait.inst.worktab.position == 1) return;
|
||||
if (UITrait.inst.worktab.position == 1 || UITrait.inst.worktab.position == 2) return;
|
||||
var m = UITrait.inst.materials[0].data;
|
||||
// iron.data.Data.getMaterial("Scene", "Material", function(m:iron.data.MaterialData) {
|
||||
var sc:ShaderContext = null;
|
||||
@@ -484,6 +484,10 @@ class UINodes extends iron.Trait {
|
||||
public function parseMeshPreviewMaterial() {
|
||||
if (!getMOut()) return;
|
||||
|
||||
if (UITrait.inst.worktab.position == 2) { // Material
|
||||
UITrait.inst.rdirty = 1;
|
||||
}
|
||||
|
||||
var m = UITrait.inst.worktab.position == 1 ? UITrait.inst.selectedMaterial2.data : UITrait.inst.materials[0].data;
|
||||
// iron.data.Data.getMaterial("Scene", "Material", function(m:iron.data.MaterialData) {
|
||||
|
||||
|
||||
@@ -1200,6 +1200,7 @@ class UITrait extends iron.Trait {
|
||||
if (ui.window(workspaceHandle, panelx, 0, kha.System.windowWidth() - windowW - menubarw, Std.int((ui.t.ELEMENT_H + 2) * ui.SCALE))) {
|
||||
ui.tab(worktab, "Paint");
|
||||
ui.tab(worktab, "Scene");
|
||||
ui.tab(worktab, "Material");
|
||||
if (worktab.changed) {
|
||||
ddirty = 2;
|
||||
toolbarHandle.redraws = 2;
|
||||
@@ -1207,6 +1208,14 @@ class UITrait extends iron.Trait {
|
||||
if (worktab.position == 1) {
|
||||
selectTool(ToolGizmo);
|
||||
}
|
||||
else if (worktab.position == 2) {
|
||||
UINodes.inst.parseMeshPreviewMaterial();
|
||||
mainObject().skip_context = "paint";
|
||||
}
|
||||
else if (worktab.position == 0) {
|
||||
UINodes.inst.parseMeshMaterial();
|
||||
mainObject().skip_context = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2367,3 +2376,9 @@ class UITrait extends iron.Trait {
|
||||
@:enum abstract SceneTool(Int) from Int to Int {
|
||||
var ToolGizmo = 0;
|
||||
}
|
||||
|
||||
@:enum abstract WorkMode(Int) from Int to Int {
|
||||
var ModePaint = 0;
|
||||
var ModeScene = 1;
|
||||
var ModeMaterial = 2;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ class RenderUtil {
|
||||
var savedProbe = probe.raw.strength;
|
||||
probe.raw.strength = 2;
|
||||
iron.Scene.active.world.envmap = UITrait.inst.previewEnvmap;
|
||||
|
||||
// No jitter
|
||||
// @:privateAccess iron.Scene.active.camera.frame = 0;
|
||||
// No resize
|
||||
|
||||
Reference in New Issue
Block a user