문제

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);
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top