Arrange nodes
This commit is contained in:
+19
-12
@@ -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.type == "OUTPUT_MATERIAL_PBR") { nout = n; break; }
|
||||||
for (n in canvas.nodes) if (n.name == "RGB") { nodes.removeNode(n, canvas); break; }
|
for (n in canvas.nodes) if (n.name == "RGB") { nodes.removeNode(n, canvas); break; }
|
||||||
|
|
||||||
|
var pos = 0;
|
||||||
if (mapbase != "") {
|
if (mapbase != "") {
|
||||||
var n = NodeCreator.createImageTexture();
|
var n = NodeCreator.createImageTexture();
|
||||||
n.buttons[0].default_value = getAssetIndex(mapbase);
|
n.buttons[0].default_value = getAssetIndex(mapbase);
|
||||||
n.x = 0;
|
n.x = 72;
|
||||||
n.y = 0;
|
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 };
|
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);
|
canvas.links.push(l);
|
||||||
}
|
}
|
||||||
if (mapocc != "") {
|
if (mapocc != "") {
|
||||||
var n = NodeCreator.createImageTexture();
|
var n = NodeCreator.createImageTexture();
|
||||||
n.buttons[0].default_value = getAssetIndex(mapocc);
|
n.buttons[0].default_value = getAssetIndex(mapocc);
|
||||||
n.x = 0;
|
n.x = 72;
|
||||||
n.y = 50;
|
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 };
|
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);
|
canvas.links.push(l);
|
||||||
}
|
}
|
||||||
if (maprough != "") {
|
if (maprough != "") {
|
||||||
var n = NodeCreator.createImageTexture();
|
var n = NodeCreator.createImageTexture();
|
||||||
n.buttons[0].default_value = getAssetIndex(maprough);
|
n.buttons[0].default_value = getAssetIndex(maprough);
|
||||||
n.x = 0;
|
n.x = 72;
|
||||||
n.y = 100;
|
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 };
|
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);
|
canvas.links.push(l);
|
||||||
}
|
}
|
||||||
if (mapmet != "") {
|
if (mapmet != "") {
|
||||||
var n = NodeCreator.createImageTexture();
|
var n = NodeCreator.createImageTexture();
|
||||||
n.buttons[0].default_value = getAssetIndex(mapmet);
|
n.buttons[0].default_value = getAssetIndex(mapmet);
|
||||||
n.x = 0;
|
n.x = 72;
|
||||||
n.y = 150;
|
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 };
|
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);
|
canvas.links.push(l);
|
||||||
}
|
}
|
||||||
if (mapnor != "") {
|
if (mapnor != "") {
|
||||||
var n = NodeCreator.createImageTexture();
|
var n = NodeCreator.createImageTexture();
|
||||||
n.buttons[0].default_value = getAssetIndex(mapnor);
|
n.buttons[0].default_value = getAssetIndex(mapnor);
|
||||||
n.x = 0;
|
n.x = 72;
|
||||||
n.y = 200;
|
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 };
|
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);
|
canvas.links.push(l);
|
||||||
}
|
}
|
||||||
if (mapheight != "") {
|
if (mapheight != "") {
|
||||||
var n = NodeCreator.createImageTexture();
|
var n = NodeCreator.createImageTexture();
|
||||||
n.buttons[0].default_value = getAssetIndex(mapheight);
|
n.buttons[0].default_value = getAssetIndex(mapheight);
|
||||||
n.x = 0;
|
n.x = 72;
|
||||||
n.y = 250;
|
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 };
|
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);
|
canvas.links.push(l);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -695,7 +695,7 @@ class UINodes extends iron.Trait {
|
|||||||
var occ = sout.out_occlusion;
|
var occ = sout.out_occlusion;
|
||||||
var opac = sout.out_opacity;
|
var opac = sout.out_opacity;
|
||||||
var nortan = Cycles.out_normaltan;
|
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 roughness = $rough;');
|
||||||
frag.write('float metallic = $met;');
|
frag.write('float metallic = $met;');
|
||||||
frag.write('float occlusion = $occ;');
|
frag.write('float occlusion = $occ;');
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user