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);');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user