You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
7.1 KiB
JSON
1 line
7.1 KiB
JSON
2 months ago
|
{"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 (T
|