• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Anand Baumunk

Increasing terrain performance (loading + drawing)

33 posts in this topic

When I move the camera out, FPS remain the same.
The FPS are about the same on a single vertexBuffer-drawCall.
16-bit optimization could really help, but I dont have the slightest idea how to do that.

According to your blog, I have to find the size of my vertexBuffer and then pad it to 16,32 or 64, but how do I pad a vertexBuffer?
The size of each element of the vertexstructure (3x sizeof(float) * 2x sizeof(float).... + padding) = 32, eg? Edited by gnomgrol
0

Share this post


Link to post
Share on other sites
To be clear, are you saying that zooming out so far that the terrain occupies only about 100-500 total pixels on the screen results in a similar framerate?
And you are sure that the rest of whatever you are drawing is not causing this slow framerate?

If so, you definitely have a bus-transfer problem, and the 2 main optimizations would be to use 16-bit vertices and a second stream for the Y, and compressed textures.
Compressed textures are the easiest to implement so start there.

When my site talks about padding, yes, it is as in your example. Add some fake bytes so that the next element in the buffer is 32 bytes after the previous element.
But while this will help, it is not going to give you results you will find acceptable.
This and redundancy checks should be put on hold while you address your most major issue: bandwidth.


L. Spiro
0

Share this post


Link to post
Share on other sites
Yes, when I zoom out very far, I just get ~10+ fps. I outcommented everything but the terriain, so it's the only thing to mess with right now.

By bandwidthproblem you mean that the stuff I pass from cpu to gpu is much to huge?
So I split the vertexBuffer and update only the Y (using a constantbuffer? I'm not sure what you mean by a stream)
I'll start with the compressed textures right now.
EDIT: Compressing the textures (using BC2) gave me a slight FPS increase of 5-10.
I added a screenshot of it to my first post! Edited by gnomgrol
0

Share this post


Link to post
Share on other sites
Bandwidth = the transfer from the CPU to the GPU.
It means the total amount you send to the GPU is too large. This includes textures, index buffers, vertex buffers, etc.
That is why using compressed textures can help.

How many elements are in your vertex buffer?
How many bits in your index buffer?


L. Spiro
0

Share this post


Link to post
Share on other sites
[CODE]
//vertexBuffer:

D3DXVECTOR3 pos;
D3DXVECTOR3 normal;
D3DXVECTOR2 texcoord;
D3DXVECTOR4 color;
D3DXVECTOR4 shadowColor;
//257*257 vertices per chunk
//indexbuffer: unsinged long 256*256*6
// as optimised as I was able to get it

[/CODE]
0

Share this post


Link to post
Share on other sites
Looks like a bandwidth problem after all.

Your vertex buffer is huge. Why do you need so much data? Why shadow color?
Why is your index buffer * 6? You should be using a triangle strip, not a triangle list.
Since you are bandwidth limited, this is one of the major issues you need to handle.
If you switch to triangle strips, your index buffer should become 257 * 257 + 2.
That in itself is much smaller but restricting your index buffers to 16 bits (while increasing the number of draw calls) often proves worth the extra draw calls.
But before reducing your index buffer to 16 bits, start by using a triangle strip. You should see a noticeable gain in performance.


L. Spiro
0

Share this post


Link to post
Share on other sites
I can't really see how to cut the vertexBuffer shorter. I could cut the shadowColor and just use bool for shadowed/not shadowed, but that would be all.
I'm using a trianglelist because I was told that doing so reduces the number of vertices while increasing the number of indices, which is a good thing they said, I didnt know that a triangleleist is more performant.

A 16-bit indexbuffer can simply be created by, instead of unsinged long, using unsinged short and IASetIndexBuffer( indexBuffer, DXGI_FORMAT_R16_UINT, 0);?
To go with a trianglestrip, I have to rebuild the entire terraincode, which could take a while. But if you say that it is worth it, I'll go for that.

Thanks for your instense help!

[url="http://www.gamedev.net/topic/447265-triangle-strip/"]http://www.gamedev.net/topic/447265-triangle-strip/[/url]
2007 they said we should use triangleLists! Has so much changed since then? Edited by gnomgrol
0

Share this post


Link to post
Share on other sites
Cache-friendly vertex buffers is another issue worth investigating.
By the size of your vertex buffer it appears you have repeating vertex data. If you are using an index buffer, your vertex buffer should be much smaller (257 × 257).
Are you eliminating duplicate vertices? If not, this would be the first thing to do.


L. Spiro
0

Share this post


Link to post
Share on other sites
You got me wrong, I think. My vertex buffer [i]is [/i]only 257*257. There are no doubled vertices.
Because I'm using a trianglelist, I need more indices. Most tutorials and posts said that would be worth it by far.

The problem I'm currently facing is that I cant figure out how to stream the y-values to the shader properly.
Another thing I just noticed is that, when I pass the y values per chunk to the shader, I have to do the same thing for shadows and normals. Will this still be a performance increase? Edited by gnomgrol
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0