prevent point lights from overflowing shader
parent
d156fbc39a
commit
55b1555df2
|
@ -2,6 +2,7 @@ namespace Kav
|
|||
{
|
||||
public interface PointLightEffect
|
||||
{
|
||||
PointLightCollection PointLights { get; } // TODO: should be a collection class?
|
||||
int MaxPointLights { get; }
|
||||
PointLightCollection PointLights { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,8 @@ namespace Kav
|
|||
}
|
||||
}
|
||||
|
||||
public int MaxPointLights { get; } = 4;
|
||||
|
||||
public PointLightCollection PointLights
|
||||
{
|
||||
get { return pointLightCollection; }
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Kav
|
|||
int i = 0;
|
||||
foreach (var pointLight in pointLights)
|
||||
{
|
||||
if (i > pointLightEffect.MaxPointLights) { break; }
|
||||
pointLightEffect.PointLights[i] = pointLight;
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue