Improve brush preview

This commit is contained in:
luboslenco
2020-03-10 19:00:03 +01:00
parent f28fd5ecbc
commit 706e460e80
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -98,6 +98,7 @@ class Context {
MaterialParser.parseMeshMaterial();
UITrait.inst.headerHandle.redraws = 2;
UITrait.inst.toolbarHandle.redraws = 2;
ddirty = 3;
var decal = tool == ToolDecal || tool == ToolText;
if (decal) {
@@ -109,7 +110,6 @@ class Context {
}
RenderUtil.makeDecalPreview();
ddirty = 2;
if (current != null) current.begin(false);
}
+10 -1
View File
@@ -29,10 +29,12 @@ class RenderPathPaint {
public static var liveLayer: arm.data.LayerSlot = null;
public static var liveLayerDrawn = 0;
static var _texpaint: RenderTarget;
static var _texpaint_undo: RenderTarget;
static var _texpaint_mask: RenderTarget;
static var _texpaint_nor: RenderTarget;
static var _texpaint_pack: RenderTarget;
static var _texpaint_undo: RenderTarget;
static var _texpaint_nor_undo: RenderTarget;
static var _texpaint_pack_undo: RenderTarget;
public static function init(_path: RenderPath) {
path = _path;
@@ -251,10 +253,15 @@ class RenderPathPaint {
if (use) {
_texpaint = path.renderTargets.get("texpaint" + tid);
_texpaint_undo = path.renderTargets.get("texpaint_undo" + hid);
_texpaint_nor_undo = path.renderTargets.get("texpaint_nor_undo" + hid);
_texpaint_pack_undo = path.renderTargets.get("texpaint_pack_undo" + hid);
_texpaint_mask = path.renderTargets.get("texpaint_mask" + tid);
_texpaint_nor = path.renderTargets.get("texpaint_nor" + tid);
_texpaint_pack = path.renderTargets.get("texpaint_pack" + tid);
path.renderTargets.set("texpaint_undo" + hid, path.renderTargets.get("texpaint" + tid));
path.renderTargets.set("texpaint_nor_undo" + hid, path.renderTargets.get("texpaint_nor" + tid));
path.renderTargets.set("texpaint_pack_undo" + hid, path.renderTargets.get("texpaint_pack" + tid));
path.renderTargets.set("texpaint_undo" + hid, path.renderTargets.get("texpaint" + tid));
path.renderTargets.set("texpaint" + tid, path.renderTargets.get("texpaint_live"));
if (_texpaint_mask != null) path.renderTargets.set("texpaint_mask" + tid, path.renderTargets.get("texpaint_mask_live"));
path.renderTargets.set("texpaint_nor" + tid, path.renderTargets.get("texpaint_nor_live"));
@@ -263,6 +270,8 @@ class RenderPathPaint {
else {
path.renderTargets.set("texpaint" + tid, _texpaint);
path.renderTargets.set("texpaint_undo" + hid, _texpaint_undo);
path.renderTargets.set("texpaint_nor_undo" + hid, _texpaint_nor_undo);
path.renderTargets.set("texpaint_pack_undo" + hid, _texpaint_pack_undo);
if (_texpaint_mask != null) path.renderTargets.set("texpaint_mask" + tid, _texpaint_mask);
path.renderTargets.set("texpaint_nor" + tid, _texpaint_nor);
path.renderTargets.set("texpaint_pack" + tid, _texpaint_pack);