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:
@@ -54,12 +54,20 @@ namespace Nz
|
||||
if (!context.DidLastCallSucceed())
|
||||
throw std::runtime_error("failed to create texture");
|
||||
|
||||
#ifndef NAZARA_PLATFORM_WEB
|
||||
m_texture.SetParameteri(GL_TEXTURE_MAX_LEVEL, m_textureInfo.levelCount);
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_R, format->swizzleR);
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_G, format->swizzleG);
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_B, format->swizzleB);
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_A, format->swizzleA);
|
||||
|
||||
#ifndef NAZARA_PLATFORM_WEB
|
||||
if (format->swizzleR != GL_RED)
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_R, format->swizzleR);
|
||||
|
||||
if (format->swizzleG != GL_GREEN)
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_G, format->swizzleG);
|
||||
|
||||
if (format->swizzleB != GL_BLUE)
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_B, format->swizzleB);
|
||||
|
||||
if (format->swizzleA != GL_ALPHA)
|
||||
m_texture.SetParameteri(GL_TEXTURE_SWIZZLE_A, format->swizzleA);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user