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

'Texture streaming'?

4 posts in this topic

Hi there,

 

I'm looking to learn the correct terminology for what I can best describe as 'texture streaming' to aid me in my Googling. It's the problem of memory constraint, when you need to load a texture dynamically because the camera has moved from a city to a forest and you need a whole stash of new textures.

     The texturing system I currently use in my engine ( which I am writing for educational purposes as well as a hobby ) is based on a texture array. I use each layer as an atlas except in the case of textures that need to be repeated, where I resize the textures to the maximum resolution and fit them into their own layers.
    The problem with this is that I do not know if I even *can* 'stream' new textures into the same texture array, or any algorithms to do so in a timely fashion, hence I need to know what this is called. Any papers/tutorials/etc on the subject are appreciated as well.

 

Thanks for your time,

Daniel Kruyt

0

Share this post


Link to post
Share on other sites

You can map the texture array elements as subresources.

 

Your approach sounds similar to ID's "megatexturing", where parts of the physical texture are loaded on demand based on an analysis frame which determines what logical textures are needed for the drawn frame, and in what relative size the logical textures should be within the physical texture.

 

Also search for "clipmapping". The public literature on the subject has been written before hardware-supported texture arrays became common. But, if anything, the newer available hardware techniques make the implementation easier.

Edited by Nik02
1

Share this post


Link to post
Share on other sites

I've a feeling that what you're really looking for here is not actually streaming, but rather just a simple map loader.  When the player moves from a city to a forest you pause the game, put up a "Loading" screen, delete all the city textures and load all the forest textures.

 

This doesn't only apply to textures - when you leave the city you're not going to need all those building models any more, but you will need tree models, so you'll be wanting to do the same with vertex buffers.

Edited by mhagain
1

Share this post


Link to post
Share on other sites

The borders are fuzzy at some point. Prefetching resources on demand can be done on in-game triggers if you want to avoid the loading screen. You just need to detect which resources will be needed next and which resources can be dropped now. The former one can be done on proximity or on explicit trigger volumes, while for the latter aspect also a decent resource cache system can be used. A more elaborate prefetch system may start with low detail level resources, and prefetch successively higher levels when needed.

 

A Clip-map (and its derived work MegaTexture and Virtual Texture) actually load LODs on demand, IIRC, but are intended for handling very large textures instead of dealing with totally exchanging the appearance. However, technically the difference is small to a texture management with prefetch and caching considering LOD.

 

The texturing system I currently use in my engine ( which I am writing for educational purposes as well as a hobby ) is based on a texture array. I use each layer as an atlas except in the case of textures that need to be repeated, where I resize the textures to the maximum resolution and fit them into their own layers.

Texture atlases are usually somewhat big, say 2k by 2k. Upscaling repeatable textures just for the purpose of fitting them into the one texture array seems me a bit strange. When the texture is relatively small originally, this would waste much texture space. 

 

The problem with this is that I do not know if I even *can* 'stream' new textures into the same texture array

Yes, it is possible to replace parts of textures. However, the question is whether this would not block the entire texture from use by the rendering process or at least would introduce another temporary copy. I assume that in case that a GPU command is still queued that access the texture for rendering, an update on the texture will cause some inefficiency. This would at least not occur when using different textures where the targeted texture is known to be obsolete (its similar to double buffering then).

Edited by haegarr
1

Share this post


Link to post
Share on other sites

@haegarr: Yes, I was aware that resizing the texture was a bit, well.. stupid, but I was not sure how costly glBindTexture was, to be honest, and my run-time atlas and model compilation took me quite a while to think up, so I wasn't sure how I could modify the code to suit binding different textures.

I'm guessing I can categorise models and terrain into world-space cubes for pre-emptive loading, and build a megatexture for all the static geometry. I'll probably do it at run-time, I believe I saw an article from a Leadwerkz developer about that. Time to rewrite everything for the umpteenth time, lol.

Thanks for all the advice, guys. :)

 

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