27282930313233
public SpotLight(Vector3f color, float intensity, Attenuation attenuation, float cutoff) { super(color, intensity, attenuation); this.m_cutoff = cutoff; SetShader(new Shader("forward-spot")); }
23242526272829
{ public DirectionalLight(Vector3f color, float intensity) { super(color, intensity); SetShader(new Shader("forward-directional")); }
36373839404142
float b = attenuation.GetLinear(); float c = attenuation.GetConstant() - COLOR_DEPTH * GetIntensity() * GetColor().Max(); this.m_range = (float)((-b + Math.sqrt(b * b - 4 * a * c))/(2 * a)); SetShader(new Shader("forward-point")); }