Graphics/ForwardRenderTechnique: Fix light selection

This commit is contained in:
Lynix 2016-12-15 23:55:35 +01:00
parent 5aa0c362a6
commit 997a874c0e
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ namespace Nz
inline bool ForwardRenderTechnique::IsPointLightSuitable(const Spheref& object, const AbstractRenderQueue::PointLight& light) inline bool ForwardRenderTechnique::IsPointLightSuitable(const Spheref& object, const AbstractRenderQueue::PointLight& light)
{ {
// If the object is too far away from this point light, there is not way it could light it // If the object is too far away from this point light, there is not way it could light it
return object.Contains(light.position); return object.Intersect(Spheref(light.position, light.radius));
} }
/*! /*!
@ -222,6 +222,6 @@ namespace Nz
inline bool ForwardRenderTechnique::IsSpotLightSuitable(const Spheref& object, const AbstractRenderQueue::SpotLight& light) inline bool ForwardRenderTechnique::IsSpotLightSuitable(const Spheref& object, const AbstractRenderQueue::SpotLight& light)
{ {
///TODO: Exclude spot lights based on their direction and outer angle? ///TODO: Exclude spot lights based on their direction and outer angle?
return object.Contains(light.position); return object.Intersect(Spheref(light.position, light.radius));
} }
} }