Closed TomBlakley closed 7 years ago
Cascaded Shadow Maps impose an overhead. I have two laptops, and the one that uses an embedded Intel GPU crawls trying to render the sample. (Bytheway, the sample is by not means optimized, the purpose is to explain the concepts).
Regarding the point lights, the maximum numbe of point lights is defined in several constants, also in the shaders. The shaders only supprt 5 point lights. You should change that in the shader in order to fix that exception.
Hope it helps.
Please note that I'm using a laptop instead of my computer, So it may take more lights to slow it down / crash for you. But when I add this code it plays around 30FPS (using chapter 26) This is inside setupLights method.
//Point Light PointLight[] pointLightList = new PointLight[5]; for(int i = 0; i < 5; i++) { lightIntensity = 1.0f; Vector3f col = new Vector3f(1.0f, 1.0f, 1.0f); Vector3f pos = new Vector3f(0 + i, 0, 0 + i); PointLight pointLight = new PointLight(col, pos, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); pointLightList[i] = pointLight; } sceneLight.setPointLightList(pointLightList);
Also when creating more than 5, The game give's a Null Pointer Exception.