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

Texturing huge levels?

4 posts in this topic

So if I have a huge open level I need to render in-game (using XNA atm), what's the best method people can recommend for the texturing?
I've noticed in most commercial games, environments are only rendered with the high-res textures within a certain distance of the player, this then switches to a lower-res texture after a certain distance (which tends to be missing normal maps too). You can usually spot this in commercial games if you look for it.

I guess it's obvious that this is necessary for high-end graphics but I'm unsure about how it's accomplished? If I handle the texturing with a shader, is it just a matter of creating 2 different texture samplers, one for the high res texture and one for the low? And then just choose which one based on the distance from the character? I assume that would work but is that the most efficient way to go about it? I'm unclear about where the most resources are used. Wouldn't this just add to the strain on the GPU? Having 2 samplers instead of 1? Or would this be less important than the fact that there'll be less texture resolution on screen in total?

Thanks in advance and apologies for the clumsy description.
0

Share this post


Link to post
Share on other sites
Most environments use modular textures, that is they reuse textures on mass. Only exception which comes to mind is id tech5 (game: rage), which use virtual textures (called mega textures). The process of reducing the qualtiy of a texture is called mipmapping. Normalmaps are a special case, because high-frequency textures would result to light-flickering in the distance. Toning them down by either a clever use of mipmapping or turning off expensive shaders, is a valid option.

If mipmapping is not enough, you need 2 samplers and an interpolation value (ie. time dependent or depth from a g-buffer) to blend between the textures. But this technique makes only sense when streaming in hi-detail textures, if the hi-detail texture is present, use mipmapping. Edited by Ashaman73
2

Share this post


Link to post
Share on other sites
Thanks for the quick reply.
Yes, I'm aware how mipmapping works, but I was under the impression that standard mipmapping would give more of a blend between foreground and background textures whereas quite a lot of commercial games I've actually noticed a clear line between the 2 (it's incredibly noticable in the original Mass Effect). Does this not suggest that they're using 2 texture samplers? EDIT: quickly read up on the details of mipmapping and I assume the visual artifact was just down to them using point-filtering?

Could you also elaborate on what your last paragraph meant? What do you mean by "only makes sense when streaming in hi-detail textures"? And I've done the 2 samplers with an interpolation value approach before, in one of Riemers XNA tutorials if I remember correctly. I'm not entirely clear what the difference is between these 2 methods? Surely using 2 texture samplers and interpolating between them is effectively just a manual way of achieving the same thing mipmapping does? Edited by gchewood
0

Share this post


Link to post
Share on other sites
[quote name='gchewood' timestamp='1352446456' post='4999177']
clear line between the 2
[/quote]
Have you a screenshot to show off the effect you meant ?

[quote name='gchewood' timestamp='1352446456' post='4999177']
What do you mean by "only makes sense when streaming in hi-detail textures"?
[/quote]
Hi-res textures can consume huge amounts of memory, especially on memory limited devices like consoles. In this case only low res-textures are often loaded for potentially visible geometry. When you come close to the geometry the hi-res textures are loaded in the background (streaming) and slowly blended in to exchange the low res version. This is a continiously process in which no longer used hi-res textures are overwritten by new hi-res textures.

A simple way to accomplish this is to use two samplers during the blending (exchange low res<->hi res). Once you have faded it in you can either use an other shader, a dummy texture, branching etc. to turn it off. Edited by Ashaman73
1

Share this post


Link to post
Share on other sites
To understand this I'd recommend that you look at how it works in a sample program. I'm going to refer you to the D3D9 mipmapping sample on the CodeSampler website: http://www.codesampler.com/dx9src/dx9src_3.htm#dx9_texture_mipmapping

Don't worry about the source code for now, just run the application.

The option of interest here is D3DSAMP_MIPFILTER, which controls the type of filtering done between miplevels. You should switch back and forth between D3DTEXF_LINEAR and D3DTEXF_POINT for this option, and see how the image changes. The linear mip filter will give you a smooth gradient between mip levels, whereas the point mip filter will give you the sudden changes with visible lines between different levels of detail that you have observed.

Now, the texture they've chosen for this sample app is a fairly contrived one designed to demonstrate the effect of different filters, so what you can also do is try replacing it with something more representative of what you're likely to encounter in a real program; I used the brick wall texture available at [url="http://en.wikipedia.org/wiki/File:Brickwall_texture.jpg"]http://en.wikipedia.org/wiki/File:Brickwall_texture.jpg[/url] as an example, just pasting the new image into the textures provided in this app and reducing size as appropriate, and here's what it looks like with a point mip filter: [url="http://i47.tinypic.com/o5p16f.jpg"]http://i47.tinypic.com/o5p16f.jpg[/url]

You need to look a little closer, but again you can see a sharp transition between different mip levels.
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