XNA, occlusion rejection and collision detection

I put together a quadtree / BSP hybrid prototype to test for collision detection and remove occlusion in the engine for the XNA game I am building.

As far as I understand, one of the optimizations that hardware acceleration provides is the ability to store vertex and index lists on a map, so calls to draw related geometry should not send model data for each frame.

On a level with a lot of geometry, how do you deal with this in XNA? For example, if I worked in OpenGL, I would save a list of what is on the map and just send what needs to be updated. However, a high level of abstraction of the XNA structure seems to encapsulate it to such an extent that I cannot control it.

Tell me why I am wrong, or why I should not worry.

+3
source share
1 answer

In XNA, the graphics driver decides in which memory it is best to place vertex and index buffers based on the properties of the specified buffers. The choices that you can influence the storage of the buffer include:

  • Use dynamic buffer or regular buffer

"In situations where your game frequently changes the vertex buffer, it is recommended that you create or create a buffer from DynamicVertexBuffer instead of the VertexBuffer class."

  • Use parameter when creating a buffer

WriteOnly ", . , . ".

, , , , , . , , .

. XNA 3.1 xbox DrawUserPrimitives, DynamicVertexBuffer DynamicIndexBuffer.

, , SetData. . http://blogs.msdn.com/b/shawnhar/archive/2008/04/15/stalls-part-two-beware-of-setdata.aspx.

+2

Source: https://habr.com/ru/post/1764608/


All Articles