/// <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(); }
/// <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(); }
void renderLight(AreaLight light) { _lightEffect.updateForLight(light); _quadPolygonMesh.render(); }
void renderLight( AreaLight light ) { _lightEffect.updateForLight( light ); _quadPolygonMesh.render(); }
/// <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(); }