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

2 questions on texture streaming

4 posts in this topic

This is the next thing I'm going to put into my engine, whether I need it yet or not isn't really important, I'm fascinated by it so as a hopefully enjoyable exercise, it's going in.

Firstly, I've been studying Black Ops 2 recently and it's fairly obvious they use some serious texture streaming. I was wondering if they will be streaming their textures from the DVD (slow??) or whether they might dump a load of textures (for the current level perhaps) to HDD temporarily (faster) and stream them from there. That would mean though that the end user would need a certain amount of free disk space and aren't there xboxes available with no HDD? I can't imagine they stream them from the DVD.

Secondly, when you see the level loading, you can see the MIPs loading in gradually (which is great eye candy in my opinion, I love trying to work out how things work), so to me this must mean they don't store their textures atomically (i.e. one texture file with all the MIP levels in it). So if they are separate, isn't it going to be pretty slow to load in an image, lock the texture on the card, update it with the incoming higher level MIPs and then unlock it again? I'm going to do some texts of this at some point but before I possibly waste my time, does anyone know roughly how it works? Am I on track?

Thanks

0

Share this post


Link to post
Share on other sites
[quote name='RobMaddison' timestamp='1354010489' post='5004466']
I can't imagine they stream them from the DVD
[/quote]
I think that the lacking HDD support (think of Xbox I) on consoles was one of the major reasons to use streaming. The benefit of streaming is not only the reduced memory impact, but although the asynchroniously nature. Time isn't the most critical issue once you start streaming.

[quote name='RobMaddison' timestamp='1354010489' post='5004466']
(i.e. one texture file with all the MIP levels in it)
[/quote]
Why not, when using DDS you can access the single mipmap levels easy enough. And you don't need to read every single mipmap-level, dividing your texture mipmaps into two sections (low/hi) is often enough.

[quote name='RobMaddison' timestamp='1354010489' post='5004466']
So if they are separate, isn't it going to be pretty slow to load in an image, lock the texture on the card,
[/quote]
Loading and decompression can be done in an async. thread. Uploading the data to the videocard is most likely done by DMA, therefore the time impact could be quite small. Edited by Ashaman73
0

Share this post


Link to post
Share on other sites
[quote name='RobMaddison' timestamp='1354010489' post='5004466']
I was wondering if they will be streaming their textures from the DVD (slow??) or whether they might dump a load of textures (for the current level perhaps) to HDD temporarily (faster) and stream them from there.[/quote]I've seen some systems that stream from DVD to RAM and the HDD at the same time, so that next time it can just stream from the HDD ([i]if one is present[/i]). This means that people with cheap (no HDD) Xboxes either have longer loading screens, or lower quality graphics for longer during streaming events.
Streaming from DVD isn't really that bad ([i]BluRay is worse[/i]) as long as you've taken care when creating your game's data archives in order to avoid seeking.
All the console game engines that I've used have put a decent amount of effort into the data tools so that the order of data on disc matches the order in which the game's code will request it (or vice versa).
Microsoft gives some tips here: [url="http://msdn.microsoft.com/en-us/library/windows/desktop/ee418705(v=vs.85).aspx"]http://msdn.microsof...5(v=vs.85).aspx[/url]
[quote name='Ashaman73' timestamp='1354012348' post='5004471']when using DDS you can access the single mipmap levels easy enough[/quote]The problem is that when reading from DVD, you want to read data in at least 32KiB blocks, and you want to read as many contiguous blocks as possible. The most optimal layout would have all the bottom-few mips of all the textures in your "level" packed tightly together, then all the next mips next to each other, then all the next-largest mips, etc... ([i]assuming that you're streaming in a "level's worth" of textures at a time[/i]).
DDS is also bad because it contains the header, then MIPs in order of highest-resolution to lowest resolution. This means that if you just want to read in the low-res mips first, you are forced to seek over the high-res ones. It might be more optimal to first stream in an entire contiguous array of DDS headers in one operation, and then determine your next move, rather than continually read individual headers off the disc.
I've often seen texture data stored in "texture collection" files rather than as individual textures, to speed up loading operations.[quote name='RobMaddison' timestamp='1354010489' post='5004466']isn't it going to be pretty slow to load in an image, lock the texture on the card, update it with the incoming higher level MIPs and then unlock it again?[/quote]The details for how you'd do this depend on the graphics API. On the consoles, you can manage video memory yourself, so if you know you're not going to create artefacts ([i]because you know that you've set the min-mip-level render-state so that the incoming mips aren't going to be read by the GPU[/i]), then you can stream data into the texture's memory allocation without locking.
Other APIs have flags to specify that you're not going to overwrite any in-use data with your update/map, so the driver doesn't need to lock. Alternatively, you can create two copies of the texture so that the one being updated isn't the same as the one being used ([i]and then swap the pointers a few frames later[/i]), but that of course is paying a RAM penalty to save on locking. Edited by Hodgman
2

Share this post


Link to post
Share on other sites
Some great replies and tips, thanks guys.

I'm guessing it's better to just get streaming working in general and then concentrate on the efficiency of loading data.
0

Share this post


Link to post
Share on other sites
[quote name='RobMaddison' timestamp='1354019780' post='5004493']
I'm guessing it's better to just get streaming working in general and then concentrate on the efficiency of loading data.
[/quote]Definately. If you're making a PC game, you don't need to put in half the optimisation effort that console devs do! Firstly you'll be loading your data from a HDD (or even SSD) instead of a DVD, and secondly, you don't have some platform gatekeeper that will block the release of your game unless you meet arbitrary quality requirements on loading screens [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img]
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