AreaLights work like DirLights except they only affect a specific area specified by the width/height. Note that Transform.scale will affect the size of an AreaLight.
상속: DeferredLight
예제 #1
0
        /// <summary>
        /// updates the shader values for the light and sets the appropriate CurrentTechnique
        /// </summary>
        /// <param name="light">Light.</param>
        public void UpdateForLight(AreaLight light)
        {
            SetColor(light.Color);
            SetAreaDirectionalLightDirection(light.Direction);
            SetLightIntensity(light.Intensity);

            var objToWorld = Matrix.CreateScale(light.Bounds.Width * light.Entity.Transform.Scale.X, light.Bounds.Height * light.Entity.Transform.Scale.Y, 1f) * Matrix.CreateTranslation(light.Bounds.X - light.Bounds.Width * 0.5f, light.Bounds.Y - light.Bounds.Height * 0.5f, 0);

            SetObjectToWorldMatrix(objToWorld);

            areaLightPass.Apply();
        }
예제 #2
0
        /// <summary>
        /// updates the shader values for the light and sets the appropriate CurrentTechnique
        /// </summary>
        /// <param name="light">Light.</param>
        public void updateForLight(AreaLight light)
        {
            setColor(light.Color);
            setAreaDirectionalLightDirection(light.direction);
            setLightIntensity(light.intensity);

            var objToWorld = Matrix.CreateScale(light.Bounds.width * light.Entity.transform.scale.X, light.Bounds.height * light.Entity.transform.scale.Y, 1f) * Matrix.CreateTranslation(light.Bounds.x - light.Bounds.width * 0.5f, light.Bounds.y - light.Bounds.height * 0.5f, 0);

            setObjectToWorldMatrix(objToWorld);

            areaLightPass.Apply();
        }
예제 #3
0
 void renderLight(AreaLight light)
 {
     _lightEffect.updateForLight(light);
     _quadPolygonMesh.render();
 }
예제 #4
0
		void renderLight( AreaLight light )
		{
			_lightEffect.updateForLight( light );
			_quadPolygonMesh.render();
		}
예제 #5
0
        /// <summary>
        /// updates the shader values for the light and sets the appropriate CurrentTechnique
        /// </summary>
        /// <param name="light">Light.</param>
        public void updateForLight( AreaLight light )
        {
            setColor( light.color );
            setAreaDirectionalLightDirection( light.direction );
            setLightIntensity( light.intensity );

            var objToWorld = Matrix.CreateScale( light.bounds.width * light.entity.transform.scale.X, light.bounds.height * light.entity.transform.scale.Y, 1f ) * Matrix.CreateTranslation( light.bounds.x - light.bounds.width * 0.5f, light.bounds.y - light.bounds.height * 0.5f, 0 );
            setObjectToWorldMatrix( objToWorld );

            areaLightPass.Apply();
        }