Mask for base layer
This commit is contained in:
@@ -183,6 +183,15 @@ class MakeMesh {
|
||||
frag.write('metallic = 0.0;');
|
||||
}
|
||||
|
||||
if (l.texpaint_mask != null) {
|
||||
frag.add_shared_sampler('sampler2D texpaint_mask');
|
||||
frag.write('float maskTexture = textureLodShared(texpaint_mask, texCoord, 0.0).r;');
|
||||
frag.write('basecol *= maskTexture;');
|
||||
frag.write('occlusion *= maskTexture;');
|
||||
frag.write('roughness *= maskTexture;');
|
||||
frag.write('metallic *= maskTexture;');
|
||||
}
|
||||
|
||||
if (l.maskOpacity < 1) {
|
||||
frag.write('basecol *= ${l.maskOpacity};');
|
||||
frag.write('occlusion *= ${l.maskOpacity};');
|
||||
|
||||
@@ -508,6 +508,9 @@ class RenderPathPaint {
|
||||
path.bindTarget("texpaint" + tid, "texpaint");
|
||||
path.bindTarget("texpaint_nor" + tid, "texpaint_nor");
|
||||
path.bindTarget("texpaint_pack" + tid, "texpaint_pack");
|
||||
if (Project.layers[0].texpaint_mask != null) {
|
||||
path.bindTarget("texpaint_mask" + tid, "texpaint_mask");
|
||||
}
|
||||
for (i in 1...Project.layers.length) {
|
||||
var l = Project.layers[i];
|
||||
tid = l.id;
|
||||
|
||||
@@ -330,7 +330,6 @@ class Uniforms {
|
||||
}
|
||||
if (link.startsWith("_texpaint_mask")) {
|
||||
var tid = Std.parseInt(link.substr(link.length - 1));
|
||||
trace(tid);
|
||||
return Project.layers[tid].texpaint_mask;
|
||||
}
|
||||
if (link.startsWith("_texpaint_nor")) {
|
||||
|
||||
Reference in New Issue
Block a user