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

mesh versus entity in frustum

10 posts in this topic

Hi,

 

I was studying my render function after adding lots of nice stuff, and made myself aware that before I go on with a mesh, check if it's inside or intersecting my viewing frustum. And afterwards do the same with each entity. For now both using a boundingsphere (boundingboxes maybe in the future).

 

What are your experiences on doing this both? How assumable is it that mesh isn't (intersecting) the frustum but an entity is? Versus checking each entity with a CPU calculation to do this. The number of entities might grow huge in a scene.

 

Just curious on your thoughts.

0

Share this post


Link to post
Share on other sites

Are you talking about whether drawing your mesh if it's contained in the frustum (or straddling it). Generally checking if the object's bounding box is completely outside the frustum is already a good start and will certainly provide some level of optimisation. You might gain little from implementing a more complex intersection routine than that. However it all depends of the complexity of the geometry contained in the bbox. For instance if you render a terrain, a large part of the terrain might be outside the frustum but if it's part of a single mesh then you don't have a choice to discard the invisible bits. You need to be sure for large meshes that they are split into smaller bits (of reasonable size) organised eventually as a hierarchy, and then you can easily discard the individual pieces which are outside the frustum. If you choose this strategy, a lot of the objects will be culled and the drawing objects straddling on the frustrum's boundaries is probably okay...

Edited by mast4as
1

Share this post


Link to post
Share on other sites
Thanks, this helps a lot. Doing both checks sounds as a good solution then, assuming my meshes are organised into reasonable sized entities. It also gives me freedom to load a (part of a) scene in one exported "mesh"/ object
0

Share this post


Link to post
Share on other sites

If you mesh is only one big chunk you can break it using some of sort of spatial subdivision scheme a little bit like what the REYES algorithm does (it's not exactly the same but you can get inspire by the concept).

Edited by mast4as
1

Share this post


Link to post
Share on other sites
Thanks, i'll have to find the best balance between doing this with the modelling versus in my engine

However when I was saying "breaking it up into chances" you can do this in the engine at render time. You can insert the polygons in the cells of your mesh (insert polygon only once) and then display the content of the cell in the cell boundaries (min and max) are contained in the frustum. This way, you don't need to go back to modeling and you can just use a simple grid as a start to do that. It might use a bit of memory and it will take some time to construct the grid (and find optimal settings for the size of the grid, etc.) but it might be simple and fun implementing the technique and see what you gain out of it.

0

Share this post


Link to post
Share on other sites

OK, sounds complex, but that's probably because I didn't try it/ play around yet :)

Thanks, I like the idea, so you don't have to think about sizes of meshes while modelling

0

Share this post


Link to post
Share on other sites

[quote name='cozzie' timestamp='1357594496' post='5018752']
I was studying my render function after adding lots of nice stuff, and made myself aware that before I go on with a mesh, check if it's inside or intersecting my viewing frustum. ... What are your experiences on doing this both?

[/quote]

  1. In my system, entities are non-visible by default and therefore not get culled. If they have graphical component, it will get culled.
    As a side note: because of some nontrivial implications with scripting I actually don't cull at all the performance, given my current datasets is acceptable on everything that's not a 1st gen Intel Atom system. Feel free to bash me.
  2. In my current dataset, all entities which have a graphical component are very spatially-coherent with their logical position. That is, the mesh position is roughly the same as the entity itself. So doing both tests would give the same result (supposing an entity actually has a positional component and a "shape" to test).

[quote name='mast4as' timestamp='1357605602' post='5018828']

If you mesh is only one big chunk you can break it using some of sort of spatial subdivision scheme a little bit like what the REYES algorithm does (it's not exactly the same but you can get inspire by the concept).[/quote]Uhm. I wouldn't suggest to do that. It might make sense on rock-bottom portable hardware but sure it doesn't on everything modern.

0

Share this post


Link to post
Share on other sites

thanks, this triggers me to always keep asking the question:

"do I really need this for my purpose/ today's hardware or is it just because I think it might be necessary for not yet arised performance issues"

0

Share this post


Link to post
Share on other sites

Think about it. Layout some code or interfaces.

But for personal experience, I suggest to just use the following function as visibility test.

bool IsVisible(Object blah) {
    // It's a stub, implement this in some future version.
    return true;
}

 

Reasoning is very simple. If you need to cull, you can iterate your project. If it's already designed correctly, it will plug in right.

If you don't need to cull, you took a 100+ fps and turned it into 150+. You also spent a week you'll never get back.

 

FYI, my target hardware is Athlon XP 2800+ with Radeon 9500. This is "modern" enough to let beginners just throw stuff at the renderer. But to be more accurate,

[quote name='cozzie' timestamp='1357717974' post='5019390']
do I really need this for my purpose/ today's hardware or is it just because I think it might be necessary for not yet arised performance issues"
[/quote]I have no idea of what your purpose is. But I'm fairly sure your hardware is way more powerful than mine. Are you writing this from an i7?

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