Ejemplo n.º 1
0
        public override void GenerateShader(MaterialGeneratorContext context)
        {
            Intensity.ClampFloat(0, 1);

            context.SetStream(SpecularStream.Stream, SpecularMap, MaterialKeys.SpecularMap, MaterialKeys.SpecularValue);
            context.SetStream("matSpecularIntensity", Intensity, null, MaterialKeys.SpecularIntensityValue);
        }
Ejemplo n.º 2
0
        public override void GenerateShader(MaterialGeneratorContext context)
        {
            Vector4 emissiveMin = Vector4.Zero;
            Vector4 emissiveMax = new Vector4(float.MaxValue);

            EmissiveMap.ClampFloat4(ref emissiveMin, ref emissiveMax);
            Intensity.ClampFloat(0, float.MaxValue);

            context.SetStream(EmissiveStream.Stream, EmissiveMap, MaterialKeys.EmissiveMap, MaterialKeys.EmissiveValue);
            context.SetStream("matEmissiveIntensity", Intensity, MaterialKeys.EmissiveIntensityMap, MaterialKeys.EmissiveIntensity);

            var shaderBuilder = context.AddShading(this);

            shaderBuilder.ShaderSources.Add(new ShaderClassSource("MaterialSurfaceEmissiveShading", UseAlpha));
        }