They’re different types of cost. Setup time costs and vertex shader/transform costs are per-polygon, while fragment shaders’ costs are per rendered pixel (in addition to a per-frame setup cost which is roughly proportional to the number of uniforms, including textures). A slow fragment shader will slow you down when the ship’s close to the camera, while a high polygon count will slow you down whenever the ship’s in drawing range.Commander McLane wrote:I don't know how the number of polygons will impact the frame rate. I am no ship builder myself. I tend to think that the impact of shaders will be bigger than the impact of polygon-number, but I can be wrong.
Correct.Svengali wrote:- vertex/face counts will have an impact on spawning the entity. Higher detailed models will need more time, probably because of the octree calculations.
True, but potentially misleading; geometric transformations are actually part of the per-vertex drawing cost, and generally happens on the GPU (in the vertex shader) and is elided for objects outside drawing range. Oolite 1.x doesn’t reuse identical vertices, so the vertex count in this case is strictly three times the number of triangles. 3000 vertices is a very small number in this context, so you don’t need to worry about it.Svengali wrote:And positioning/rotating the entity will be slightly slower.
Textures don’t just affect loading, either; textures may need to be swapped in and out of video memory, and there’s a setup cost per object per frame per material per texture.Svengali wrote:- textures have to be loaded. I/O transfers can be pretty slow and GPU limits for the max size can cause weird effects.
There’s a cost for switching shaders (bigger than the cost of switching textures), so using specialized shaders for different parts of a ship can easily be a failed optimization.Svengali wrote:While doing the inflight overlays for the Vector I've seen that using a shadered entity with shadered subents is slower than doing it with single entities.
Yes. The old approach is equivalent to evaluating each branch, then callingSvengali wrote:I've read that 2nd generation GPUs are handling the if/else stuff different to 3rd generation GPUs.
mix(a, b, (float)condition);
. This allows each vertex/fragment in a batch to have the same control flow – it’s a lot like SSE programming.Newer GPUs have better but still limited ability to branch.