Mask for base layer

This commit is contained in:
luboslenco
2020-02-18 11:47:02 +01:00
parent f281e497d2
commit 3fe791337d
3 changed files with 12 additions and 1 deletions
+9
View File
@@ -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};');