Arrange nodes

This commit is contained in:
luboslenco
2018-10-18 16:47:41 +02:00
parent af79734de7
commit 6a99e44a89
3 changed files with 20 additions and 13 deletions
+19 -12
View File
@@ -271,51 +271,58 @@ class App {
for (n in canvas.nodes) if (n.type == "OUTPUT_MATERIAL_PBR") { nout = n; break; }
for (n in canvas.nodes) if (n.name == "RGB") { nodes.removeNode(n, canvas); break; }
var pos = 0;
if (mapbase != "") {
var n = NodeCreator.createImageTexture();
n.buttons[0].default_value = getAssetIndex(mapbase);
n.x = 0;
n.y = 0;
n.x = 72;
n.y = 192 + 130 * pos;
pos++;
var l = { id: nodes.getLinkId(canvas.links), from_id: n.id, from_socket: 0, to_id: nout.id, to_socket: 0 };
canvas.links.push(l);
}
if (mapocc != "") {
var n = NodeCreator.createImageTexture();
n.buttons[0].default_value = getAssetIndex(mapocc);
n.x = 0;
n.y = 50;
n.x = 72;
n.y = 192 + 130 * pos;
pos++;
var l = { id: nodes.getLinkId(canvas.links), from_id: n.id, from_socket: 0, to_id: nout.id, to_socket: 2 };
canvas.links.push(l);
}
if (maprough != "") {
var n = NodeCreator.createImageTexture();
n.buttons[0].default_value = getAssetIndex(maprough);
n.x = 0;
n.y = 100;
n.x = 72;
n.y = 192 + 130 * pos;
pos++;
var l = { id: nodes.getLinkId(canvas.links), from_id: n.id, from_socket: 0, to_id: nout.id, to_socket: 3 };
canvas.links.push(l);
}
if (mapmet != "") {
var n = NodeCreator.createImageTexture();
n.buttons[0].default_value = getAssetIndex(mapmet);
n.x = 0;
n.y = 150;
n.x = 72;
n.y = 192 + 130 * pos;
pos++;
var l = { id: nodes.getLinkId(canvas.links), from_id: n.id, from_socket: 0, to_id: nout.id, to_socket: 4 };
canvas.links.push(l);
}
if (mapnor != "") {
var n = NodeCreator.createImageTexture();
n.buttons[0].default_value = getAssetIndex(mapnor);
n.x = 0;
n.y = 200;
n.x = 72;
n.y = 192 + 130 * pos;
pos++;
var l = { id: nodes.getLinkId(canvas.links), from_id: n.id, from_socket: 0, to_id: nout.id, to_socket: 5 };
canvas.links.push(l);
}
if (mapheight != "") {
var n = NodeCreator.createImageTexture();
n.buttons[0].default_value = getAssetIndex(mapheight);
n.x = 0;
n.y = 250;
n.x = 72;
n.y = 192 + 130 * pos;
pos++;
var l = { id: nodes.getLinkId(canvas.links), from_id: n.id, from_socket: 0, to_id: nout.id, to_socket: 7 };
canvas.links.push(l);
}
+1 -1
View File
@@ -695,7 +695,7 @@ class UINodes extends iron.Trait {
var occ = sout.out_occlusion;
var opac = sout.out_opacity;
var nortan = Cycles.out_normaltan;
frag.write('vec3 basecol = $base;');
frag.write('vec3 basecol = pow($base, vec3(2.2));');
frag.write('float roughness = $rough;');
frag.write('float metallic = $met;');
frag.write('float occlusion = $occ;');
BIN
View File
Binary file not shown.