• Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

### #Actualturch

Posted 13 August 2012 - 07:58 AM

1. Terrain. Right now I'm using multiple quad primitives connected to each other. This way I can divide terrain into blocks and each block can have additional texture specific for that block. But I see in some tutorial that they use one indexed primitives to create terrain. How much performance boost should I expect if I choose to change from multiple quad primitives to single primitive?

If you mean that you have one draw call for each quad, then you can expect a huge performance boost from switching to one or a few draw calls for the terrain. You can expect similar performance from rendering 1 or 1,000 triangles with a draw call - the draw call itself is the expensive part so you want to minimize them.

4. Should I call sin/cos/tan/etc function once and store the result instead of calling those functions every time I need to use the result?

If you mean precalculating a table of sin/cos/tan values, that's generally unnecessary nowadays. If you mean you need the same result multiple times, then calculating the result once and saving it is generally considered good practise. There are rare times when one or the other would be much better, but in general it doesn't matter. If it is in a tight loop, definitely cache it.

### #4turch

Posted 13 August 2012 - 07:57 AM

1. Terrain. Right now I'm using multiple quad primitives connected to each other. This way I can divide terrain into blocks and each block can have additional texture specific for that block. But I see in some tutorial that they use one indexed primitives to create terrain. How much performance boost should I expect if I choose to change from multiple quad primitives to single primitive?

If you mean that you have one draw call for each quad, then you can expect a huge performance boost from switching to one or a few draw calls for the terrain. You can expect similar performance from rendering 1 or 1,000 triangles with a draw call - the draw call itself is the expensive part so you want to minimize them.

4. Should I call sin/cos/tan/etc function once and store the result instead of calling those functions every time I need to use the result?

If you mean precalculating a table of sin/cos/tan values, that's generally unnecessary nowadays. If you mean you need the same result multiple times, then calculating the result once and saving it is generally considered good practise. There are rare times when one or the other would be much better, but in general it doesn't matter.

### #3turch

Posted 13 August 2012 - 07:55 AM

1. Terrain. Right now I'm using multiple quad primitives connected to each other. This way I can divide terrain into blocks and each block can have additional texture specific for that block. But I see in some tutorial that they use one indexed primitives to create terrain. How much performance boost should I expect if I choose to change from multiple quad primitives to single primitive?

If you mean that you have one draw call for each quad, then you can expect a huge performance boost from switching to one or a few draw calls for the terrain. You can expect similar performance from rendering 1 or 1,000 triangles with a draw call - the draw call itself is the expensive part so you want to minimize them.

4. Should I call sin/cos/tan/etc function once and store the result instead of calling those functions every time I need to use the result?

If you mean precalculating a table of sin/cos/tan values, that's generally unnecessary. If you mean you need the same result multiple times, then calculating the result once and saving it is generally considered good practise. There are rare times when one or the other would be much better, but in general it doesn't matter.

### #2turch

Posted 13 August 2012 - 07:46 AM

1. Terrain. Right now I'm using multiple quad primitives connected to each other. This way I can divide terrain into blocks and each block can have additional texture specific for that block. But I see in some tutorial that they use one indexed primitives to create terrain. How much performance boost should I expect if I choose to change from multiple quad primitives to single primitive?

If you mean that you have one draw call for each quad, then you can expect a huge performance boost from switching to one or a few draw calls for the terrain. You can expect similar performance from rendering 1 or 1,000 triangles with a draw call - the draw call itself is the expensive part so you want to minimize them.

### #1turch

Posted 13 August 2012 - 07:45 AM

1. Terrain. Right now I'm using multiple quad primitives connected to each other. This way I can divide terrain into blocks and each block can have additional texture specific for that block. But I see in some tutorial that they use one indexed primitives to create terrain. How much performance boost should I expect if I choose to change from multiple quad primitives to single primitive?

If you mean that you have one draw call for each quad, then you can expect a huge performance boost from switching to one or a few draw calls for the terrain. You can expect similar performance from rendering 1 or 10,000 triangles with a draw call - the draw call itself is the expensive part so you want to minimize them.

PARTNERS