Skip to content

Instantly share code, notes, and snippets.

@peted70
Created June 4, 2018 11:43
Show Gist options
  • Save peted70/56e380c07b42e127a01cbb1280fb4bb4 to your computer and use it in GitHub Desktop.
Save peted70/56e380c07b42e127a01cbb1280fb4bb4 to your computer and use it in GitHub Desktop.
#ifdef HAS_METALROUGHNESSMAP
// Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel.
// This layout intentionally reserves the 'r' channel for (optional) occlusion map data
float4 mrSample = metallicRoughnessTexture.Sample(metallicRoughnessSampler, input.texcoord);
perceptualRoughness = mrSample.g * perceptualRoughness;
metallic = mrSample.b * metallic;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment