Apply mask to height

This commit is contained in:
luboslenco
2020-03-19 22:25:22 +01:00
parent f373b6c4a6
commit 3f0531757a
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -39,6 +39,10 @@ class MakeMesh {
numLayers++;
vert.add_uniform('sampler2D texpaint_pack_vert' + l.id, '_texpaint_pack_vert' + l.id);
vert.write('height += textureLod(texpaint_pack_vert' + l.id + ', tex, 0.0).a;');
if (l.texpaint_mask != null) {
vert.add_uniform('sampler2D texpaint_mask_vert' + l.id, '_texpaint_mask_vert' + l.id);
vert.write('height *= textureLod(texpaint_mask_vert' + l.id + ', tex, 0.0).r;');
}
}
vert.write('wposition += wnormal * vec3(height, height, height) * vec3($displaceStrength, $displaceStrength, $displaceStrength);');
}