Exemple #1
0
    /// <summary>
    /// Converts from a FoxLib MaterialPreset to a FoxKit MaterialPreset.
    /// </summary>
    /// <param name="foxLibMaterialPreset"></param>
    public MaterialPreset(FoxLib.MaterialParamBinary.MaterialPreset foxLibMaterialPreset)
    {
        this.F0 = foxLibMaterialPreset.F0;
        this.RoughnessThreshold      = foxLibMaterialPreset.RoughnessThreshold;
        this.ReflectionDependDiffuse = foxLibMaterialPreset.ReflectionDependDiffuse;
        this.AnisotropicRoughness    = foxLibMaterialPreset.AnisotropicRoughness;

        this.SpecularColor = FoxUtils.FoxColorRGBToUnityColor(foxLibMaterialPreset.SpecularColor);
        this.Translucency  = foxLibMaterialPreset.Translucency;
    }
Exemple #2
0
 /// <summary>
 /// Converts a FoxKit material preset to a FoxLib material preset.
 /// </summary>
 /// <param name="foxKitMaterialPreset">The FoxKit material preset.</param>
 /// <returns>The FoxLib material preset.</returns>
 private static FoxLib.MaterialParamBinary.MaterialPreset foxKitToFoxLib(MaterialPreset foxKitMaterialPreset)
 {
     FoxLib.MaterialParamBinary.MaterialPreset foxLibMaterialPreset = new FoxLib.MaterialParamBinary.MaterialPreset(foxKitMaterialPreset.F0, foxKitMaterialPreset.RoughnessThreshold, foxKitMaterialPreset.ReflectionDependDiffuse, foxKitMaterialPreset.AnisotropicRoughness, Utils.FoxUtils.UnityColorToFoxColorRGB(foxKitMaterialPreset.SpecularColor), foxKitMaterialPreset.Translucency);
     return(foxLibMaterialPreset);
 }