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

GeoClipMapping and Artefacts

6 posts in this topic

Hi,

 

I've followed the information in Geo Clip Mapping for my terrain as far as I understood it, but am getting very unsatisfactory results, and hope someone might point out my error;

 

I have a series of annular meshes that I render for each frame. I have a single large heighmap and text2dlod sample it in the vertex buffer and assign the height to the Y coordinate. I merge the boundaries between the meshes by sampling coarse and fine meshes and lerping the result.

 

This works fine, and very fast too. However the actual visuals are horrible, so I must have misunderstood the technique. As the camer moves across the landscape, the meshes dont move - they are locked to the camera and the highest detail mesh is always nearest the camera. However as the mesh density drops away in the concentric rings moving the camera visibly pops the geometry as it rolls over any reasonably non-flat heightmap. Its not that the geometry or sampling are incorrect, its just that the distant geometry is clearly visible as "waves" as the underlying heightmap pushes up one side of a triangle, then the other, as the camera moves towards it. Especially visible on ridge lines.

 

What am I doing wrong here - is distant geometry not supposed to be refreshed with every frame ? Would that not just lead to even more aggressive popping ?

 

Other than the GPU Gems article, can anyone point me to another source for GeoClipMapping so I can read a different source ?

 

Thanks,

0

Share this post


Link to post
Share on other sites

The trick to getting good looking terrain silhouettes is to get it as close to 1 screen pixel to grid unit as possible. But that's the ideal resolution. Far-away clipmaps could probably do with just looking the same density as the closest level clipmap, given the screen space. The best looking geo clipmap samples I've seen polish it up by providing seamless boundaries, and terrain morphing. The morphing happens as the camera moves, but at any moments there would be a gradual change in detail from the interior of a clipmap to the exterior. This makes the pushing and moving of triangles look more gradual. Using cubic interpolation could also help.

How far back to start the "morph line" in the clipmaps is up to you. The closer it is to the edge, the more quickly it morphs, and the closer it is to the inner perimeter, the more gradually it morphs, but with more triangles changing at once.

This can be done in two ways: expand some of the triangles on every other row/column by interpolating the distance from the line, so that the largest triangles meet become as large as the the coarser resolution of the next clipmap. Or, instead of pushing the triangle vertices sideways you gradually interpolate the "real" height with the average height between two vertices, again working on every other row and column.

 

Also here is an interesting non-clipmap based solution that works with large terrains as well, using "pizza slice" static meshes that is apparently easy on the CPU. My problem with geoclipmaps (though I still use them) is that you sometimes notice drops in framerates if you move the camera rapidly, thus requiring more frequent updates.

0

Share this post


Link to post
Share on other sites

Images please!

 

Anyway, "you talk about visibly propagating waves", to me this seems like the size of your transition/interpolation area is too big, i.e, it should be perhaps 10-20% at most. Put it higher than that and you sacrifice quality (for the given performance hit) and the terrain always looks like it's changing.

 

Also, note that heightmaps are not well-suited to high-frequency detail. I used real world data in my implementation of geoclipmaps which was somewhat high-frequency, I tried everything from low-quality to high-quality meshes and flew over the terrain at high speeds, and even then I could not really say that I felt bothered by the transitions other than in the worst high-frequency areas. So I would say it's a problem in your implementation (or heightmap resolution).

 

Also! I recommend that you don't compute the normals when sampling, sample them from a separate texture instead, hides the transitions a bit better and with the added bonus that you can use higher resolution normal textures (produces really good visuals even with low quality meshes).

 

Another thing, I don't remember the specifics at the moment and am too dumb to make sense of it right now, but in your transition area remember that it applies to triangles, you can't just sample in the middle if you want exact results, you need to do multiple samples (if this doesn't make any sense, just forget it). Otherwise you will find that certain the triangle pops in certain higher-frequency areas (i.e an /\ -shape will pop significantly and not interpolate), but it might not be warranted depending on your terrain.

Edited by Syranide
0

Share this post


Link to post
Share on other sites

The trick to getting good looking terrain silhouettes is to get it as close to 1 screen pixel to grid unit as possible. But that's the ideal resolution. Far-away clipmaps could probably do with just looking the same density as the closest level clipmap, given the screen space. The best looking geo clipmap samples I've seen polish it up by providing seamless boundaries, and terrain morphing. The morphing happens as the camera moves, but at any moments there would be a gradual change in detail from the interior of a clipmap to the exterior. This makes the pushing and moving of triangles look more gradual. Using cubic interpolation could also help.

How far back to start the "morph line" in the clipmaps is up to you. The closer it is to the edge, the more quickly it morphs, and the closer it is to the inner perimeter, the more gradually it morphs, but with more triangles changing at once.

This can be done in two ways: expand some of the triangles on every other row/column by interpolating the distance from the line, so that the largest triangles meet become as large as the the coarser resolution of the next clipmap. Or, instead of pushing the triangle vertices sideways you gradually interpolate the "real" height with the average height between two vertices, again working on every other row and column.

 

Also here is an interesting non-clipmap based solution that works with large terrains as well, using "pizza slice" static meshes that is apparently easy on the CPU. My problem with geoclipmaps (though I still use them) is that you sometimes notice drops in framerates if you move the camera rapidly, thus requiring more frequent updates.

 

Do you mean in your first para that my geometry quad size should be as close to 1 screen pixel as possible ? In terms of height sampling I use linear interpolation in the vertex shader, but in reality my terrain quads are enormously bigger than a screen pixel, so I'm clearly way out in terms of resolution; no wonder it look like rubbish.

 

I've had a look at the pizza slice example, which is kind of what I'm doing with fixed concentric meshes, but more optimal - I can see its better performance, and I might try it once I get the geometry->screen space relationship sorted.

 

Thanks for the tip.

0

Share this post


Link to post
Share on other sites

Images please!

 

Anyway, "you talk about visibly propagating waves", to me this seems like the size of your transition/interpolation area is too big, i.e, it should be perhaps 10-20% at most. Put it higher than that and you sacrifice quality (for the given performance hit) and the terrain always looks like it's changing.

 

Also, note that heightmaps are not well-suited to high-frequency detail. I used real world data in my implementation of geoclipmaps which was somewhat high-frequency, I tried everything from low-quality to high-quality meshes and flew over the terrain at high speeds, and even then I could not really say that I felt bothered by the transitions other than in the worst high-frequency areas. So I would say it's a problem in your implementation (or heightmap resolution).

 

Also! I recommend that you don't compute the normals when sampling, sample them from a separate texture instead, hides the transitions a bit better and with the added bonus that you can use higher resolution normal textures (produces really good visuals even with low quality meshes).

 

Another thing, I don't remember the specifics at the moment and am too dumb to make sense of it right now, but in your transition area remember that it applies to triangles, you can't just sample in the middle if you want exact results, you need to do multiple samples (if this doesn't make any sense, just forget it). Otherwise you will find that certain the triangle pops in certain higher-frequency areas (i.e an /\ -shape will pop significantly and not interpolate), but it might not be warranted depending on your terrain.

 

In your first para, do you mean that each concentric mesh ring should be no more than 20% less detailed that the nearer one ?

 

I agree about heightmaps - I apply a pertubation map over the top to make it more detailed.

 

I agree about the normals - I have a precomputed normal map.

 

In terms of sampling the heightmap, I use linear interpolation in the vertex shader (4 lookups) to make sure I dont pop the triangle corners.

 

I think your comment about resolution dropoff is probably where I'm going wrong - I think I'm being far too aggressive in reducing mesh resolution, leading to a world of popping. Another reply mentioned a target quad size of 4 pixels (or 1 pixel per vertex, if you like). Do you concur with this ?

0

Share this post


Link to post
Share on other sites

Thanks for the tips. I now understand my mistake.

 

Firstly I was allowing my geometry to be locked to the camera position, whereas I should have been offsetting it to the nearest whole texel (heightmap) location, otherwise almost all my heights end up being interpolated and therefore each vertex was changing its height on every frame - accurate, but gave a really inconsistent "ocean wave" effect. The popping that results as I transit between one texel and another is un-noticable now.

 

Secondly I didn't understand that, to get the best visual effect, that you should aim for a 1:1 relationship between your least detailed LOD geometry and the heightmap resolution. I haven't done this yet, but I can understand how this would reduce massively the "distant skyline" popping effects I was getting.

 

Phillip H

0

Share this post


Link to post
Share on other sites

The trick to getting good looking terrain silhouettes is to get it as close to 1 screen pixel to grid unit as possible.

Note that you will often want a considerably (5-8 times) grid size anyway.

The reason for that is that you're having diminuishing gains in visual quality as triangles cover fewer than a dozen or so pixels, but the amount of pixel shader work and ROP pressure literally starts to explode as triangle sizes get smaller.

Given a roughly pixel-sized grid, you can in the worst case end up having 4 instances of the pixel shader being run and blended for every pixel for every grid cell, only for 3 values to be discarded in the end.

Now at silhouettes, where more than one grid cell projects to a pixel (but only the frontmost is visible), you could run the pixel shader maybe a hundred times, only to discard all but the fragment with the smallest Z value in the end.
0

Share this post


Link to post
Share on other sites

The trick to getting good looking terrain silhouettes is to get it as close to 1 screen pixel to grid unit as possible.

Note that you will often want a considerably (5-8 times) grid size anyway.

The reason for that is that you're having diminuishing gains in visual quality as triangles cover fewer than a dozen or so pixels, but the amount of pixel shader work and ROP pressure literally starts to explode as triangle sizes get smaller.

Given a roughly pixel-sized grid, you can in the worst case end up having 4 instances of the pixel shader being run and blended for every pixel for every grid cell, only for 3 values to be discarded in the end.

Now at silhouettes, where more than one grid cell projects to a pixel (but only the frontmost is visible), you could run the pixel shader maybe a hundred times, only to discard all but the fragment with the smallest Z value in the end.

Samoth,

 

Thanks for the tip.

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