feat: add render graph driven renderer architecture
Amp-Thread-ID: https://ampcode.com/threads/T-019f9d91-77c1-7206-a60f-ed6554ce92ab Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/** Shared constants for the example application composition. */
|
||||
import type { FxNodeCompositionData } from "@lib/composition/index.js";
|
||||
export const applicationCompatibility = {
|
||||
wildcardInputTypes: ["any"],
|
||||
} as const satisfies FxNodeCompositionData["compatibility"];
|
||||
export const APPLICATION_ID = "fxnode.example.application";
|
||||
export const APPLICATION_VERSION = 4;
|
||||
export const APPLICATION_HEADER_STYLES = {
|
||||
input: {
|
||||
header: "#8b3f72",
|
||||
},
|
||||
converter: {
|
||||
header: "#4f5964",
|
||||
},
|
||||
texture: {
|
||||
header: "#a36b34",
|
||||
},
|
||||
shader: {
|
||||
header: "#3b7551",
|
||||
},
|
||||
output: {
|
||||
header: "#963d3d",
|
||||
},
|
||||
geometry: {
|
||||
header: "#2c7a75",
|
||||
},
|
||||
common: {
|
||||
header: "#555b64",
|
||||
},
|
||||
compositorInput: {
|
||||
header: "#8b3f72",
|
||||
},
|
||||
compositorColor: {
|
||||
header: "#4f5964",
|
||||
},
|
||||
} as const satisfies FxNodeCompositionData["nodeStyles"];
|
||||
export const APPLICATION_RESOURCES = {
|
||||
legacyImage: {
|
||||
kind: "image",
|
||||
title: "Image",
|
||||
openTitle: "Open",
|
||||
accept: ["image/*"],
|
||||
referencePrefix: "fxnode-local-image:",
|
||||
maxBytes: 33554432,
|
||||
maxWidth: 8192,
|
||||
maxHeight: 8192,
|
||||
maxPixels: 16777216,
|
||||
},
|
||||
} as const satisfies FxNodeCompositionData["resources"];
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const frameNode = [
|
||||
"fxnode.common.frame",
|
||||
{
|
||||
version: 1,
|
||||
title: "Frame",
|
||||
behavior: "frame",
|
||||
style: "common",
|
||||
parameters: {},
|
||||
sockets: {},
|
||||
ui: [],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,42 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const groupInputNode = [
|
||||
"fxnode.common.group-input",
|
||||
{
|
||||
version: 1,
|
||||
title: "Group Input",
|
||||
behavior: "standard",
|
||||
style: "input",
|
||||
parameters: {
|
||||
interfaceName: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "Socket",
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
output: {
|
||||
title: "Interface",
|
||||
direction: "output",
|
||||
type: "any",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "interfaceName",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "output",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,42 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const groupOutputNode = [
|
||||
"fxnode.common.group-output",
|
||||
{
|
||||
version: 1,
|
||||
title: "Group Output",
|
||||
behavior: "standard",
|
||||
style: "output",
|
||||
parameters: {
|
||||
interfaceName: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "Socket",
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
input: {
|
||||
title: "Interface",
|
||||
direction: "input",
|
||||
type: "any",
|
||||
maxIncomingLinks: 9007199254740991,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "interfaceName",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "input",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const rerouteNode = [
|
||||
"fxnode.common.reroute",
|
||||
{
|
||||
version: 1,
|
||||
title: "Reroute",
|
||||
behavior: "reroute",
|
||||
style: "common",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
input: {
|
||||
title: "Input",
|
||||
direction: "input",
|
||||
type: "any",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
output: {
|
||||
title: "Output",
|
||||
direction: "output",
|
||||
type: "any",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "input",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "output",
|
||||
},
|
||||
],
|
||||
muteBypass: [["input", "output"]],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,170 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const imageNode = [
|
||||
"fxnode.compositor.image",
|
||||
{
|
||||
version: 1,
|
||||
title: "Image",
|
||||
behavior: "standard",
|
||||
style: "compositorInput",
|
||||
parameters: {
|
||||
image: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "",
|
||||
},
|
||||
},
|
||||
source: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "File",
|
||||
},
|
||||
enum: ["Generated", "File", "Movie", "Sequence", "Multilayer"],
|
||||
},
|
||||
frames: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 1,
|
||||
},
|
||||
minimum: 1,
|
||||
maximum: 1048574,
|
||||
integer: true,
|
||||
},
|
||||
startFrame: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 1,
|
||||
},
|
||||
minimum: -1048574,
|
||||
maximum: 1048574,
|
||||
integer: true,
|
||||
},
|
||||
offset: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
minimum: -1048574,
|
||||
maximum: 1048574,
|
||||
integer: true,
|
||||
},
|
||||
cyclic: {
|
||||
type: "boolean",
|
||||
default: {
|
||||
kind: "boolean",
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
autoRefresh: {
|
||||
type: "boolean",
|
||||
default: {
|
||||
kind: "boolean",
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
image: {
|
||||
title: "Image",
|
||||
direction: "output",
|
||||
type: "color",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
alpha: {
|
||||
title: "Alpha",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
z: {
|
||||
title: "Z",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "resource",
|
||||
resource: "legacyImage",
|
||||
parameter: "image",
|
||||
title: "Image",
|
||||
openTitle: "Open",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "source",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "frames",
|
||||
title: "Frames",
|
||||
visibleWhen: {
|
||||
parameter: "source",
|
||||
in: ["Movie", "Sequence"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "startFrame",
|
||||
title: "Start Frame",
|
||||
visibleWhen: {
|
||||
parameter: "source",
|
||||
in: ["Movie", "Sequence"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "offset",
|
||||
visibleWhen: {
|
||||
parameter: "source",
|
||||
in: ["Movie", "Sequence"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "cyclic",
|
||||
visibleWhen: {
|
||||
parameter: "source",
|
||||
in: ["Movie", "Sequence"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "autoRefresh",
|
||||
title: "Auto Refresh",
|
||||
visibleWhen: {
|
||||
parameter: "source",
|
||||
in: ["Movie", "Sequence"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "image",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "alpha",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "z",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const joinGeometryNode = [
|
||||
"fxnode.geometry.join-geometry",
|
||||
{
|
||||
version: 1,
|
||||
title: "Join Geometry",
|
||||
behavior: "standard",
|
||||
style: "geometry",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
geometry: {
|
||||
title: "Geometry",
|
||||
direction: "input",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 9007199254740991,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
result: {
|
||||
title: "Geometry",
|
||||
direction: "output",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "geometry",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "result",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,116 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const meshCubeNode = [
|
||||
"fxnode.geometry.mesh-cube",
|
||||
{
|
||||
version: 1,
|
||||
title: "Mesh Cube",
|
||||
behavior: "standard",
|
||||
style: "geometry",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
size: {
|
||||
title: "Size",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [1, 1, 1],
|
||||
},
|
||||
minimum: 0,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
"vertices-x": {
|
||||
title: "Vertices X",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 2,
|
||||
},
|
||||
minimum: 2,
|
||||
maximum: 1000,
|
||||
integer: true,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
"vertices-y": {
|
||||
title: "Vertices Y",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 2,
|
||||
},
|
||||
minimum: 2,
|
||||
maximum: 1000,
|
||||
integer: true,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
"vertices-z": {
|
||||
title: "Vertices Z",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 2,
|
||||
},
|
||||
minimum: 2,
|
||||
maximum: 1000,
|
||||
integer: true,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
mesh: {
|
||||
title: "Mesh",
|
||||
direction: "output",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "size",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "vertices-x",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "vertices-y",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "vertices-z",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "mesh",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const positionNode = [
|
||||
"fxnode.geometry.position",
|
||||
{
|
||||
version: 1,
|
||||
title: "Position",
|
||||
behavior: "standard",
|
||||
style: "geometry",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
position: {
|
||||
title: "Position",
|
||||
direction: "output",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "position",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,81 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const setPositionNode = [
|
||||
"fxnode.geometry.set-position",
|
||||
{
|
||||
version: 1,
|
||||
title: "Set Position",
|
||||
behavior: "standard",
|
||||
style: "geometry",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
geometry: {
|
||||
title: "Geometry",
|
||||
direction: "input",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
position: {
|
||||
title: "Position",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
offset: {
|
||||
title: "Offset",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
result: {
|
||||
title: "Geometry",
|
||||
direction: "output",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "geometry",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "position",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "offset",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "result",
|
||||
},
|
||||
],
|
||||
muteBypass: [["geometry", "result"]],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,100 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const transformGeometryNode = [
|
||||
"fxnode.geometry.transform-geometry",
|
||||
{
|
||||
version: 1,
|
||||
title: "Transform Geometry",
|
||||
behavior: "standard",
|
||||
style: "geometry",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
geometry: {
|
||||
title: "Geometry",
|
||||
direction: "input",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
translation: {
|
||||
title: "Translation",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
rotation: {
|
||||
title: "Rotation",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
scale: {
|
||||
title: "Scale",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [1, 1, 1],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
result: {
|
||||
title: "Geometry",
|
||||
direction: "output",
|
||||
type: "geometry",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "geometry",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "translation",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "rotation",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "scale",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "result",
|
||||
},
|
||||
],
|
||||
muteBypass: [["geometry", "result"]],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,127 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const colorRampNode = [
|
||||
"fxnode.shader.color-ramp",
|
||||
{
|
||||
version: 2,
|
||||
title: "Color Ramp",
|
||||
behavior: "standard",
|
||||
style: "shader",
|
||||
parameters: {
|
||||
ramp: {
|
||||
type: "json",
|
||||
codec: "color-ramp/v1",
|
||||
default: {
|
||||
kind: "json",
|
||||
value: {
|
||||
colorMode: "rgb",
|
||||
interpolation: "linear",
|
||||
hueInterpolation: "near",
|
||||
stops: [
|
||||
{
|
||||
id: "stop-0",
|
||||
position: 0,
|
||||
color: [0, 0, 0, 1],
|
||||
},
|
||||
{
|
||||
id: "stop-1",
|
||||
position: 1,
|
||||
color: [1, 1, 1, 1],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
factor: {
|
||||
title: "Factor",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0.5,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
color: {
|
||||
title: "Color",
|
||||
direction: "output",
|
||||
type: "color",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
alpha: {
|
||||
title: "Alpha",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "color",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "alpha",
|
||||
},
|
||||
{
|
||||
kind: "widget",
|
||||
widget: "color-ramp",
|
||||
parameter: "ramp",
|
||||
title: "",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "factor",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [
|
||||
{
|
||||
fromVersion: 1,
|
||||
toVersion: 2,
|
||||
steps: [
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "parameter",
|
||||
key: "ramp",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "factor",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "color",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "alpha",
|
||||
},
|
||||
{
|
||||
kind: "migrate-parameter",
|
||||
parameter: "ramp",
|
||||
codec: "color-ramp/legacy-stops",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,44 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const colorNode = [
|
||||
"fxnode.shader.color",
|
||||
{
|
||||
version: 1,
|
||||
title: "Color",
|
||||
behavior: "standard",
|
||||
style: "shader",
|
||||
parameters: {
|
||||
color: {
|
||||
type: "color",
|
||||
default: {
|
||||
kind: "color",
|
||||
value: [0.8, 0.8, 0.8, 1],
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
color: {
|
||||
title: "Color",
|
||||
direction: "output",
|
||||
type: "color",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "color",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "color",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,157 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const imageTextureNode = [
|
||||
"fxnode.shader.image-texture",
|
||||
{
|
||||
version: 1,
|
||||
title: "Image Texture",
|
||||
behavior: "standard",
|
||||
style: "input",
|
||||
parameters: {
|
||||
image: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "",
|
||||
},
|
||||
},
|
||||
interpolation: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "Linear",
|
||||
},
|
||||
enum: ["Linear", "Closest", "Cubic", "Smart"],
|
||||
},
|
||||
projection: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "Flat",
|
||||
},
|
||||
enum: ["Flat", "Box", "Sphere", "Tube"],
|
||||
},
|
||||
blend: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
extension: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "Repeat",
|
||||
},
|
||||
enum: ["Repeat", "Extend", "Clip", "Mirror"],
|
||||
},
|
||||
colorSpace: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "sRGB",
|
||||
},
|
||||
enum: ["sRGB", "Linear", "Non-Color"],
|
||||
},
|
||||
alphaMode: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "Straight",
|
||||
},
|
||||
enum: ["Straight", "Premultiplied", "Channel Packed", "None"],
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
vector: {
|
||||
title: "Vector",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: false,
|
||||
},
|
||||
color: {
|
||||
title: "Color",
|
||||
direction: "output",
|
||||
type: "color",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
alpha: {
|
||||
title: "Alpha",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "resource",
|
||||
resource: "legacyImage",
|
||||
parameter: "image",
|
||||
title: "Image",
|
||||
openTitle: "Open",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "interpolation",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "projection",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "blend",
|
||||
title: "Blend",
|
||||
visibleWhen: {
|
||||
parameter: "projection",
|
||||
equals: "Box",
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "extension",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "colorSpace",
|
||||
title: "Color Space",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "alphaMode",
|
||||
title: "Alpha Mode",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "vector",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "color",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "alpha",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,62 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const materialOutputNode = [
|
||||
"fxnode.shader.material-output",
|
||||
{
|
||||
version: 1,
|
||||
title: "Material Output",
|
||||
behavior: "standard",
|
||||
style: "output",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
surface: {
|
||||
title: "Surface",
|
||||
direction: "input",
|
||||
type: "shader",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
volume: {
|
||||
title: "Volume",
|
||||
direction: "input",
|
||||
type: "shader",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
displacement: {
|
||||
title: "Displacement",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "surface",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "volume",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "displacement",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,92 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const mathNode = [
|
||||
"fxnode.shader.math",
|
||||
{
|
||||
version: 1,
|
||||
title: "Math",
|
||||
behavior: "standard",
|
||||
style: "converter",
|
||||
parameters: {
|
||||
operation: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "add",
|
||||
},
|
||||
enum: ["add", "subtract", "multiply", "divide", "power", "minimum", "maximum"],
|
||||
},
|
||||
clamp: {
|
||||
type: "boolean",
|
||||
default: {
|
||||
kind: "boolean",
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
a: {
|
||||
title: "A",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
b: {
|
||||
title: "B",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
value: {
|
||||
title: "Value",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "operation",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "clamp",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "a",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "b",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "value",
|
||||
},
|
||||
],
|
||||
muteBypass: [["a", "value"]],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const mixNode = [
|
||||
"fxnode.shader.mix",
|
||||
{
|
||||
version: 1,
|
||||
title: "Mix",
|
||||
behavior: "standard",
|
||||
style: "shader",
|
||||
parameters: {
|
||||
blend: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "mix",
|
||||
},
|
||||
enum: ["mix", "add", "multiply", "screen", "overlay"],
|
||||
},
|
||||
clamp: {
|
||||
type: "boolean",
|
||||
default: {
|
||||
kind: "boolean",
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
factor: {
|
||||
title: "Factor",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0.5,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
a: {
|
||||
title: "A",
|
||||
direction: "input",
|
||||
type: "color",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "color",
|
||||
default: {
|
||||
kind: "color",
|
||||
value: [0.8, 0.8, 0.8, 1],
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
b: {
|
||||
title: "B",
|
||||
direction: "input",
|
||||
type: "color",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "color",
|
||||
default: {
|
||||
kind: "color",
|
||||
value: [0.8, 0.8, 0.8, 1],
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
result: {
|
||||
title: "Result",
|
||||
direction: "output",
|
||||
type: "color",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "blend",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "clamp",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "factor",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "a",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "b",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "result",
|
||||
},
|
||||
],
|
||||
muteBypass: [["a", "result"]],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,364 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const noiseTextureNode = [
|
||||
"fxnode.shader.noise-texture",
|
||||
{
|
||||
version: 2,
|
||||
title: "Noise Texture",
|
||||
behavior: "standard",
|
||||
style: "texture",
|
||||
parameters: {
|
||||
dimensions: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "3d",
|
||||
},
|
||||
enum: ["1d", "2d", "3d", "4d"],
|
||||
},
|
||||
noiseType: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "fbm",
|
||||
},
|
||||
enum: ["fbm", "multifractal", "hybrid-multifractal", "ridged-multifractal", "hetero-terrain"],
|
||||
},
|
||||
normalize: {
|
||||
type: "boolean",
|
||||
default: {
|
||||
kind: "boolean",
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
vector: {
|
||||
title: "Vector",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: false,
|
||||
},
|
||||
w: {
|
||||
title: "W",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
scale: {
|
||||
title: "Scale",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 5,
|
||||
},
|
||||
minimum: -1000,
|
||||
maximum: 1000,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
detail: {
|
||||
title: "Detail",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 2,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 15,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
roughness: {
|
||||
title: "Roughness",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0.5,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
lacunarity: {
|
||||
title: "Lacunarity",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 2,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1000,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
offset: {
|
||||
title: "Offset",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
minimum: -1000,
|
||||
maximum: 1000,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
gain: {
|
||||
title: "Gain",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 1,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1000,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
distortion: {
|
||||
title: "Distortion",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
minimum: -1000,
|
||||
maximum: 1000,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
factor: {
|
||||
title: "Factor",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
color: {
|
||||
title: "Color",
|
||||
direction: "output",
|
||||
type: "color",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "dimensions",
|
||||
title: "Dimensions",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "noiseType",
|
||||
title: "Type",
|
||||
},
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "normalize",
|
||||
title: "Normalize",
|
||||
visibleWhen: {
|
||||
parameter: "noiseType",
|
||||
equals: "fbm",
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "vector",
|
||||
visibleWhen: {
|
||||
parameter: "dimensions",
|
||||
in: ["2d", "3d", "4d"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "w",
|
||||
visibleWhen: {
|
||||
parameter: "dimensions",
|
||||
in: ["1d", "4d"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "scale",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "detail",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "roughness",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "lacunarity",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "offset",
|
||||
visibleWhen: {
|
||||
parameter: "noiseType",
|
||||
in: ["hybrid-multifractal", "ridged-multifractal", "hetero-terrain"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "gain",
|
||||
visibleWhen: {
|
||||
parameter: "noiseType",
|
||||
in: ["hybrid-multifractal", "ridged-multifractal"],
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "distortion",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "factor",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "color",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [
|
||||
{
|
||||
fromVersion: 1,
|
||||
toVersion: 2,
|
||||
steps: [
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "parameter",
|
||||
key: "dimensions",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "parameter",
|
||||
key: "noiseType",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "parameter",
|
||||
key: "normalize",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "vector",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "w",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "scale",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "detail",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "roughness",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "lacunarity",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "offset",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "gain",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "distortion",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "factor",
|
||||
},
|
||||
{
|
||||
kind: "materialize-missing",
|
||||
target: "socket",
|
||||
key: "color",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,154 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const principledBsdfNode = [
|
||||
"fxnode.shader.principled-bsdf",
|
||||
{
|
||||
version: 1,
|
||||
title: "Principled BSDF",
|
||||
behavior: "standard",
|
||||
style: "shader",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
"base-color": {
|
||||
title: "Base Color",
|
||||
direction: "input",
|
||||
type: "color",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "color",
|
||||
default: {
|
||||
kind: "color",
|
||||
value: [0.8, 0.8, 0.8, 1],
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
metallic: {
|
||||
title: "Metallic",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
roughness: {
|
||||
title: "Roughness",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0.5,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
ior: {
|
||||
title: "IOR",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 1.5,
|
||||
},
|
||||
minimum: 1,
|
||||
maximum: 1000,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
alpha: {
|
||||
title: "Alpha",
|
||||
direction: "input",
|
||||
type: "float",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 1,
|
||||
},
|
||||
minimum: 0,
|
||||
maximum: 1,
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
normal: {
|
||||
title: "Normal",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: false,
|
||||
},
|
||||
bsdf: {
|
||||
title: "BSDF",
|
||||
direction: "output",
|
||||
type: "shader",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "base-color",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "metallic",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "roughness",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "ior",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "alpha",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "normal",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "bsdf",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,69 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const textureCoordinateNode = [
|
||||
"fxnode.shader.texture-coordinate",
|
||||
{
|
||||
version: 1,
|
||||
title: "Texture Coordinate",
|
||||
behavior: "standard",
|
||||
style: "shader",
|
||||
parameters: {},
|
||||
sockets: {
|
||||
generated: {
|
||||
title: "Generated",
|
||||
direction: "output",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
normal: {
|
||||
title: "Normal",
|
||||
direction: "output",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
uv: {
|
||||
title: "UV",
|
||||
direction: "output",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
object: {
|
||||
title: "Object",
|
||||
direction: "output",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "generated",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "normal",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "uv",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "object",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const valueNode = [
|
||||
"fxnode.shader.value",
|
||||
{
|
||||
version: 1,
|
||||
title: "Value",
|
||||
behavior: "standard",
|
||||
style: "shader",
|
||||
parameters: {
|
||||
value: {
|
||||
type: "number",
|
||||
default: {
|
||||
kind: "number",
|
||||
value: 0,
|
||||
},
|
||||
step: 1,
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
value: {
|
||||
title: "Value",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "value",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "value",
|
||||
},
|
||||
],
|
||||
muteBypass: [],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,98 @@
|
||||
import type { FxNodeDefinition } from "@lib/composition/index.js";
|
||||
export const vectorMathNode = [
|
||||
"fxnode.shader.vector-math",
|
||||
{
|
||||
version: 1,
|
||||
title: "Vector Math",
|
||||
behavior: "standard",
|
||||
style: "converter",
|
||||
parameters: {
|
||||
operation: {
|
||||
type: "string",
|
||||
default: {
|
||||
kind: "string",
|
||||
value: "add",
|
||||
},
|
||||
enum: ["add", "subtract", "multiply", "dot-product", "length", "normalize"],
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
a: {
|
||||
title: "A",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
b: {
|
||||
title: "B",
|
||||
direction: "input",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 1,
|
||||
visible: true,
|
||||
value: {
|
||||
type: "vector",
|
||||
default: {
|
||||
kind: "vector",
|
||||
value: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
showValue: true,
|
||||
},
|
||||
vector: {
|
||||
title: "Vector",
|
||||
direction: "output",
|
||||
type: "vector",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
value: {
|
||||
title: "Value",
|
||||
direction: "output",
|
||||
type: "float",
|
||||
maxIncomingLinks: 0,
|
||||
visible: true,
|
||||
value: null,
|
||||
showValue: false,
|
||||
},
|
||||
},
|
||||
ui: [
|
||||
{
|
||||
kind: "parameter",
|
||||
parameter: "operation",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "a",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "b",
|
||||
visibleWhen: {
|
||||
parameter: "operation",
|
||||
equals: "add",
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "vector",
|
||||
},
|
||||
{
|
||||
kind: "socket",
|
||||
socket: "value",
|
||||
},
|
||||
],
|
||||
muteBypass: [["a", "vector"]],
|
||||
migrations: [],
|
||||
},
|
||||
] as const satisfies readonly [string, FxNodeDefinition];
|
||||
@@ -0,0 +1,25 @@
|
||||
import type { FxNodeSocketTypeDefinition } from "@lib/composition/index.js";
|
||||
export const anySocket = ["any", { title: "any", color: "#999999", acceptsFrom: ["any"] }] as const satisfies readonly [
|
||||
string,
|
||||
FxNodeSocketTypeDefinition,
|
||||
];
|
||||
export const floatSocket = [
|
||||
"float",
|
||||
{ title: "float", color: "#a8a8a8", acceptsFrom: ["float", "any"] },
|
||||
] as const satisfies readonly [string, FxNodeSocketTypeDefinition];
|
||||
export const vectorSocket = [
|
||||
"vector",
|
||||
{ title: "vector", color: "#6476dc", acceptsFrom: ["vector", "any"] },
|
||||
] as const satisfies readonly [string, FxNodeSocketTypeDefinition];
|
||||
export const colorSocket = [
|
||||
"color",
|
||||
{ title: "color", color: "#d7ca63", acceptsFrom: ["color", "any"] },
|
||||
] as const satisfies readonly [string, FxNodeSocketTypeDefinition];
|
||||
export const shaderSocket = [
|
||||
"shader",
|
||||
{ title: "shader", color: "#62b34f", acceptsFrom: ["shader", "any"] },
|
||||
] as const satisfies readonly [string, FxNodeSocketTypeDefinition];
|
||||
export const geometrySocket = [
|
||||
"geometry",
|
||||
{ title: "geometry", color: "#00bfa5", acceptsFrom: ["geometry", "any"] },
|
||||
] as const satisfies readonly [string, FxNodeSocketTypeDefinition];
|
||||
Reference in New Issue
Block a user