Sign in to follow this  
Davidtse

Best place to store roughness and other 1 channel maps?

Recommended Posts

Like the title says i'm curious about what's the most efficient place to store these one channel maps? Right now i'm rewriting my texture pipeline and I don't know if I should pack the roughness in the alpha channel of the diffuse and compress it with BC3 or just put the roughness into its own texture compressed with BC4 then do the diffuse with BC1. I don't have a super deep understanding of exactly how GPUs work yet so i'm not sure which one would end up being better, so If someone with some more insight could weigh in I would appreciate it.

 

Thanks, 

David 

Share this post


Link to post
Share on other sites

A BC3 texture is basically exactly the same as a BC1 and BC4 texture interleaved together :)

 

So in your example, you're basically asking whether structure of arrays (one array of diffuse values, and one array of roughness values), or array of structures (one array of diffuse/roughness pairs) :)

There's not much of a muchness... but each individual texture fetch takes some work per pixel - so packing two textures together (as long as they use the same UV coordinates) saves some work. Also, when the memory access patterns are the same (i.e. the UV coordinates are the same), then array of structures will likely cache better than structure of arrays will.

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