1 |
- {"objects":{"72":{"x":1534,"y":591,"elements":[73,75],"autoResize":true,"source":"layout = {\n\tname: 'Teapot Scene',\n\twidth: 300,\n\telements: [\n\t\t{ name: 'Material', inputType: 'Material' }\n\t]\n};\n\nfunction load() {\n\n\tasync function asyncLoad() {\n\n\t\tconst { TeapotGeometry } = await import( 'three/addons/geometries/TeapotGeometry.js' );\n\n\t\tconst geometryTeapot = new TeapotGeometry( 1, 18 );\n\t\tconst mesh = new THREE.Mesh( geometryTeapot );\n\n\t\tlocal.set( 'mesh', mesh );\n\n\t\trefresh();\n\n\t}\n\n\tasyncLoad();\n\n}\n\nfunction main() {\n\n\tconst mesh = local.get( 'mesh', load );\n\n\tif ( mesh ) {\n\n\t\tmesh.material = parameters.get( 'Material' ) || new THREE.MeshBasicMaterial();\n\n\t}\n\n\treturn mesh;\n\n}\n","id":72,"type":"NodePrototypeEditor"},"73":{"outputLength":1,"height":null,"title":"Node Prototype","icon":"ti ti-ti ti-components","id":73,"type":"TitleElement"},"75":{"height":758,"source":"layout = {\n\tname: 'Teapot Scene',\n\twidth: 300,\n\telements: [\n\t\t{ name: 'Material', inputType: 'Material' }\n\t]\n};\n\nfunction load() {\n\n\tasync function asyncLoad() {\n\n\t\tconst { TeapotGeometry } = await import( 'three/addons/geometries/TeapotGeometry.js' );\n\n\t\tconst geometryTeapot = new TeapotGeometry( 1, 18 );\n\t\tconst mesh = new THREE.Mesh( geometryTeapot );\n\n\t\tlocal.set( 'mesh', mesh );\n\n\t\trefresh();\n\n\t}\n\n\tasyncLoad();\n\n}\n\nfunction main() {\n\n\tconst mesh = local.get( 'mesh', load );\n\n\tif ( mesh ) {\n\n\t\tmesh.material = parameters.get( 'Material' ) || new THREE.MeshBasicMaterial();\n\n\t}\n\n\treturn mesh;\n\n}\n","id":75,"type":"CodeEditorElement"},"78":{"x":1346,"y":362,"elements":[79,145],"autoResize":false,"layoutJSON":"{\"name\":\"Teapot Scene\",\"width\":300,\"elements\":[{\"name\":\"Material\",\"inputType\":\"Material\"}]}","id":78,"type":"Teapot Scene"},"79":{"height":null,"title":"Teapot Scene","icon":"ti ti-ti ti-variable","id":79,"type":"TitleElement"},"84":{"x":840,"y":323,"elements":[85,87,88,89],"autoResize":false,"id":84,"type":"BasicMaterialEditor"},"85":{"outputLength":1,"height":null,"title":"Basic Material","icon":"ti ti-ti ti-circle","id":85,"type":"TitleElement"},"87":{"inputLength":3,"inputs":[90],"links":[333],"height":null,"id":87,"type":"LabelElement"},"88":{"inputLength":1,"inputs":[91],"height":null,"id":88,"type":"LabelElement"},"89":{"inputLength":3,"height":null,"id":89,"type":"LabelElement"},"90":{"value":16777215,"id":90,"type":"ColorInput"},"91":{"min":0,"max":1,"value":1,"id":91,"type":"SliderInput"},"145":{"inputLength":1,"links":[85],"height":null,"id":145,"type":"LabelElement"},"146":{"x":2110,"y":592,"elements":[147,149],"autoResize":true,"source":"// Simple Fresnel\n// Enjoy! :)\n\n// layout must be the first variable.\n\nlayout = {\n\tname: \"Fresnel\",\n\toutputType: 'node',\n\ticon: 'angle',\n\twidth: 200,\n\telements: [\n\t\t{ name: 'Color A', inputType: 'node' },\n\t\t{ name: 'Color B', inputType: 'node' },\n\t\t{ name: 'Fresnel Factor', inputType: 'node' },\n\t]\n};\n\n// THREE and TSL (Three.js Shading Language) namespaces are available.\n\nconst { color, float, dot, vec3, normalView } = TSL;\n\nfunction main() {\n\n\tconst colorA = parameters.get( 'Color A' ) || color( 0xff0000 );\n\tconst colorB = parameters.get( 'Color B' ) || float( 0x0000ff );\n\tconst fresnelFactor = parameters.get( 'Fresnel Factor' ) || float( 1.3 );\n\n\tconst fresnel = dot( normalView, vec3( 0, 0, 1 ) ).oneMinus().pow( fresnelFactor );\n\n\treturn fresnel.mix( colorA, colorB );\n\n}\n","id":146,"type":"NodePrototypeEditor"},"147":{"outputLength":1,"height":null,"title":"Node Prototype","icon":"ti ti-ti ti-components","id":147,"type":"TitleElement"},"149":{"height":500,"source":"// Simple Fresnel\n// Enjoy! :)\n\n// layout must be the first variable.\n\nlayout = {\n\tname: \"Fresnel\",\n\toutputType: 'node',\n\ticon: 'angle',\n\twidth: 200,\n\telements: [\n\t\t{ name: 'Color A', inputType: 'node' },\n\t\t{ name: 'Color B', inputType: 'node' },\n\t\t{ name: 'Fresnel Factor', inputType: 'node' },\n\t]\n};\n\n// THREE and TSL (Three.js Shading Language) namespaces are available.\n\nconst { color, float, dot, vec3, normalView } = TSL;\n\nfunction main() {\n\n\tconst colorA = parameters.get( 'Color A' ) || color( 0xff0000 );\n\tconst colorB = parameters.get( 'Color B' ) || float( 0x0000ff );\n\tconst fresnelFactor = parameters.get( 'Fresnel Factor' ) || float( 1.3 );\n\n\tconst fresnel = dot( normalView, vec3( 0, 0, 1 ) ).oneMinus().pow( fresnelFactor );\n\n\treturn fresnel.mix( colorA, colorB );\n\n}\n","id":149,"type":"CodeEditorElement"},"332":{"x":478,"y":323,"elements":[333,335,336,337],"autoResize":false,"layoutJSON":"{\"name\":\"Fresnel\",\"outputType\":\"node\",\"icon\":\"angle\",\"width\":200,\"elements\":[{\"name\":\"Color A\",\"inputType\":\"node\"},{\"name\":\"Color B\",\"inputType\":\"node\"},{\"name\":\"Fresnel Factor\",\"inputType\":\"node\"}]}","id":332,"type":"Fresnel"},"333":{"outputLength":1,"height":null,"title":"Fresnel","icon":"ti ti-angle","id":333,"type":"TitleElement"},"335":{"inputLength":1,"links":[520],"height":null,"id":335,"type":"LabelElement"},"336":{"inputLength":1,"links":[339],"height":null,"id":336,"type":"LabelElement"},"337":{"inputLength":1,"links":[703],"height":null,"id":337,"type":"LabelElement"},"338":{"x":-62,"y":359,"elements":[339,346,347,348],"autoResize":false,"id":338,"type":"ColorEditor"},"339":{"outputLength":3,"height":null,"title":"Color","icon":"ti ti-ti ti-palette","id":339,"type":"TitleElement"},"341":{"value":16711680,"id":341,"type":"ColorInput"},"342":{"value":"#FF0000","id":342,"type":"StringInput"},"343":{"min":0,"max":1,"step":0.01,"value":1,"id":343,"type":"NumberInput"},"344":{"min":0,"max":1,"step":0.01,"value":0,"id":344,"type":"NumberInput"},"345":{"min":0,"max":1,"step":0.01,"value":0,"id":345,"type":"NumberInput"},"346":{"inputs":[341],"height":null,"id":346,"type":"Element"},"347":{"inputs":[342],"height":null,"id":347,"type":"LabelElement"},"348":{"inputs":[343,344,345],"height":null,"id":348,"type":"LabelElement"},"519":{"x":-59,"y":191,"elements":[520,527,528,529],"autoResize":false,"id":519,"type":"ColorEditor"},"520":{"outputLength":3,"height":null,"title":"Color","icon":"ti ti-ti ti-palette","id":520,"type":"TitleElement"},"522":{"value":34047,"id":522,"type":"ColorInput"},"523":{"value":"#0084FF","id":523,"type":"StringInput"},"524":{"min":0,"max":1,"step":0.01,"value":0,"id":524,"type":"NumberInput"},"525":{"min":0,"max":1,"step":0.01,"value":0.518,"id":525,"type":"NumberInput"},"526":{"min":0,"max":1,"step":0.01,"value":1,"id":526,"type":"NumberInput"},"527":{"inputs":[522],"height":null,"id":527,"type":"Element"},"528":{"inputs":[523],"height":null,"id":528,"type":"LabelElement"},"529":{"inputs":[524,525,526],"height":null,"id":529,"type":"LabelElement"},"700":{"inputs":[701],"height":null,"id":700,"type":"Element"},"701":{"value":1.7,"id":701,"type":"NumberInput"},"702":{"x":75,"y":530,"elements":[703,700],"autoResize":false,"id":702,"type":"FloatEditor"},"703":{"outputLength":1,"height":null,"title":"Float","icon":"ti ti-ti ti-box-multiple-1","id":703,"type":"TitleElement"}},"nodes":[72,84,146,338,519,702,78,332],"id":2,"type":"Canvas"}
|