mirror of
https://github.com/luanti-org/luanti.git
synced 2026-01-01 10:45:32 +01:00
IrrlichtMt: Implement mip-mapping for RTTs (#16434)
This can be helpful to draw fonts memory-efficiently at varying scales. Adds ETCF_CREATE_RTT_MIP_MAPS to generate mip-maps on request.
This commit is contained in:
@@ -84,9 +84,17 @@ CNullDriver::CNullDriver(io::IFileSystem *io, const core::dimension2d<u32> &scre
|
||||
InitMaterial2D.AntiAliasing = video::EAAM_OFF;
|
||||
InitMaterial2D.ZWriteEnable = video::EZW_OFF;
|
||||
InitMaterial2D.ZBuffer = video::ECFN_DISABLED;
|
||||
InitMaterial2D.UseMipMaps = false;
|
||||
InitMaterial2D.forEachTexture([](auto &tex) {
|
||||
InitMaterial2D.UseMipMaps = true;
|
||||
InitMaterial2D.forEachTexture([](video::SMaterialLayer &tex) {
|
||||
// Best preset for 2D pixel-perfect graphics
|
||||
tex.MinFilter = video::ETMINF_NEAREST_MIPMAP_NEAREST;
|
||||
|
||||
// Best preset for downscaled 2D graphics using trilinear interpolation
|
||||
//tex.MinFilter = video::ETMINF_LINEAR_MIPMAP_LINEAR;
|
||||
// Lower bias -> more crisp images, more jitter
|
||||
// Higher bias -> burry images, less jitter
|
||||
//tex.LODBias = -1;
|
||||
|
||||
tex.MagFilter = video::ETMAGF_NEAREST;
|
||||
tex.TextureWrapU = video::ETC_REPEAT;
|
||||
tex.TextureWrapV = video::ETC_REPEAT;
|
||||
|
||||
Reference in New Issue
Block a user