// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 using UnityEngine; namespace GLTFast.Schema { /// /// This extension defines the specular-glossiness material model from /// Physically-Based Rendering (PBR). /// /// [System.Serializable] public class PbrSpecularGlossiness { /// /// Diffuse color red, green, blue and alpha components in linear space. /// public float[] diffuseFactor = { 1, 1, 1, 1 }; /// /// Diffuse color in linear space. /// public Color DiffuseColor => new Color( diffuseFactor[0], diffuseFactor[1], diffuseFactor[2], diffuseFactor[3] ); /// /// Diffuse color texture info. /// public TextureInfo diffuseTexture; /// /// Specular color red, green and blue components in linear space. /// public float[] specularFactor = { 1, 1, 1 }; /// /// Specular color in linear space. /// public Color SpecularColor => new Color( specularFactor[0], specularFactor[1], specularFactor[2] ); /// /// The glossiness or smoothness of the material. /// public float glossinessFactor = 1; /// /// The specular-glossiness texture. /// public TextureInfo specularGlossinessTexture; internal void GltfSerialize(JsonWriter writer) { writer.AddObject(); writer.Close(); throw new System.NotImplementedException($"GltfSerialize missing on {GetType()}"); } } }