|
| 1 | +// Copyright © Plain Concepts S.L.U. All rights reserved. Use is subject to license terms. |
| 2 | + |
| 3 | +using Evergine.Mathematics; |
| 4 | +using System.Collections.Generic; |
| 5 | + |
| 6 | +namespace OBJRuntime.DataTypes |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// Represents a material definition in the OBJ format, including properties for |
| 10 | + /// ambient, diffuse, and specular components, as well as texture and PBR extensions. |
| 11 | + /// </summary> |
| 12 | + public class OBJMaterial |
| 13 | + { |
| 14 | + /// <summary> |
| 15 | + /// Gets or sets the name of the material. |
| 16 | + /// </summary> |
| 17 | + public string Name = string.Empty; |
| 18 | + |
| 19 | + /// <summary> |
| 20 | + /// Gets or sets the ambient color of the material. |
| 21 | + /// </summary> |
| 22 | + public Vector3 Ambient = Vector3.Zero; |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// Gets or sets the diffuse color of the material. |
| 26 | + /// </summary> |
| 27 | + public Vector3 Diffuse = Vector3.One; |
| 28 | + |
| 29 | + /// <summary> |
| 30 | + /// Gets or sets the specular color of the material. |
| 31 | + /// </summary> |
| 32 | + public Vector3 Specular = Vector3.Zero; |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// Gets or sets the transmittance color of the material. |
| 36 | + /// </summary> |
| 37 | + public Vector3 Transmittance = Vector3.Zero; |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// Gets or sets the emission color of the material. |
| 41 | + /// </summary> |
| 42 | + public Vector3 Emission = Vector3.Zero; |
| 43 | + |
| 44 | + /// <summary> |
| 45 | + /// Gets or sets the shininess of the material. |
| 46 | + /// </summary> |
| 47 | + public float Shininess = 1.0f; |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// Gets or sets the index of refraction of the material. |
| 51 | + /// </summary> |
| 52 | + public float Ior = 1.0f; |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// Gets or sets the dissolve factor of the material (1 = opaque, 0 = fully transparent). |
| 56 | + /// </summary> |
| 57 | + public float Dissolve = 1.0f; |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// Gets or sets the illumination model of the material. |
| 61 | + /// </summary> |
| 62 | + public int Illum = 0; |
| 63 | + |
| 64 | + // Texture information |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// Gets or sets the texture name for the ambient map. |
| 68 | + /// </summary> |
| 69 | + public string AmbientTexname = string.Empty; |
| 70 | + |
| 71 | + /// <summary> |
| 72 | + /// Gets or sets the texture name for the diffuse map. |
| 73 | + /// </summary> |
| 74 | + public string DiffuseTexname = string.Empty; |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// Gets or sets the texture name for the specular map. |
| 78 | + /// </summary> |
| 79 | + public string SpecularTexname = string.Empty; |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// Gets or sets the texture name for the specular highlight map. |
| 83 | + /// </summary> |
| 84 | + public string SpecularHighlightTexname = string.Empty; |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// Gets or sets the texture name for the bump map. |
| 88 | + /// </summary> |
| 89 | + public string BumpTexname = string.Empty; |
| 90 | + |
| 91 | + /// <summary> |
| 92 | + /// Gets or sets the texture name for the displacement map. |
| 93 | + /// </summary> |
| 94 | + public string DisplacementTexname = string.Empty; |
| 95 | + |
| 96 | + /// <summary> |
| 97 | + /// Gets or sets the texture name for the alpha map. |
| 98 | + /// </summary> |
| 99 | + public string AlphaTexname = string.Empty; |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// Gets or sets the texture name for the reflection map. |
| 103 | + /// </summary> |
| 104 | + public string ReflectionTexname = string.Empty; |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// Gets or sets the texture options for the ambient map. |
| 108 | + /// </summary> |
| 109 | + public OBJTextureOption AmbientTexopt = new OBJTextureOption(); |
| 110 | + |
| 111 | + /// <summary> |
| 112 | + /// Gets or sets the texture options for the diffuse map. |
| 113 | + /// </summary> |
| 114 | + public OBJTextureOption DiffuseTexopt = new OBJTextureOption(); |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// Gets or sets the texture options for the specular map. |
| 118 | + /// </summary> |
| 119 | + public OBJTextureOption SpecularTexopt = new OBJTextureOption(); |
| 120 | + |
| 121 | + /// <summary> |
| 122 | + /// Gets or sets the texture options for the specular highlight map. |
| 123 | + /// </summary> |
| 124 | + public OBJTextureOption SpecularHighlightTexopt = new OBJTextureOption(); |
| 125 | + |
| 126 | + /// <summary> |
| 127 | + /// Gets or sets the texture options for the bump map. |
| 128 | + /// </summary> |
| 129 | + public OBJTextureOption BumpTexopt = new OBJTextureOption(); |
| 130 | + |
| 131 | + /// <summary> |
| 132 | + /// Gets or sets the texture options for the displacement map. |
| 133 | + /// </summary> |
| 134 | + public OBJTextureOption DisplacementTexopt = new OBJTextureOption(); |
| 135 | + |
| 136 | + /// <summary> |
| 137 | + /// Gets or sets the texture options for the alpha map. |
| 138 | + /// </summary> |
| 139 | + public OBJTextureOption AlphaTexopt = new OBJTextureOption(); |
| 140 | + |
| 141 | + /// <summary> |
| 142 | + /// Gets or sets the texture options for the reflection map. |
| 143 | + /// </summary> |
| 144 | + public OBJTextureOption ReflectionTexopt = new OBJTextureOption(); |
| 145 | + |
| 146 | + // PBR extension |
| 147 | + |
| 148 | + /// <summary> |
| 149 | + /// Gets or sets the roughness value for PBR rendering. |
| 150 | + /// </summary> |
| 151 | + public float Roughness = 0.8f; |
| 152 | + |
| 153 | + /// <summary> |
| 154 | + /// Gets or sets the metallic value for PBR rendering. |
| 155 | + /// </summary> |
| 156 | + public float Metallic = 0.0f; |
| 157 | + |
| 158 | + /// <summary> |
| 159 | + /// Gets or sets the sheen value for PBR rendering. |
| 160 | + /// </summary> |
| 161 | + public float Sheen = 0.0f; |
| 162 | + |
| 163 | + /// <summary> |
| 164 | + /// Gets or sets the clearcoat thickness for PBR rendering. |
| 165 | + /// </summary> |
| 166 | + public float ClearcoatThickness = 0.0f; |
| 167 | + |
| 168 | + /// <summary> |
| 169 | + /// Gets or sets the clearcoat roughness for PBR rendering. |
| 170 | + /// </summary> |
| 171 | + public float ClearcoatRoughness = 0.0f; |
| 172 | + |
| 173 | + /// <summary> |
| 174 | + /// Gets or sets the anisotropy value for PBR rendering. |
| 175 | + /// </summary> |
| 176 | + public float Anisotropy = 0.0f; |
| 177 | + |
| 178 | + /// <summary> |
| 179 | + /// Gets or sets the anisotropy rotation value for PBR rendering. |
| 180 | + /// </summary> |
| 181 | + public float AnisotropyRotation = 0.0f; |
| 182 | + |
| 183 | + /// <summary> |
| 184 | + /// Gets or sets the texture name for the roughness map. |
| 185 | + /// </summary> |
| 186 | + public string RoughnessTexname = string.Empty; |
| 187 | + |
| 188 | + /// <summary> |
| 189 | + /// Gets or sets the texture name for the metallic map. |
| 190 | + /// </summary> |
| 191 | + public string MetallicTexname = string.Empty; |
| 192 | + |
| 193 | + /// <summary> |
| 194 | + /// Gets or sets the texture name for the sheen map. |
| 195 | + /// </summary> |
| 196 | + public string SheenTexname = string.Empty; |
| 197 | + |
| 198 | + /// <summary> |
| 199 | + /// Gets or sets the texture name for the emissive map. |
| 200 | + /// </summary> |
| 201 | + public string EmissiveTexname = string.Empty; |
| 202 | + |
| 203 | + /// <summary> |
| 204 | + /// Gets or sets the texture name for the normal map. |
| 205 | + /// </summary> |
| 206 | + public string NormalTexname = string.Empty; |
| 207 | + |
| 208 | + /// <summary> |
| 209 | + /// Gets or sets the texture options for the roughness map. |
| 210 | + /// </summary> |
| 211 | + public OBJTextureOption Roughness_texopt = new OBJTextureOption(); |
| 212 | + |
| 213 | + /// <summary> |
| 214 | + /// Gets or sets the texture options for the metallic map. |
| 215 | + /// </summary> |
| 216 | + public OBJTextureOption Metallic_texopt = new OBJTextureOption(); |
| 217 | + |
| 218 | + /// <summary> |
| 219 | + /// Gets or sets the texture options for the sheen map. |
| 220 | + /// </summary> |
| 221 | + public OBJTextureOption Sheen_texopt = new OBJTextureOption(); |
| 222 | + |
| 223 | + /// <summary> |
| 224 | + /// Gets or sets the texture options for the emissive map. |
| 225 | + /// </summary> |
| 226 | + public OBJTextureOption Emissive_texopt = new OBJTextureOption(); |
| 227 | + |
| 228 | + /// <summary> |
| 229 | + /// Gets or sets the texture options for the normal map. |
| 230 | + /// </summary> |
| 231 | + public OBJTextureOption Normal_texopt = new OBJTextureOption(); |
| 232 | + |
| 233 | + /// <summary> |
| 234 | + /// Gets or sets the padding value. |
| 235 | + /// </summary> |
| 236 | + public int Pad2; |
| 237 | + |
| 238 | + /// <summary> |
| 239 | + /// Gets or sets the key-value pairs for unknown parameters. |
| 240 | + /// </summary> |
| 241 | + public Dictionary<string, string> UnknownParameter = new Dictionary<string, string>(); |
| 242 | + } |
| 243 | +} |
0 commit comments