Graphics: Switch glyph atlases to R8 instead of A8
A8 can't be supported efficiently on API lacking texture swizzle support (DX, WebGL, WebGPU), so we swizzle in the shader instead
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Nz
|
||||
TextureInfo textureInfo;
|
||||
textureInfo.width = size.x;
|
||||
textureInfo.height = size.y;
|
||||
textureInfo.pixelFormat = PixelFormat::A8;
|
||||
textureInfo.pixelFormat = PixelFormat::R8;
|
||||
textureInfo.type = ImageType::E2D;
|
||||
textureInfo.usageFlags = TextureUsage::ShaderSampling | TextureUsage::TransferSource | TextureUsage::TransferDestination;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ fn main(input: FragIn) -> FragOut
|
||||
let color = settings.BaseColor;
|
||||
|
||||
const if (HasUV)
|
||||
color *= TextureOverlay.Sample(input.uv).rrrg;
|
||||
color.a *= TextureOverlay.Sample(input.uv).r;
|
||||
|
||||
const if (HasColor)
|
||||
color *= input.color;
|
||||
|
||||
@@ -129,7 +129,7 @@ fn main(input: VertToFrag) -> FragOut
|
||||
let color = settings.BaseColor;
|
||||
|
||||
const if (HasUV)
|
||||
color *= TextureOverlay.Sample(input.uv).rrrg;
|
||||
color.a *= TextureOverlay.Sample(input.uv).r;
|
||||
|
||||
const if (HasColor)
|
||||
color *= input.color;
|
||||
|
||||
@@ -115,7 +115,7 @@ fn main(input: VertToFrag) -> FragOut
|
||||
let color = settings.BaseColor;
|
||||
|
||||
const if (HasUV)
|
||||
color *= TextureOverlay.Sample(input.uv).rrrg;
|
||||
color.a *= TextureOverlay.Sample(input.uv).r;
|
||||
|
||||
const if (HasColor)
|
||||
color *= input.color;
|
||||
|
||||
Reference in New Issue
Block a user