Best place to store roughness and other 1 channel maps?

Started by
1 comment, last by Davidtse 7 years, 11 months ago

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

I'm working on a first person zombie shooter that's set in a procedural open world. I'm using a custom game engine created from scratch with opengl and C++. Follow my development blog for updates on the game and the engine. http://www.Subsurfacegames.com

Advertisement

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.

Thanks Hodgman, that makes sense.

I'm working on a first person zombie shooter that's set in a procedural open world. I'm using a custom game engine created from scratch with opengl and C++. Follow my development blog for updates on the game and the engine. http://www.Subsurfacegames.com

This topic is closed to new replies.

Advertisement