View Single Post
01-18-16, 05:35 PM   #10
Aradel
A Defias Bandit
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 3
The single handedly biggest FPS murderer are shadows.
This is due to the technique most likely used to render them (Shadow Mapping).

Shadow mapping works by writing to a texture (depth buffer) based on the view direction of the light.
It is then compared to the camera view and you can determine by reading of the depth buffer and some fancy math if the object is shadowed or not.

This has technique effects 2 parts of the system your CPU and GPU.


1. CPU: The fastest rendered polygon is the one that isn't rendered at all =).
As there is no point in rendering scene objects that the camera can no see the CPU is tasked with sorting the models that are outside of the camera view. This is generally a good idea as it reduced the amount of data that needs to be transfered from RAM to VRAM every frame.

As we have to render the scene twice with shadow mapping you have to test against not one camera but at least two. This is generally not an issue for modern CPUs with a modern game engine but it does add overhead.

2. GPU: Rendering is "slow"
Standard 3d APIs for rendering are usually slow. Specially when you switch shader.
Since you now have to render the scene twice, it means that you instead of once now have to send the objects that you're interested in for processing twice... (not really true, you get one object list per view frustum). The CPU then has to spoon feed the GPU with triangles for every model and this is what really kills your performance.

There are neat optimisations for this.
The most obvious you can think of is that there is usually only one primary light source (that casts shadow) and only render certain objects with dynamic shadows but it doesn't matter. It usually doesn't matter. As soon as you enable shadow mapping (dynamic shadows) you add this overhead to the rendering.
  Reply With Quote