Garry's Mod Wiki

Revision Difference

render_min_mag_filters#561141

<cat>Dev</cat> <title>Render Reference - Min and Mag Filters</title> # This page is an active work in progress as of 2024/3/2⤶ # Render Library References <warning> This page is an active work in progress as of 2024/3/2 </warning>⤶ ⤶ # Render Library References These pages seek to provide helpful insight into the groups of functions provided by the <page text="Render Library">render</page>. The major function groups are: * <page text="Beams">Beam_Rendering</page> * Minification and Magnification Filters ⤶ # What are Min(ification) and Mag(nification) Filters? Minification and Magnification filters are a feature of DirectX 9, which the Source Engine (and Garry's Mod, by extension) uses for its graphics rendering.⤶ ⤶ These two filters handle the very common situation where an image of some kind (a <page text="Texture">ITexture</page> or <page>Material</page> in the Source Engine) needs to be drawn at either a larger or smaller size than its natural size. In either case, there has to be some logic to tell the graphics system how it should stretch (Magnify) or compress (Minify) the image to make it fit the desired size.⤶ ⤶ In some situations like, for example, a pixel-art game, you may want low resolution pixel-art to be drawn at a much higher resolution on a modern display without the graphics system attempting to smooth the pixels as it stretches them, because smoothing would ruin the pixel-art look of the textures.⤶ ⤶ In other cases you might have a high resolution image, like a logo, that needs to be minified so that it can be drawn much smaller for something like a business card, or a HUD element without looking like it's missing key details of the design.⤶ ⤶ While it's not always necessary to make a specific minification and magnification filter choice for everything drawn to the screen, it can make a huge difference in the situations where it *is* needed.