Repository navigation
Models' level of detail can be chosen by the display's resolution - #344
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 game chooses a model's level of detail by its size in pixels on the Xbox's 480 lines, whatever the resolution, so at high resolutions distant models drop to their simpler levels long before it would show. display.model_detail (HALO_MODEL_DETAIL): "stock" (the default) chooses as the Xbox did; "native" by the size on the display's lines (without supersampling's factor); "highest" draws the models native does, each at its most detailed level. The first-person weapon and the sky are unchanged. Android draws 480 lines, so there native is stock. Checked: the same b30 view at 854x480 and 2400x1315 gave the same sizes in stock; at 1080p native measures 2.25 times as much and moves the corpses and weapons up a level, highest puts everything drawn at its top level. The level chosen is used only to draw (render_model's callers are the objects', the first-person weapon's and the sky's drawing), so nothing a network game agrees on changes; stock multiplies by exactly 1. Not checked with ssaa2x or on a 4K display, nor built for Android or the web.
Video Setup's Graphics screen gets a MODEL DETAIL row, which sets display.model_detail. Its values are stock, native and highest. 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.
Halo chooses each model's level of detail (up to five) from its size in pixels, but it measures that size on the Xbox's 480-line screen, whatever the resolution.
projection_world_to_screen.jis computed from the viewport's height, which is always 480 lines (render.c);d3d8_gl.cscales the real target afterwards. So at 1440p a model looks three times larger than the level was chosen for, and distant characters, vehicles and weapons drop to their simpler levels long before it would show. Neither window size nor supersampling changes the measure. The same b30 view at 854x480 and at 2400x1315 measured every model the same.Screenshots: a10's cryo bay at 1080p, the same frame with each setting. The Chief in his pod is about 130 pixels tall. Stock draws him at a simpler level than the screen has room for; highest draws his most detailed level (the chest plate, shoulders, knee armour and helmet). Zoomed 7x, nearest-neighbour:

Switching between the two:

Where that is in the frame (native changes him only slightly at 1080p; it does more at higher resolutions):

Change:
display.model_detail(HALO_MODEL_DETAIL), with a MODEL DETAIL row on Video Setup's Graphics screen:"stock"(the default): as on the Xbox. The size is multiplied by exactly 1, so nothing changes."native": sizes are measured in the display's lines (without supersampling's factor, and never below 1x), so more detail is kept at a distance at high resolutions. Small far models the Xbox left out are drawn."highest": the models"native"draws, each at its most detailed level.Details:
source/models/models.c(markedport:): the draw cutoff and the level loop multiply the size byhalo_model_detail_scale()(d3d8_gl.c)."native"is"stock";"highest"still applies.render_modelis called from the objects' drawing (and their shadows), the first-person weapon and the sky. Nothing writes it back, and nothing the simulation, AI, collision or the host reads depends on it, so players with different settings can't diverge.Test:
"stock": a grunt's corpse measures 20 px and is drawn at level 0 of 4."native": it measures 2.25 times as much and moves up a level, and assault rifles and plasma pistols move up one or two."highest": every model drawn is at level 4.tools/harnesspasses, as doestools/test_web_build.py's test that the menus match their generator.debug.menu_openand shows the row.