Preparing for performance issues (textures)

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Preparing for performance issues (textures)

Post by ibax »

Hi,

I would like to ask you, how to manage the quality part of the development? I mean, how can I prepare to a user with an older PC and lower screen resolution (1024x768) vs newer PC with 1920x1080. If I use a big size of textures with big resolution, maybe the program will run only with 3-5 FPS, but when I use small size of textures, it will not look nice on a high screen resolution monitor...

Should I create the textures in two sizes? And decide in the program, which one to use?
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Preparing for performance issues (textures)

Post by CuteAlien »

I've seen different projects handle such problems in different ways. But the by far most common solution was to set minimal requirements and simply ignore systems below that. I'm also not sure how much the texture-size really affects speed (you have to test that stuff with concrete scenes), but I guess using a detail-texture on a lower-resolution base-texture might have better effects. And enabling/disabling that will also be easier and have probably have some noticable impact on speed.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Preparing for performance issues (textures)

Post by greenya »

I would suggest to have most detailed textures (say like 1920x1080) so the look good on hires monitor. But when you run app you check system capabilities and if you found low resolution (say like 1024x768) you can resize them before using them actual at runtime (so you start process like "optimizing textures please wait...").
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Preparing for performance issues (textures)

Post by ibax »

greenya wrote:I would suggest to have most detailed textures (say like 1920x1080) so the look good on hires monitor. But when you run app you check system capabilities and if you found low resolution (say like 1024x768) you can resize them before using them actual at runtime (so you start process like "optimizing textures please wait...").
this sounds good... with this I need only to check the actual resolution and convert the textures to the correct width/height
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Preparing for performance issues (textures)

Post by hendu »

Test before doing that, texture size doesn't have that big an effect unless you run out of vram.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Preparing for performance issues (textures)

Post by Mel »

It is more important to have good art assets that balance well the usage of textures. That allows you to have good looking graphics with really low resolution textures. After all, the most important thing of a texture is the amount of screen it covers and its pixel/texel ratio (being 1 the ideal), First create good assets, and later, prepare for texture optimization, maybe you don't even need it. Also, it is convenient to note that filtering is an important issue to keep in mind because an old video card probably won't "enjoy" as much as a new one things like anisotropic filtering, or even trilinear mipmap interpolation. Anisotropic requires more memory, and trilinear filtering is slower than bilinear. So, on older hardware (GeForce7 or 8 for instance) it is more important to keep the filtering low than using large textures to gain performance. Of course, smaller textures are faster, so, reducing the resolution is a good idea. 256x256 is a recomended texture size in the directX SDK, for instance.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Preparing for performance issues (textures)

Post by ibax »

Thank you for the valuable information.
I will check these things (anisotropic filtering, trilinear filtering, bilinear filtering), because I never used them before...
Are these supported by Irrlicht? Is there a tutorial somewhere, how to set up this correctly?
(However, I will google for it...)
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Preparing for performance issues (textures)

Post by hendu »

If you don't use any advanced features, it's likely your app will run well on old hardware :)
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Preparing for performance issues (textures)

Post by ibax »

hendu wrote:If you don't use any advanced features, it's likely your app will run well on old hardware :)
Of course I would like to use newer techniques if possible, to get as most realistic look as possible...

Just I need to know, what are the possibilites? :) Is there a tutorial or something, showing these advanced features?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Preparing for performance issues (textures)

Post by hendu »

Not really, that's why they're called advanced features heh ;)

Sure there are tutorials showing how to use shaders, but then what you do with that (fully programmable pipeline) sky's the limit.
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Preparing for performance issues (textures)

Post by CuteAlien »

All those filter options can be set in SMaterial. No shaders needed for that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Preparing for performance issues (textures)

Post by Mel »

You can do very decent effects without shaders at all :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Preparing for performance issues (textures)

Post by hendu »

Certainly, but talking about realistic looks you do need more than the fixed pipeline.

On topic: I have no issue using 4k and 2k textures on mobile X1600 (r500). OP should define what he considers his minimum target.
Mikhail9
Posts: 54
Joined: Mon Jun 29, 2009 8:41 am

Re: Preparing for performance issues (textures)

Post by Mikhail9 »

Are big texture atlases (how big?) and maximal batching the route to minimize frame draw times? I know you should minimize draw calls, meaning batching, but also context switches, which I assume translates into minimizing the number of materials.

Can somebody break down for me the best practices for maximizing the power and speed of the GPU, and also for avoiding becoming CPU bound on draw calls?

Thanks.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Preparing for performance issues (textures)

Post by Mel »

Yes, renderstate changes (materials) are expensive relatively. But there are worse things, like switching rendertargets

The less draw calls, the better
The smallest amount of material CHANGES (textures, transparency...), the better
The largest amount of static meshes, stored in hardware, the better. This is a DX8 level feature, so it is pretty normal even for old hardware to support this
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply