Apply mask to height
This commit is contained in:
@@ -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);');
|
||||
}
|
||||
|
||||
@@ -338,6 +338,10 @@ class Uniforms {
|
||||
var tid = link.substr(link.length - 1);
|
||||
return RenderPath.active.renderTargets.get("texpaint_pack" + tid).image;
|
||||
}
|
||||
if (link.startsWith("_texpaint_mask_vert")) {
|
||||
var tid = Std.parseInt(link.substr(link.length - 1));
|
||||
return Project.layers[tid].texpaint_mask;
|
||||
}
|
||||
|
||||
if (link == "_texpaint_mask") {
|
||||
return Context.layer.texpaint_mask;
|
||||
|
||||
Reference in New Issue
Block a user