WebGPUNodeUniform.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import {
  2. FloatUniform, Vector2Uniform, Vector3Uniform, Vector4Uniform,
  3. ColorUniform, Matrix3Uniform, Matrix4Uniform
  4. } from '../WebGPUUniform.js';
  5. class FloatNodeUniform extends FloatUniform {
  6. constructor( nodeUniform ) {
  7. super( nodeUniform.name, nodeUniform.value );
  8. this.nodeUniform = nodeUniform;
  9. }
  10. getValue() {
  11. return this.nodeUniform.value;
  12. }
  13. }
  14. class Vector2NodeUniform extends Vector2Uniform {
  15. constructor( nodeUniform ) {
  16. super( nodeUniform.name, nodeUniform.value );
  17. this.nodeUniform = nodeUniform;
  18. }
  19. getValue() {
  20. return this.nodeUniform.value;
  21. }
  22. }
  23. class Vector3NodeUniform extends Vector3Uniform {
  24. constructor( nodeUniform ) {
  25. super( nodeUniform.name, nodeUniform.value );
  26. this.nodeUniform = nodeUniform;
  27. }
  28. getValue() {
  29. return this.nodeUniform.value;
  30. }
  31. }
  32. class Vector4NodeUniform extends Vector4Uniform {
  33. constructor( nodeUniform ) {
  34. super( nodeUniform.name, nodeUniform.value );
  35. this.nodeUniform = nodeUniform;
  36. }
  37. getValue() {
  38. return this.nodeUniform.value;
  39. }
  40. }
  41. class ColorNodeUniform extends ColorUniform {
  42. constructor( nodeUniform ) {
  43. super( nodeUniform.name, nodeUniform.value );
  44. this.nodeUniform = nodeUniform;
  45. }
  46. getValue() {
  47. return this.nodeUniform.value;
  48. }
  49. }
  50. class Matrix3NodeUniform extends Matrix3Uniform {
  51. constructor( nodeUniform ) {
  52. super( nodeUniform.name, nodeUniform.value );
  53. this.nodeUniform = nodeUniform;
  54. }
  55. getValue() {
  56. return this.nodeUniform.value;
  57. }
  58. }
  59. class Matrix4NodeUniform extends Matrix4Uniform {
  60. constructor( nodeUniform ) {
  61. super( nodeUniform.name, nodeUniform.value );
  62. this.nodeUniform = nodeUniform;
  63. }
  64. getValue() {
  65. return this.nodeUniform.value;
  66. }
  67. }
  68. export {
  69. FloatNodeUniform, Vector2NodeUniform, Vector3NodeUniform, Vector4NodeUniform,
  70. ColorNodeUniform, Matrix3NodeUniform, Matrix4NodeUniform
  71. };