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

3d fog of war using multipass shadow mapping

2 posts in this topic

I want to make an RTS that will use BSP maps where units can go up/down stairs and underground. I have an idea for 3d fog of war that would show only what is within the player's units' line of sight. Each unit would be treated as a point source of light and a depth map created from its point of view.

 

How many units could I support if I did a pass for each unit? How would I do the multipass? Redraw to texture each time and pass in the texture from previous pass and choose the brighter pixels of the two?

0

Share this post


Link to post
Share on other sites

I would guess it depends how complex your scenes are or how much time it takes to render it once...
And which technique you want to use? Because I think to render everything 6 times for one unit (like with standard cube shadow mapping) could be very slow when you have some units.

Generally I would think it could be too slow but I am not an shadow mapping expert (just implemented a naive shadow mapping algorithm which renders everything 6 times).
Would be nice to hear if and how you implemented this idea.

 

0

Share this post


Link to post
Share on other sites
Wonder how many units this supports http://forum.unity3d.com/threads/146697-Tasharen-Fog-of-War

There will be a slider to adjust to what height the map is drawn so you can see inside buildings. And everything that's not visible to the player's units (according to the depth maps) will be drawn transparent without texture. There will be holes in the floor/ceiling where staircases will go and openings in the walls/windows for shooting.

Each unit will be a spotlight with only one depth map. On each pass I will determine the pixel coordinates in the vertex shader to where it's drawing (varying vec4 that will be interpolated in the fragment shader) so that I can determine with which texel from the passed texture from the previous pass to compare which pixels are brighter. In these passes only the depth will be drawn. The textures will have to be 1024x1024 or 2048x2048 so a ratio will need to be passed of the scale between the viewport dimensions and the texture. Or maybe it's not needed, given glViewport and a projection matrix (maybe the ratios are only needed for the final pass to the screen). So it may be stretched or blurry. But this is only the visibility map and the final pass (with textures and all effects) will be for the whole screen.

So for each unit there will be a pass to draw its depth buffer from its point of view and one pass from the player's point of view to compare which pixels are in the visibility buffer (screen).

Switching render buffers frequently may affect the frame rate so I'll combine the depth maps into one or more textures by using glViewport to draw to a specific region. A 1024x1024 map will give 16 256x256 depth maps and a 2048x2048 will give 64. There has to be enought detail for them to see through slits in the wall of bunkers or something to shoot from.

One problem though is how to programmatically determine visibility, so that I know that a unit should pursue an enemy or shoot it.

Also, might be improved by deferred lighting but I don't know how.
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