Make decal layers usable
This commit is contained in:
@@ -42,14 +42,13 @@ class LineDraw {
|
||||
|
||||
public static function render(g4: kha.graphics4.Graphics) {
|
||||
|
||||
return; ////
|
||||
|
||||
var hide = Operator.shortcut(Config.keymap.stencil_hide, ShortcutDown);
|
||||
var isPaint = UIHeader.inst.worktab.position == SpacePaint;
|
||||
var isDecal = isPaint && Context.layer.fill_layer != null && Context.layer.uvType == UVProject;
|
||||
if (!isDecal) return;
|
||||
if (!isDecal || hide) return;
|
||||
|
||||
mat = Context.layer.decalMat;
|
||||
dim = Context.layer.decalDim;
|
||||
dim = Context.layer.decalMat.getScale();
|
||||
|
||||
g = g4;
|
||||
|
||||
|
||||
@@ -97,6 +97,9 @@ class Uniforms {
|
||||
case "_dilateRadius": {
|
||||
return UVUtil.dilatemap != null ? Config.raw.dilate_radius : 0.0;
|
||||
}
|
||||
case "_decalLayerDim": {
|
||||
return Context.layer.decalMat.getScale().z * 0.5;
|
||||
}
|
||||
}
|
||||
if (MaterialParser.script_links != null) {
|
||||
for (key in MaterialParser.script_links.keys()) {
|
||||
@@ -173,6 +176,11 @@ class Uniforms {
|
||||
v.set(Context.layer.decalMat._30, Context.layer.decalMat._31, Context.layer.decalMat._32);
|
||||
return v;
|
||||
}
|
||||
case "_decalLayerNor": {
|
||||
v = iron.object.Uniforms.helpVec;
|
||||
v.set(Context.layer.decalMat._20, Context.layer.decalMat._21, Context.layer.decalMat._22).normalize();
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
return v;
|
||||
|
||||
Reference in New Issue
Block a user