BabylonShaderMaterial.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using System.Collections.Generic;
  2. using System.Runtime.Serialization;
  3. namespace BabylonExport.Entities
  4. {
  5. [DataContract]
  6. public class BabylonShaderMaterial : BabylonMaterial
  7. {
  8. [DataMember]
  9. public string customType { get; private set; }
  10. [DataMember]
  11. public object shaderPath;
  12. [DataMember]
  13. public BabylonShaderOptions options;
  14. [DataMember]
  15. public Dictionary<string, object> textures;
  16. [DataMember]
  17. public Dictionary<string, object[]> textureArrays;
  18. [DataMember]
  19. public Dictionary<string, object> floats;
  20. [DataMember]
  21. public Dictionary<string, object[]> floatArrays;
  22. [DataMember]
  23. public Dictionary<string, object> colors3;
  24. [DataMember]
  25. public Dictionary<string, object> colors4;
  26. [DataMember]
  27. public Dictionary<string, object> vectors2;
  28. [DataMember]
  29. public Dictionary<string, object> vectors3;
  30. [DataMember]
  31. public Dictionary<string, object> vectors4;
  32. [DataMember]
  33. public Dictionary<string, object> matrices;
  34. [DataMember]
  35. public Dictionary<string, object> matrices2x2;
  36. [DataMember]
  37. public Dictionary<string, object> matrices3x3;
  38. [DataMember]
  39. public Dictionary<string, object[]> vectors3Arrays;
  40. public BabylonShaderMaterial()
  41. {
  42. this.customType = "BABYLON.ShaderMaterial";
  43. this.shaderPath = null;
  44. this.options = new BabylonShaderOptions();
  45. this.textures = new Dictionary<string, object>();
  46. this.textureArrays = new Dictionary<string, object[]>();
  47. this.floats = new Dictionary<string, object>();
  48. this.floatArrays = new Dictionary<string, object[]>();
  49. this.colors3 = new Dictionary<string, object>();
  50. this.colors4 = new Dictionary<string, object>();
  51. this.vectors2 = new Dictionary<string, object>();
  52. this.vectors3 = new Dictionary<string, object>();
  53. this.vectors4 = new Dictionary<string, object>();
  54. this.matrices = new Dictionary<string, object>();
  55. this.matrices2x2 = new Dictionary<string, object>();
  56. this.matrices3x3 = new Dictionary<string, object>();
  57. this.vectors3Arrays = new Dictionary<string, object[]>();
  58. }
  59. }
  60. [DataContract]
  61. public class BabylonShaderOptions
  62. {
  63. [DataMember]
  64. public string[] attributes;
  65. [DataMember]
  66. public string[] uniforms;
  67. [DataMember]
  68. public bool needAlphaBlending;
  69. [DataMember]
  70. public bool needAlphaTesting;
  71. [DataMember]
  72. public string[] samplers;
  73. [DataMember]
  74. public string[] defines;
  75. }
  76. }