Пример #1
0
        //---------------------------------------------------------------
        #endregion
        //---------------------------------------------------------------

        //---------------------------------------------------------------
        #region Methods
        //---------------------------------------------------------------
        /// <summary>
        /// Method for updating a shader with the light direction in object space.
        /// </summary>
        /// <param name="sc">The shader to update.</param>
        public void UpdateObjectSpaceDirection(ShaderConstant sc)
        {
            Transformations trans = Device.Instance.Transformations;

            sc.Set(direction * Matrix4.Invert(trans.World));
        }
Пример #2
0
        /// <summary>
        /// Method for updating a shader with the light direction in object space.
        /// </summary>
        /// <param name="sc">The shader to update.</param>
        public void UpdateObjectSpaceDirection(ShaderConstant sc)
        {
            Transformations trans = Device.Instance.Transformations;

            sc.Set(direction * Matrix3.Transpose(trans.World.RotationMatrix));
        }