@@ -61,7 +61,8 @@ public MaterialBuilder(MaterialBuilder other)
6161 this . AlphaCutoff = other . AlphaCutoff ;
6262 this . DoubleSided = other . DoubleSided ;
6363 this . ShaderStyle = other . ShaderStyle ;
64- this . IndexOfRefraction = other . IndexOfRefraction ;
64+ this . Dispersion = other . Dispersion ;
65+ this . IndexOfRefraction = other . IndexOfRefraction ;
6566
6667 this . _CompatibilityFallbackMaterial = other . _CompatibilityFallbackMaterial == null
6768 ? null
@@ -106,6 +107,8 @@ public String ShaderStyle
106107
107108 public float IndexOfRefraction { get ; set ; } = 1.5f ;
108109
110+ public float Dispersion { get ; set ; } = 0 ;
111+
109112 /// <inheritdoc/>
110113 /// <remarks>
111114 /// Material builder uses default class equality, but NUnit4 does some weird trickery on equality
@@ -132,7 +135,8 @@ public static bool AreEqualByContent(MaterialBuilder x, MaterialBuilder y)
132135 // AlphaCutoff only has meaning when AlphaMode = Mask
133136 if ( x . AlphaMode == AlphaMode . MASK && x . AlphaCutoff != y . AlphaCutoff ) return false ;
134137 if ( x . DoubleSided != y . DoubleSided ) return false ;
135- if ( x . IndexOfRefraction != y . IndexOfRefraction ) return false ;
138+ if ( x . Dispersion != y . Dispersion ) return false ;
139+ if ( x . IndexOfRefraction != y . IndexOfRefraction ) return false ;
136140 if ( x . _ShaderStyle != y . _ShaderStyle ) return false ;
137141
138142 if ( ! AreEqualByContent ( x . _CompatibilityFallbackMaterial , y . _CompatibilityFallbackMaterial ) ) return false ;
@@ -164,7 +168,8 @@ public static int GetContentHashCode(MaterialBuilder x)
164168 h ^= x . AlphaMode . GetHashCode ( ) ;
165169 h ^= x . AlphaCutoff . GetHashCode ( ) ;
166170 h ^= x . DoubleSided . GetHashCode ( ) ;
167- h ^= x . IndexOfRefraction . GetHashCode ( ) ;
171+ h ^= x . Dispersion . GetHashCode ( ) ;
172+ h ^= x . IndexOfRefraction . GetHashCode ( ) ;
168173 h ^= x . ShaderStyle . GetHashCode ( StringComparison . InvariantCulture ) ;
169174
170175 h ^= x . _Channels
@@ -285,7 +290,8 @@ internal void ValidateForSchema2()
285290 Guard . IsTrue ( this . AlphaMode == this . CompatibilityFallback . AlphaMode , nameof ( AlphaMode ) ) ;
286291 Guard . MustBeEqualTo ( this . AlphaCutoff , this . CompatibilityFallback . AlphaCutoff , nameof ( AlphaCutoff ) ) ;
287292 Guard . MustBeEqualTo ( this . DoubleSided , this . CompatibilityFallback . DoubleSided , nameof ( DoubleSided ) ) ;
288- Guard . MustBeEqualTo ( this . IndexOfRefraction , this . CompatibilityFallback . IndexOfRefraction , nameof ( IndexOfRefraction ) ) ;
293+ Guard . MustBeEqualTo ( this . Dispersion , this . CompatibilityFallback . Dispersion , nameof ( Dispersion ) ) ;
294+ Guard . MustBeEqualTo ( this . IndexOfRefraction , this . CompatibilityFallback . IndexOfRefraction , nameof ( IndexOfRefraction ) ) ;
289295
290296 foreach ( var chKey in new [ ] { KnownChannel . Normal , KnownChannel . Occlusion , KnownChannel . Emissive } )
291297 {
0 commit comments