Repository navigation
Anisotropic filtering, 4x by default - #343
Open
startupfoundry wants to merge 2 commits into
Open
startupfoundry wants to merge 2 commits into
startupfoundry wants to merge 2 commits into
Conversation
The Xbox game never asks for anisotropic filtering: every sampler is linear or point with an anisotropy of 1, so floors, walls and terrain seen at a grazing angle blur into their small mip levels. display.anisotropic_filtering (HALO_ANISOTROPIC_FILTERING) samples the map's mipmapped, linearly filtered textures (base, detail, bump and environment maps) along the angle, at most 2, 4, 8 or 16 times and at most the GPU's limit; 0 filters as the Xbox did. Textures the game renders itself are left alone: at 16x the water's ripple map turned the far ocean into noise. Lightmaps have no mip levels and are unchanged. Checked: a10's cryo bay floor and b30's beach, off, 4x and 16x on the same frozen frame (grates and sand stay sharp, the water is unchanged); about +0.08 ms a frame on a10 at 1080p; tools/harness passes. Android and the web apply it only where GL_EXT_texture_filter_anisotropic exists; not built here.
Video Setup's Graphics screen gets a TEXTURE FILTERING row, which sets display.anisotropic_filtering. Its values are 0 (off, as on the Xbox), 2, 4, 8 and 16. Its XML is written by tools/port_settings.py's settings_files(), as tools/ce_menus.py writes it; no other screen changes. Checked: tools/test_web_build.py's test that the menus match their generator; the screen opened with debug.menu_open shows the row with the setting's value, above the help.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The game never asks for anisotropic filtering: every sampler it sets is linear or point with an anisotropy of 1. So floors, walls and terrain seen at a slant blur into their small mip levels a short way ahead: the cryo bay's grates on a10, the sand on b30.
Screenshots (the same frozen frame, stock above and 4x below, zoomed 4x nearest-neighbour so each game pixel is a 4x4 block):
a10's cryo bay, the vent strip beside the floor grate. Stock smears the slats into streaks; with filtering they stay separate:

The grate under the crewman. The lit slots break into dots in stock and stay whole:

b30's beach. The sand's detail map is kept instead of blurring out:

The whole a10 view, for where these are:

Change:
display.anisotropic_filtering(HALO_ANISOTROPIC_FILTERING; 0, 2, 4, 8 or 16, default 4), with a TEXTURE FILTERING row on Video Setup's Graphics screen.GL_EXT_texture_filter_anisotropicexists; otherwise nothing changes.Default: 4 departs from the Xbox's look, against the rule that such changes default to stock. 4x gets most of 16x's sharpness at less cost on phones and in browsers, and it costs about 0.08 ms a frame on a10 at 1080p on desktop. Happy to make it 0 if the project prefers.
How this differs from #341, which also adds anisotropic filtering, bundled with 5.1 surround sound:
Test:
tools/harnesspasses, as doestools/test_web_build.py's test that the menus match their generator.debug.menu_openand shows the row.