mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-01-05 17:13:28 +08:00
27 lines
627 B
GLSL
27 lines
627 B
GLSL
struct LpvBlockData { // 8 x1280 =?
|
|
uint MaskWeight; // 4
|
|
uint ColorRange; // 4
|
|
};
|
|
|
|
#ifdef RENDER_SETUP
|
|
layout(binding = 0) writeonly buffer lpvBlockData
|
|
#else
|
|
layout(binding = 0) readonly buffer lpvBlockData
|
|
#endif
|
|
{
|
|
LpvBlockData LpvBlockMap[];
|
|
};
|
|
|
|
uint BuildBlockLpvData(uint mixMask, float mixWeight) {
|
|
uint data = uint(saturate(mixWeight) * 255.0);
|
|
|
|
data = data | (mixMask << 8);
|
|
|
|
return data;
|
|
}
|
|
|
|
void ParseBlockLpvData(const in uint data, out uint mixMask, out float mixWeight) {
|
|
mixWeight = (data & 0xFF) / 255.0;
|
|
mixMask = (data >> 8) & 0xFF;
|
|
}
|