Draw grayscale mask

This commit is contained in:
luboslenco
2020-01-11 10:39:14 +01:00
parent 7cc4a709a4
commit 951cc71ac4
2 changed files with 15 additions and 5 deletions
+5
View File
@@ -133,7 +133,12 @@ class TabLayers {
var uiy = ui._y;
ui._x += Std.int(4 * ui.SCALE());
ui._y += 3;
ui.g.pipeline = UIView2D.inst.pipe;
ui.currentWindow.texture.g4.setInt(UIView2D.inst.channelLocation, 1);
var state = ui.image(l.texpaint_mask_preview, 0xffffffff, (ui.ELEMENT_H() - 3) * 2);
ui.g.pipeline = null;
ui._x -= Std.int(4 * ui.SCALE());
ui._y -= 3;
if (ui.isHovered) {
+10 -5
View File
@@ -28,8 +28,8 @@ class UIView2D {
public var panX = 0.0;
public var panY = 0.0;
public var panScale = 1.0;
var pipe: PipelineState;
var channelLocation: ConstantLocation;
public var pipe: PipelineState;
public var channelLocation: ConstantLocation;
var texType = TexBase;
var uvmapShow = false;
@@ -107,6 +107,7 @@ class UIView2D {
l.texpaint_pack;
channel =
Context.layerIsMask ? 1 :
texType == TexOcclusion ? 1 :
texType == TexRoughness ? 2 :
texType == TexMetallic ? 3 :
@@ -182,9 +183,13 @@ class UIView2D {
ui._x = 2;
ui._y = 2;
ui._w = ew;
texType = ui.combo(Id.handle({position: texType}), ["Base Color", "Normal Map", "Occlusion", "Roughness", "Metallic"], "Texture");
ui._x += ew + 3;
ui._y = 2;
if (!Context.layerIsMask) {
texType = ui.combo(Id.handle({position: texType}), ["Base Color", "Normal Map", "Occlusion", "Roughness", "Metallic"], "Texture");
ui._x += ew + 3;
ui._y = 2;
}
uvmapShow = ui.check(Id.handle({selected: uvmapShow}), "UV Map");
ui._x += ew + 3;
ui._y = 2;