29 lines
535 B
HLSL
29 lines
535 B
HLSL
struct FontInfo {
|
|
float2 position; // 8 bytes alignment 0
|
|
float2 size; // 8 bytes alignment 8
|
|
uint isSdf; // 4 bytes 16
|
|
uint pad0; // 4 bytes
|
|
float2 pad2; // 8 bytes
|
|
};
|
|
|
|
float getRedFromUint(uint color)
|
|
{
|
|
return float(color & 0xFF) / 255.0;
|
|
}
|
|
|
|
float getGreenFromUint(uint color)
|
|
{
|
|
return float((color >> 8) & 0xFF) / 255.0;
|
|
}
|
|
|
|
float getBlueFromUint(uint color)
|
|
{
|
|
return float((color >> 16) & 0xFF) / 255.0;
|
|
}
|
|
|
|
float getAlphaFromUint(uint color)
|
|
{
|
|
return float((color >> 24) & 0xFF) / 255.0;
|
|
}
|
|
|