Add picker material node

This commit is contained in:
luboslenco
2021-01-29 17:46:20 +01:00
parent bdd31c2677
commit b6b75b26b8
4 changed files with 143 additions and 0 deletions
+2
View File
@@ -67,9 +67,11 @@ class Context {
public static var normalRPicked = 0.0;
public static var normalGPicked = 0.0;
public static var normalBPicked = 0.0;
public static var opacityPicked = 0.0;
public static var roughnessPicked = 0.0;
public static var metallicPicked = 0.0;
public static var occlusionPicked = 0.0;
public static var heightPicked = 0.0;
public static var materialIdPicked = 0;
public static var uvxPicked = 0.0;
public static var uvyPicked = 0.0;
+25
View File
@@ -100,6 +100,21 @@ class Uniforms {
case "_decalLayerDim": {
return Context.layer.decalMat.getScale().z * 0.5;
}
case "_pickerOpacity": {
return Context.opacityPicked;
}
case "_pickerOcclusion": {
return Context.occlusionPicked;
}
case "_pickerRoughness": {
return Context.roughnessPicked;
}
case "_pickerMetallic": {
return Context.metallicPicked;
}
case "_pickerHeight": {
return Context.heightPicked;
}
}
if (MaterialParser.script_links != null) {
for (key in MaterialParser.script_links.keys()) {
@@ -181,6 +196,16 @@ class Uniforms {
v.set(Context.layer.decalMat._20, Context.layer.decalMat._21, Context.layer.decalMat._22).normalize();
return v;
}
case "_pickerBase": {
v = iron.object.Uniforms.helpVec;
v.set(Context.baseRPicked, Context.baseGPicked, Context.baseBPicked);
return v;
}
case "_pickerNormal": {
v = iron.object.Uniforms.helpVec;
v.set(Context.normalRPicked, Context.normalGPicked, Context.normalBPicked);
return v;
}
}
return v;