Exemple #1
0
        public void MainPS()
        {
            Vector3 normal = SL.Normalize(Normal_VSPS);
            double  light  = SL.Max(SL.Dot(-LightDirection, normal), 0.0);
            double  light2 = SL.Max(SL.Dot(-LightDirection2, normal), 0.0);

            Color_PS = Diffuse.Sample(UV_VSPS) * ((light * LightColor) + (light2 * LightColor2));
        }
        public void MainVS()
        {
            Vector4 loc = Transform.Multiply(new Vector4(Position_VS, 1));

            Position_VSPS = Camera.Multiply(loc);
            UV_VSPS       = new Vector2(UV_VS.x, 1.0 - UV_VS.y);

            Vector3 normal = SL.Normalize(Transform.MultiplyInvert(new Vector4(Normal_VS, 0)).xyz);
            double  light  = SL.Max(SL.Dot(-LightDirection, normal), 0.0);
            double  light2 = SL.Max(SL.Dot(-LightDirection2, normal), 0.0);

            Light_VSPS = ((light * LightColor) + (light2 * LightColor2));
        }