wireframe_node.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. function wireframe_node_init() {
  2. array_push(nodes_material_input, wireframe_node_def);
  3. map_set(parser_material_node_values, "WIREFRAME", wireframe_node_value);
  4. }
  5. function wireframe_node_value(node: ui_node_t, socket: ui_node_socket_t): string {
  6. node_shader_add_texture(parser_material_kong, "texuvmap", "_texuvmap");
  7. // let use_pixel_size: bool = node.buttons[0].default_value[0] > 0.0;
  8. // let pixel_size: f32 = parse_value_input(node.inputs[0]);
  9. return "sample_lod(texuvmap, sampler_linear, tex_coord, 0.0).r";
  10. }
  11. let wireframe_node_def: ui_node_t = {
  12. id : 0,
  13. name : _tr("Wireframe"),
  14. type : "WIREFRAME",
  15. x : 0,
  16. y : 0,
  17. color : 0xffb34f5a,
  18. inputs : [
  19. {
  20. id : 0,
  21. node_id : 0,
  22. name : _tr("Size"),
  23. type : "VALUE",
  24. color : 0xffa1a1a1,
  25. default_value : f32_array_create_x(0.01),
  26. min : 0.0,
  27. max : 0.1,
  28. precision : 100,
  29. display : 0
  30. },
  31. ],
  32. outputs : [ {
  33. id : 0,
  34. node_id : 0,
  35. name : _tr("Factor"),
  36. type : "VALUE",
  37. color : 0xffa1a1a1,
  38. default_value : f32_array_create_x(0.0),
  39. min : 0.0,
  40. max : 1.0,
  41. precision : 100,
  42. display : 0
  43. } ],
  44. buttons : [ {
  45. name : _tr("Pixel Size"),
  46. type : "BOOL",
  47. output : 0,
  48. default_value : f32_array_create_x(0),
  49. data : null,
  50. min : 0.0,
  51. max : 1.0,
  52. precision : 100,
  53. height : 0
  54. } ],
  55. width : 0,
  56. flags : 0
  57. };