A new terrain

Source: Internet
Author: User

Recently, I changed the previous Code. Now the terrain is basically complete. The basic technology is geomipmap + block terrain, currently, the image is loaded with a height of 1024x1024. The frame rate is still good. There are more than 60 frames, and my video card is 9300gs. This is not a good video card. Today, I was planning to combine the previous atmospheric rendering. I didn't expect that the problem had never been solved. I was asked in a group that I was kicked out directly. Is it too mentally retarded, my vertex buffer is fixed, and then I dynamically update the index buffer and number of triangles. I finally found that calling drawindexedprimitive () Didn't increase much efficiency, even if primitivecount = 1, the efficiency is more than 60 frames, and the drawindexedprimitive () is more than 500 frames. Finally, I saw the answer in a FAQ.

 

When I submit an index-containing primitive, does direct3d process all vertices in the buffer or only the vertices I indexed?

When using the software ry assembly line, direct3d first converts all vertices in the range you submit, rather than "according to requirements" according to the index. This is more efficient for intensive data (where most vertices are used), especially when SIMD instructions can be used. If your data is loose (that is, many vertices are not used), you may need to consider reorganizing your data to avoid unnecessary conversions. During hardware geometric acceleration, vertices are often converted as needed.

 

This is the answer. He converted all vertices in my vertex buffer and then considered the index value. Finally, change it to d3dcreate_hardware_vertexprocessing.

The frame rate is increased by about 4 times.

 

I am also considering whether the dynamic creation of VB will improve the performance. This is not clear yet.

 

 

Terrain size: 1024x1024 d3dcreate_software_vertexprocessing

 

Terrain size: 1024x1024 d3dcreate_hardware_vertexprocessing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.