| | 1 | | namespace DCL.ECSComponents |
| | 2 | | { |
| | 3 | | public static class PBMaterial_Defaults |
| | 4 | | { |
| | 5 | | public static float GetAlphaTest(this PBMaterial self) |
| | 6 | | { |
| 10 | 7 | | return self.HasAlphaTest ? self.AlphaTest : 0.5f; |
| | 8 | | } |
| | 9 | |
|
| | 10 | | public static bool GetCastShadows(this PBMaterial self) |
| | 11 | | { |
| 0 | 12 | | return !self.HasCastShadows || self.CastShadows; |
| | 13 | | } |
| | 14 | |
|
| | 15 | | public static Color3 GetAlbedoColor(this PBMaterial self) |
| | 16 | | { |
| 0 | 17 | | return self.AlbedoColor ?? new Color3(Color3_Defaults.colorWhite); |
| | 18 | | } |
| | 19 | |
|
| | 20 | | public static Color3 GetEmissiveColor(this PBMaterial self) |
| | 21 | | { |
| 0 | 22 | | return self.EmissiveColor ?? new Color3(Color3_Defaults.colorBlack); |
| | 23 | | } |
| | 24 | |
|
| | 25 | | public static Color3 GetReflectiveColor(this PBMaterial self) |
| | 26 | | { |
| 0 | 27 | | return self.ReflectivityColor ?? new Color3(Color3_Defaults.colorWhite); |
| | 28 | | } |
| | 29 | |
|
| | 30 | | public static MaterialTransparencyMode GetTransparencyMode(this PBMaterial self) |
| | 31 | | { |
| 0 | 32 | | return self.HasTransparencyMode ? self.TransparencyMode : MaterialTransparencyMode.MtmAuto; |
| | 33 | | } |
| | 34 | |
|
| | 35 | | public static float GetMetallic(this PBMaterial self) |
| | 36 | | { |
| 0 | 37 | | return self.HasMetallic ? self.Metallic : 0.5f; |
| | 38 | | } |
| | 39 | |
|
| | 40 | | public static float GetRoughness(this PBMaterial self) |
| | 41 | | { |
| 0 | 42 | | return self.HasRoughness ? self.Roughness : 0.5f; |
| | 43 | | } |
| | 44 | |
|
| | 45 | | public static float GetGlossiness(this PBMaterial self) |
| | 46 | | { |
| 0 | 47 | | return self.HasGlossiness ? self.Glossiness : 1f; |
| | 48 | | } |
| | 49 | |
|
| | 50 | | public static float GetSpecularIntensity(this PBMaterial self) |
| | 51 | | { |
| 0 | 52 | | return self.HasSpecularIntensity ? self.SpecularIntensity : 1f; |
| | 53 | | } |
| | 54 | |
|
| | 55 | | public static float GetEmissiveIntensity(this PBMaterial self) |
| | 56 | | { |
| 0 | 57 | | return self.HasEmissiveIntensity ? self.EmissiveIntensity : 2f; |
| | 58 | | } |
| | 59 | |
|
| | 60 | | public static float GetDirectIntensity(this PBMaterial self) |
| | 61 | | { |
| 0 | 62 | | return self.HasDirectIntensity ? self.DirectIntensity : 1f; |
| | 63 | | } |
| | 64 | | } |
| | 65 | | } |