• 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
Norman Barrows

methods for drawing swamp

6 posts in this topic

i'm looking for methods for drawing swamp

 

in the past i've drawn the ground mesh, then drawn a second flat "swamp water" ground mesh.  needless to say, drawing the ground mesh twice is a big performance hit. 

 

any ideas?

 

drawing a flat swamp water ground mesh, then drawing individual "dry land" meshes occurred to me....

 

 

 

0

Share this post


Link to post
Share on other sites

Is your swamp water transparent? If not, then you can use the depth buffer and draw it before the ground mesh. Then you'll avoid the pixel-shading cost of the ground mesh that lies under the water.

Edited by phil_t
0

Share this post


Link to post
Share on other sites

On what hardware is rendering the two different ground objects on top of each other expensive?

 

On thing you can probably do to speed things up for the underwater terrain is to simplify the pixel shader by reducing visual quality. As long as the water surface has some roughness to it you can probably get away with a fairly basic shader as the detail will be hidden.

 

You might also find http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter19.html useful to draw that rough refractive water relatively cheaply.

 

It's the reflection that gets really expensive - you'll need to re-render the whole scene to a texture to make that work well :)

0

Share this post


Link to post
Share on other sites

Is your swamp water transparent? If not, then you can use the depth buffer and draw it before the ground mesh. Then you'll avoid the pixel-shading cost of the ground mesh that lies under the water.

 

 

yes, that might help a bit.   but the ground mesh is typically 50% below, and 50% above the water plane, so its almost a wash as to which drawing order culls more triangles.

 

and given that this a performance hit, i haven't even considered alpha blended water (but it would be very cool!). i've seen some pretty impressive stuff done with just 2 or three layers of alpha blended water.  

 

maybe i need to make a special swamp water mesh with holes where the land sticks up, and a second ground mesh of just a bunch of little "islands".  that would reduce / eliminate the "double draw".   it might not be too hard to do that with the terrain chunk ground mesh generator. it already creates a ground mesh of four interleaved meshes, each with its own texture tile. interleaving land and water would be similar.

0

Share this post


Link to post
Share on other sites


On what hardware is rendering the two different ground objects on top of each other expensive?

 

that would be an early test on a baseline windows 7 box with on-board graphics chip only,  dx9 fixed function, using individual dynamic quads (sloooow).   since then I've switched to static ground chunks generated on the fly as needed (MUCH faster).    for now, the swamp is drawn as chunks, with just a single placeholder texture that is a photo of swamp that has both land and water. looks awful! <g>.   its not even seamless.

 

but static vs dynamic might make enough of a difference - even without generating separate interleaved land and water meshes.

 

water is drawn with aniso tmapping & mipmaps, and (usually) one directional light. no blending, alpha, etc. so filtering methods are about the only simplification possible, lose the aniso and mipmaps, but it probably wouldn't get me much. i could turn off lighting and manipulate the look  of the water by using multiple textures. that would save lighting calculations. or i could break down and write a shader. but the fixed function capabilities i'm using for this scene at the moment are very basic. i think vs 2012 even pre-generates it as one of the basic shaders when you start a new directx project. so i doubt my shader pcode would be faster than fixed function machine code.

 

reflection is probably not possible, due to the long visual ranges ( ~1000 d3d units). i'll be glad (to start at least) if i can just do land and water as plain old textured quads, without reflection, refraction, or translucency.  then i can think about "turning up the volume" on the graphics some more if possible. 

 

perhaps i'll give brute force static meshes a try and see what happens. if they're too slow "double drawing", i can always attempt to interleave. but the land and water may not slice up into separate quads nicely.

i suspect at least some overlap will be required.

 

i'd definitely like to get this working, as it was one of the better effects from the original version - despite the fact that it ran slower than anything else in the game.

0

Share this post


Link to post
Share on other sites


What kind of 'performance hit' are you talking about? If you're not slower than your target goal, when running in release mode, then there probably isn't much of a problem. Are you measuring your performance in FPS or microseconds?

 

pretty bad. about 10-12 fps vs the minimum playable 15 fps.  but that was with the old dynamic quads.  i'll try the ID software approach: brute force at what the pc is good at doing fast (static meshes).  seems to work out ok for them most of the time. OTOH, its a non-static world, and i can't afford a mips alpha and a month to pre-calculate possibly visible surfaces, so maybe ID's way isn't a good example to follow..... 

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