Hey guys, I've got three quick questions on the implementation of material layering.
I know you can either do some offline compositing (as MJP suggested) or do it using a limited amount of layers during runtime (as UE4 seems to do it).
I'm currently looking into the latter case....
Question 1: The material layering in the shader works by linearly interpolating the material attributes & textures, correct ? So you'd just do something like:
float3 DiffMap_0 = DiffuseMap_Layer0.Sample(DiffuseMapSampler, input.TexCoord).rgb; float3 DiffMap_1 = DiffuseMap_Layer1.Sample(DiffuseMapSampler, input.TexCoord).rgb; float3 DiffuseAlbedo = lerp(DiffMap_0, DiffMap_1, material_DiffBlendFactor.x);
Question 2: The problem you're facing now is that you'd need to (assuming a layer limit of 4) have 4 instances of every material property + 4 times the Textures you'd normally have, right ? I'm just wondering if that isn't memory bandwidth overkill...? I assume I'd have to make permutations of the shader that declares how many layers are used to decrease this for most materials that don't use the full 4 layers but still....worst case scenario would be 4 times the memory bandwidth of regular shading.
Question 3: Should the blending parameters extend to things like roughness,...? or should these parameters blend using a specular blend factor ? Or just a global blend mask/factor for the entire layer ? How much is overkill ?
Edited by lipsryme, 24 March 2014 - 07:18 AM.