/// <summary>
 /// Initializes a new instance of the <see cref="MaterialOcclusionMapFeature"/> class.
 /// </summary>
 public MaterialOcclusionMapFeature()
 {
     AmbientOcclusionMap  = new ComputeTextureScalar();
     DirectLightingFactor = new ComputeFloat(0.0f);
     CavityMap            = new ComputeTextureScalar();
     DiffuseCavity        = new ComputeFloat(1.0f);
     SpecularCavity       = new ComputeFloat(1.0f);
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MaterialGlossinessMapFeature"/> class.
 /// </summary>
 public MaterialGlossinessMapFeature()
 {
     GlossinessMap = new ComputeTextureScalar();
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MaterialBlendLayer"/> class.
 /// </summary>
 public MaterialBlendLayer()
 {
     Enabled   = true;
     BlendMap  = new ComputeTextureScalar();
     Overrides = new MaterialOverrides();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MaterialMetalnessMapFeature"/> class.
 /// </summary>
 public MaterialMetalnessMapFeature()
 {
     MetalnessMap = new ComputeTextureScalar();
 }
Beispiel #5
0
        public static MaterialAsset Create()
        {
            // Load default texture assets
            var clearCoatLayerNormalMap = new ComputeTextureColor
            {
                Texture = AttachedReferenceManager.CreateProxyObject <Texture>(new AssetId("2f76bcba-ae9f-4954-b98d-f94c2102ff86"), "StrideCarPaintOrangePeelNM"),
                Scale   = new Vector2(8, 8)
            };

            var metalFlakesNormalMap = new ComputeTextureColor
            {
                Texture = AttachedReferenceManager.CreateProxyObject <Texture>(new AssetId("7e2761d1-ef86-420a-b7a7-a0ed1c16f9bb"), "StrideCarPaintMetalFlakesNM"),
                Scale   = new Vector2(128, 128),
                UseRandomTextureCoordinates = true
            };

            var metalFlakesMask = new ComputeTextureScalar
            {
                Texture = AttachedReferenceManager.CreateProxyObject <Texture>(new AssetId("7e2761d1-ef86-420a-b7a7-a0ed1c16f9bb"), "StrideCarPaintMetalFlakesNM"),
                Scale   = new Vector2(128, 128),
                UseRandomTextureCoordinates = true
            };

            // Red Paint
            // Color4 defaultCarPaintColor = new Color4(0.274509817f, 0.003921569f, 0.0470588244f, 1.0f);
            // Color4 defaultMetalFlakesColor = new Color4(defaultCarPaintColor.R * 2.0f, defaultCarPaintColor.G * 2.0f, defaultCarPaintColor.B * 2.0f, 1.0f);

            // Blue Paint
            Color4 defaultPaintColor       = new Color4(0, 0.09411765f, 0.329411775f, 1.0f);
            Color4 defaultMetalFlakesColor = new Color4(0, 0.180392161f, 0.6313726f, 1.0f);

            var material = new MaterialAsset
            {
                Attributes =
                {
                    Diffuse  = new MaterialDiffuseMapFeature(new ComputeColor(Color4.Black)),
                    Specular = new MaterialMetalnessMapFeature(new ComputeFloat(0.0f)),

                    DiffuseModel  = new MaterialDiffuseLambertModelFeature(),
                    SpecularModel = new MaterialSpecularMicrofacetModelFeature(),

                    ClearCoat                    = new MaterialClearCoatFeature
                    {
                        // Base Layer
                        BasePaintDiffuseMap    = new ComputeColor(defaultPaintColor),
                        BasePaintGlossinessMap = new ComputeBinaryScalar(new ComputeFloat(0.50f),              metalFlakesMask,  BinaryOperator.Multiply),

                        // Metal Flakes Layer
                        MetalFlakesDiffuseMap    = new ComputeColor(defaultMetalFlakesColor),
                        MetalFlakesGlossinessMap = new ComputeBinaryScalar(new ComputeFloat(1.00f),              metalFlakesMask,  BinaryOperator.Multiply),
                        MetalFlakesMetalnessMap  = new ComputeFloat(1.00f),

                        MetalFlakesNormalMap    = metalFlakesNormalMap,
                        MetalFlakesScaleAndBias = true,

                        // Clear coat layer
                        ClearCoatGlossinessMap = new ComputeFloat(1.00f),
                        ClearCoatMetalnessMap  = new ComputeFloat(0.50f),

                        OrangePeelNormalMap    = clearCoatLayerNormalMap,
                        OrangePeelScaleAndBias = true,
                    }
                }
            };

            return(material);
        }