PointLights radiate light in a circle. Note that PointLights are affected by Transform.scale. The Transform.scale.X value is multiplied by the lights radius when sent to the GPU. It is expected that scale will be linear.
상속: DeferredLight
예제 #1
0
 void renderLight(PointLight light)
 {
     _lightEffect.updateForLight(light);
     _polygonMesh.render();
 }
예제 #2
0
		void renderLight( PointLight light )
		{
			_lightEffect.updateForLight( light );
			_polygonMesh.render();
		}
예제 #3
0
        /// <summary>
        /// updates the shader values for the light and sets the appropriate CurrentTechnique
        /// </summary>
        /// <param name="light">Light.</param>
        public void updateForLight( PointLight light )
        {
            setLightPosition( new Vector3( light.entity.transform.position + light.localOffset, light.zPosition ) );
            setColor( light.color );
            setLightRadius( light.radius * light.entity.transform.scale.X );
            setLightIntensity( light.intensity );

            var objToWorld = Matrix.CreateScale( light.radius * light.entity.transform.scale.X ) * Matrix.CreateTranslation( light.entity.transform.position.X + light.localOffset.X, light.entity.transform.position.Y + light.localOffset.Y, 0 );
            setObjectToWorldMatrix( objToWorld );

            pointLightPass.Apply();
        }