BabylonShaderMaterial.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. SetCustomType("BABYLON.ShaderMaterial");
  43. shaderPath = null;
  44. options = new BabylonShaderOptions();
  45. textures = new Dictionary<string, object>();
  46. textureArrays = new Dictionary<string, object[]>();
  47. floats = new Dictionary<string, object>();
  48. floatArrays = new Dictionary<string, object[]>();
  49. colors3 = new Dictionary<string, object>();
  50. colors4 = new Dictionary<string, object>();
  51. vectors2 = new Dictionary<string, object>();
  52. vectors3 = new Dictionary<string, object>();
  53. vectors4 = new Dictionary<string, object>();
  54. matrices = new Dictionary<string, object>();
  55. matrices2x2 = new Dictionary<string, object>();
  56. matrices3x3 = new Dictionary<string, object>();
  57. vectors3Arrays = new Dictionary<string, object[]>();
  58. }
  59. public void SetCustomType(string type)
  60. {
  61. customType = type;
  62. }
  63. }
  64. [DataContract]
  65. public class BabylonShaderOptions
  66. {
  67. [DataMember]
  68. public string[] attributes;
  69. [DataMember]
  70. public string[] uniforms;
  71. [DataMember]
  72. public bool needAlphaBlending;
  73. [DataMember]
  74. public bool needAlphaTesting;
  75. [DataMember]
  76. public string[] samplers;
  77. [DataMember]
  78. public string[] defines;
  79. }
  80. }