Sign in to follow this  
Promit

Multipass rendering -- buffer changes vs. texture changes

Recommended Posts

I'm going back and writing a multipass path for my terrain engine, and as I see it, there are two ways to structure it:
  • For each patch, set the first texture, render. Second texture, render. Third texture, render. This means a lot of texture switches but minimal buffer changes.
  • For each texture, render every patch. This means a lot of buffer changes, but minimal texture switches.
I'm inclined to think that the former method is going to make way better use of the post-TnL cache on-chip, but what I know of graphics leads me to think that I should strive to minimize texture state changes rather than buffer changes. Another thing is that I'm using offsets into a single buffer, so I never change buffer, only offset. I'm choosing the second method for this reason, because I don't think the offset changes are costing much...but I seriously doubt I'm putting the cache to good use. Any insights?

Share this post


Link to post
Share on other sites
unless you've got really small patches (32 vertices or so), you won't take advantage of post-TNL cache with the first method.
post-TNL cache sizes are typically between 12-32 indices (I have no idea how large it is on the last radeon and GeForce though...)
you will bind/unbind lots and lots of textures with the first method (unless you've got a small number of patches that is...
and it's not that good, it will very probably be much slower than the second method if you use offsets into a single large buffer.

EDIT: dammit... I keep crossposting today...

Share this post


Link to post
Share on other sites
My advice is to test both methods for your engine and see what the results are. Changing between the two should only take a few minutes and it will be easy to see the results (just check out the average fps for both).

I asked myself the same question a few months back when I was making my terrain engine and after testing I found there was now real difference between the two. I ended up sticking with your first option. Once I get settled into my new job I'm going to continue on with my terrain engine, if you want me to give some more detailed results I'd be happy to.

Doolwind

Share this post


Link to post
Share on other sites
Quote:
Original post by Doolwind
My advice is to test both methods for your engine and see what the results are. Changing between the two should only take a few minutes and it will be easy to see the results (just check out the average fps for both).


The TnL unit, as well as whatever is responsible for buffer flipping on my GF4 MX 440, is completely saturated. I've made tweaks to the rendering engine which showed 10x gains in speed on newer cards, and didn't increase the fps at all on my GF4 MX. It simply can't push any more than it already is.

Makes optimization a little tricky.

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