• 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
Noddybear

DX11
Level of Detail with large terrains (Several million vertices brute force)

8 posts in this topic

Hey guys,
This is my first post here, and I basically joined to post this because I'm having some issues with various different LOD algorithms.
I'm trying to create a dynamic real-time level of detail system to render a huge terrain. If rendered with brute force this would result in millions of
polygons, so it would obviously be prudent to use LOD.
I've attempted this in XNA several times to build a viable model, and so far i've used ROAM, Geomipmapping and of course Quadtrees, as well as a combination of the last two.
None of these were really optimal for what i'm trying to achieve, as in all cases they sucked up too many CPU resources (With geomipmapping being somewhat precomputed)
The question that i'm asking is what good algorithms (or combinations of algorithms) could I use to bring down by CPU usage? I'm switching over to C++ with DX11 so i'll have access to tesselation and the geometry shader on the graphics card, but my area of knowledge doesn't really include these... Should I attempt to implement some GPGPU calculation? Some way down the road i'd optimally like to use another algorithm like marching cubes as well for the high res LOD so it'd permit me to create overhangs in the terrain and such...
Thanks!
0

Share this post


Link to post
Share on other sites
[quote]I'm trying to create a dynamic real-time level of detail system to render a huge terrain[/quote]
Does this mean you want your terrain to be dynamic? Or will it remain static? Can it all fit in memory or will you be streaming in data?

Usually if your CPU usage is too high, you can back off on the triangle culling and trying to find the 'optimal mesh' for the GPU to render and just do more brute force. ROAM is definitely out of the question... maybe look into [url="http://tulrich.com/geekstuff/chunklod.html"]Chunked LOD[/url] if you are using a static terrain, which will put more work on the GPU.
0

Share this post


Link to post
Share on other sites
[quote name='Noddybear' timestamp='1337174484' post='4940660']
so far i've used ROAM, Geomipmapping and of course Quadtrees, as well as a combination of the last two.
None of these were really optimal for what i'm trying to achieve, as in all cases they sucked up too many CPU resources (With geomipmapping being somewhat precomputed)
[/quote]That's extremely suspicious. Geomipmapping, as all chunked LODs techniques can be extremely fast. When the required LOD is computed by quadtrees, I would expect it to go even faster (I used a linear scan).
I'm somewhat inclined to say your program has an issue outside the LODding systems. Considering ROAM is totally dynamic in nature... you're not uploading the data each frame are you? How big is your average batch in unique vertices and how many batches are you sending? Do you have evidence the LODding algorithm itself is bottlenecking? Edited by Krohm
1

Share this post


Link to post
Share on other sites
I can't really justify computing all vertices and then uploading them to the GPU in a buffer, because it tends to completely fill my video memory :/ It means i'll have to stream in data as i compute it, and then unload it when im done...I agree that roam is not really a good solution. The kernel of the problem is just the processing time it takes to calculate positions of large chunks of terrain (which is what i've been doing with geomipmapping) so what i'd really like is a method to somehow collect indexing chunks together so i could run geomipmapping with quadtrees using smaller chunks of vertices without incurring the costs of rendering to the screen each block individually :P At the moment each chunk has its own index and vertex buffer :)
0

Share this post


Link to post
Share on other sites
Hello,

I use a quad tree terrain with a couple of 4096x4096 floating point textures. Each node in the quad tree uses a static 33x33 size mesh (which is actually computed in the vertex shader so no vertex buffer is used at the end). So each node is practically is just a transform matrix which is used to create the world xy position of the vertex. Using the world position the corresponding height is read from the floating point texture. Subdividing the quad tree doesn't really take much of CPU power since no geometry is processed.

The textures are updated in same fashion as used in the nested grid terrain. Look for toroidal updating of textures.

Why I don't use nested grid for the mesh? Well, I figured decals and nested grid terrain don't mix so well since the geometry changes all the time when the camera is moving.

Best regards!
0

Share this post


Link to post
Share on other sites
Ah that sounds interesting! I'm using Simplex noise to generate my terrain so I could move it over to the vertex shader I guess... Although I have a feeling that it'd be a bit of a bitch to port to hlsl! Is the transform matrix stored in the textures? Btw, my current node size is about 65x65 because I was under the impression that rendering any number of triangles below about 4k would take the same time as 4k to render :P
-Thanks!
0

Share this post


Link to post
Share on other sites
You may store your matrices as you wish, but as far as I know, the constant buffer storage is slightly preferred. I use constant buffer in this particular case.
Also, since most of the data (textures) is shared between the quad tree nodes, I can draw the whole terrain with few draw commands by using instancing.
You may test different grid sizes. Maybe 65x65 grid is faster / slower in some cases?

I think DICE is using tesselation in their terrain implementations. Search for FrostBite engine slides on the internet.

Cheers!
0

Share this post


Link to post
Share on other sites
Ah so you just draw one of each size terrain chunk, instance them to fill everywhere else, and then use the vertex shader to change the heights? Thats very crafty! I never thought to do it that way... I guess that instancing wouldn't work if you were building planetary terrains because of the curvature would not be easy to instance :P Does your technique use any geomipmapping as well?
-Thanks
0

Share this post


Link to post
Share on other sites
I have to admit that I haven't implemented morphing. At this moment I try to keep the mesh as dense as possible so that popping isn't that bad in the LOD changes.

For planetary scale things, if you are using square grids for drawing, then you'll need some extra math, but I assume that it isn't impossible to go with the same road. Well, there are lots of things to consider with a planetary scale renderer.

Cheers!
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

  • Similar Content

    • By lonewolff
      Hi Guys,
      I am just wondering if it is possible to acquire the address of the backbuffer if an API (based on DX11) only exposes the 'device' and 'context' pointers?
      Any advice would be greatly appreciated
    • By MarcusAseth
      bool InitDirect3D::Init() { if (!D3DApp::Init()) { return false; } //Additional Initialization //Disable Alt+Enter Fullscreen Toggle shortkey IDXGIFactory* factory; CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void**>(&factory)); factory->MakeWindowAssociation(mhWindow, DXGI_MWA_NO_WINDOW_CHANGES); factory->Release(); return true; }  
      As stated on the title and displayed on the code above, regardless of it Alt+Enter still takes effect...
      I recall something from the book during the swapChain creation, where in order to create it one has to use the same factory used to create the ID3D11Device, therefore I tested and indeed using that same factory indeed it work.
      How is that one particular factory related to my window and how come the MakeWindowAssociation won't take effect with a newly created factory?
      Also what's even the point of being able to create this Factories if they won't work,?(except from that one associated with the ID3D11Device) 
    • By ProfL
      Can anyone recommend a wrapper for Direct3D 11 that is similarly simple to use as SFML? I don't need all the image formats etc. BUT I want a simple way to open a window, allocate a texture, buffer, shader.
    • By lucky6969b
      Q1:
      Since there is no more fixed pipeline rendering in DX11, for every part of rendering in DX11, do I need to create a brand-new vertex shader and pixel shader... or at least I have to find one relevant online. If you work on skinned meshes and other effects originally worked in DX9 fixed pipeline, do I have to rework everything by now?
       
      Q2:
      For assimp, if it originally was designed for DX9, like it is coupled to a DX9 device for creating meshes and materials etc. Do I have to add in the DX11 device in the assimp, or can I just leave the assimp to remain in DX9 and after the meshes are loaded, I just convert the vertex buffers and index buffers into DX11 buffers?
      Thanks
      Jack
    • By MarcusAseth
      This header is mentioned in the book I'm reading but there is no documentation on msdn... Is it like an... outdated and abandoned header?
      If so, what's the current default/recomended library for handling errors with directX?
  • Popular Now