Sign in to follow this  
Followers 0
Lil_Lloyd

OpenGL
Texture filtering modes and performance boosts

8 posts in this topic

Hi. I'm not 'new' to opengl nor programming but I've only recently started work on independent projects outside of messing around in textbooks with fixed pipeline and programmable pipeline projects, glsl, etc. Basically the basics are basic to me ;)

 

However, I've only started experimenting with the texture filter modes. On a heightmap terrain I had the mag filter as GL_LINEAR and the min filter set as the same, and my app was crushingly slow. Now I set the min filter as GL_NEAREST_MIPMAP_LINEAR and the performance shot through the roof!

 

I was under the false assumption that using mipmaps would slow things down somewhat. So what gives?

0

Share this post


Link to post
Share on other sites

Brother Bob. That is a very informative answer! I have always thought about the cache with regards to Data-Oriented programming and trying to 'sort' virtual function calls in arrays but that's the first time I ever thought about memory look ups on texels. 

1

Share this post


Link to post
Share on other sites

JTippetts, thank you also for your explanation. There can never be too many points of view of the same problem, even if they are similar, as the different wording of each answer can convey different aspects with more clarity.

1

Share this post


Link to post
Share on other sites

In general, memory bandwidth is improving at a slower rate than processor arithmetic speeds are improving.

In relative terms, over the years, the amount of memory that we can transfer in the same time as one CPU clock-cycle has actually decreased!

 

All the same issues apply to GPUs -- bandwidth often becomes the bottleneck instead of ALU cycles. Using smaller data formats can often give huge speed boosts -- as above, mip-mapping is kinda-sorta a form of data compression for the case where you're viewing a texture at a distance wink.png

 

It's also interesting to look at the specs of cheap vs expensive models of video cards -- often one of the things that separates them is an order of magnitude difference in their memory bandwidth! e.g. picking some nVidia cards:

GeForce 205 -> 8 GiB/s

GeForce GTX 285 -> 159.0 GiB/s

 

Your high-end users can process a hell of a lot more data per frame than your low-end users can, which is why the low-end cards will have to use lower-resolution render-targets and textures, lower vertex counts, etc, etc...

Edited by Hodgman
3

Share this post


Link to post
Share on other sites

Hodgman, do you know of a good resource for learning more about the hardware architecture of video cards as it relates to how data flows through the rendering pipeline?

0

Share this post


Link to post
Share on other sites

CDProp, this might not be EXACTLY what you're looking for but Coursera.org has a great course on CUDA and GPU, you learn a lot about bandwidth issues like Hodgman has been mentioning. His input made me think about it actually.

1

Share this post


Link to post
Share on other sites
Hodgman, do you know of a good resource for learning more about the hardware architecture of video cards as it relates to how data flows through the rendering pipeline?

The manuals and documentation that come with the console dev-kits are extremely useful, but aren't publicly available wink.png sad.png

 

nVidia and ATI occasionally publish programming guides for different generations of hardware... even the Cuda/etc ones, or presentations about certain hardware families (e.g.  "fermi") might give some insight into how the hardware works.

2

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