[lab] Auto-apply displacement

This commit is contained in:
luboslenco
2023-09-18 13:35:09 +02:00
parent 4c012939f3
commit 9ea17f22bc
4 changed files with 36 additions and 5 deletions
+2 -1
View File
@@ -79,7 +79,8 @@ class TabMeshes {
MeshUtil.applyDisplacement(Project.layers[0].texpaint_pack);
#end
#if is_lab
MeshUtil.applyDisplacement(arm.logic.BrushOutputNode.inst.texpaint_pack, 0.05, Context.raw.brushScale);
var displace_strength = Config.raw.displace_strength > 0 ? Config.raw.displace_strength : 1.0;
MeshUtil.applyDisplacement(arm.logic.BrushOutputNode.inst.texpaint_pack, 0.05 * displace_strength, Context.raw.brushScale);
#end
MeshUtil.calcNormals();
+1 -1
View File
@@ -163,7 +163,7 @@ class UIView2D {
#end
}
#if (is_paint || is_sculpt)
#if is_paint
else if (type == View2DLayer) {
var layer = l;
-1
View File
@@ -348,7 +348,6 @@ class MeshUtil {
g.vertexBuffer.unlock();
var va0 = o.data.raw.vertex_arrays[0].values;
var va1 = o.data.raw.vertex_arrays[1].values;
for (i in 0...Std.int(vertices.byteLength / 4 / l)) {
va0[i * 4 ] = vertices.getInt16((i * l ) * 2);
va0[i * 4 + 1] = vertices.getInt16((i * l + 1) * 2);