Question

The current method i use drops the fps to 30 when having 5 lights. What is the best way to have lights like in a AAA title. They have lights everywhere but runs smooth. What i use now is

Device->LightEnable(LightIndex,TRUE);
Device->SetLight(LightIndex,&Light);
Was it helpful?

Solution

Many AAA titles are using Deferred Shading for the lightcomputation. Against the forward-renderer it's capable of rendering many lights with little performance impact (however the plain usage drains performance more than a forward-renderer).

With a forward-renderer you must iterate over all lights in the pixelcomputation, which limits the amount of lights you can use, on the one hand because the limited shaderinstructions or shaderconstants on the other hand because pixelshaders shouldn't be too complex.

With Deferred Shading lighting is postprocessed over the scene and lights are only geometry with a special pixelshader, which must be rendered consecutively.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top